@readium/shared 2.2.0-beta.1 → 2.2.0-beta.2
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 +939 -725
- package/dist/index.umd.cjs +3 -3
- package/package.json +1 -1
- package/src/publication/Publication.ts +12 -0
- package/src/publication/services/index.ts +2 -1
- package/src/publication/services/timeline/Timeline.ts +349 -0
- package/src/publication/services/timeline/TimelineItem.ts +24 -0
- package/src/publication/services/timeline/index.ts +2 -0
- package/types/src/publication/Publication.d.ts +8 -0
- package/types/src/publication/services/index.d.ts +1 -0
- package/types/src/publication/services/timeline/Timeline.d.ts +94 -0
- package/types/src/publication/services/timeline/TimelineItem.d.ts +24 -0
- package/types/src/publication/services/timeline/index.d.ts +2 -0
- package/types/test/AltIdentifier.test.d.ts +1 -0
- package/types/test/Contributor.test.d.ts +1 -0
- package/types/test/GuidedNavigation.test.d.ts +1 -0
- package/types/test/Link.test.d.ts +1 -0
- package/types/test/LocalizedString.test.d.ts +1 -0
- package/types/test/Locator.test.d.ts +1 -0
- package/types/test/LocatorCollection.test.d.ts +1 -0
- package/types/test/Manifest.test.d.ts +1 -0
- package/types/test/Metadata.test.d.ts +1 -0
- package/types/test/Properties.test.d.ts +1 -0
- package/types/test/Publication.test.d.ts +1 -0
- package/types/test/PublicationCollection.test.d.ts +1 -0
- package/types/test/Subject.test.d.ts +1 -0
- package/types/test/TDM.test.d.ts +1 -0
- package/types/test/Timeline.test.d.ts +1 -0
- package/types/test/accessibility/Accessibility.test.d.ts +1 -0
- package/types/test/accessibility/AccessibilityMetadataDisplayGuide.test.d.ts +1 -0
- package/types/test/accessibility/Localization.test.d.ts +1 -0
- package/types/test/encryption/Encryption.test.d.ts +1 -0
- package/types/test/encryption/Properties.test.d.ts +1 -0
- package/types/test/epub/MediaOverlay.test.d.ts +1 -0
- package/types/test/epub/Metadata.test.d.ts +1 -0
- package/types/test/epub/PropertiesTest.test.d.ts +1 -0
- package/types/test/epub/PublicationTest.test.d.ts +1 -0
- package/types/test/html/DomRange.test.d.ts +1 -0
- package/types/test/html/Locator.test.d.ts +1 -0
- package/types/test/opds/PropertiesTest.test.d.ts +1 -0
- package/types/test/opds/PublicationTest.test.d.ts +1 -0
- package/types/test/util/URITemplate.test.d.ts +1 -0
- package/types/test/util/mediatype/MediaType.test.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class ei {
|
|
2
2
|
close() {
|
|
3
3
|
}
|
|
4
4
|
links() {
|
|
@@ -8,7 +8,7 @@ class ti {
|
|
|
8
8
|
throw Error("This is an empty fetcher");
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
class
|
|
11
|
+
class er {
|
|
12
12
|
constructor(t, e) {
|
|
13
13
|
this.client = t || window.fetch.bind(window), this.baseUrl = e;
|
|
14
14
|
}
|
|
@@ -19,12 +19,12 @@ class tr {
|
|
|
19
19
|
const e = t.toURL(this.baseUrl);
|
|
20
20
|
if (e === void 0)
|
|
21
21
|
throw Error(`Invalid HREF: ${t.href}`);
|
|
22
|
-
return new
|
|
22
|
+
return new ii(this.client, t, e);
|
|
23
23
|
}
|
|
24
24
|
close() {
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
class
|
|
27
|
+
class ii {
|
|
28
28
|
constructor(t, e, i) {
|
|
29
29
|
this.client = t || window.fetch.bind(window), this._link = e, this.url = i;
|
|
30
30
|
}
|
|
@@ -88,12 +88,12 @@ class ei {
|
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
class
|
|
91
|
+
class ir {
|
|
92
92
|
constructor(t, e) {
|
|
93
93
|
this.start = t, this.endInclusive = e;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
class
|
|
96
|
+
class sr {
|
|
97
97
|
readAsString() {
|
|
98
98
|
return this.read().then((t) => t === void 0 ? t : new TextDecoder().decode(t));
|
|
99
99
|
}
|
|
@@ -115,14 +115,14 @@ class V {
|
|
|
115
115
|
if (!t || typeof t != "object") return;
|
|
116
116
|
const e = t;
|
|
117
117
|
return new V({
|
|
118
|
-
conformsTo: e.conformsTo ? e.conformsTo.map((i) =>
|
|
118
|
+
conformsTo: e.conformsTo ? e.conformsTo.map((i) => It.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
119
119
|
certification: e.certification ? Pt.deserialize(e.certification) : void 0,
|
|
120
120
|
summary: e.summary,
|
|
121
|
-
accessMode: e.accessMode ? e.accessMode.map((i) =>
|
|
122
|
-
accessModeSufficient: e.accessModeSufficient ? e.accessModeSufficient.map((i) =>
|
|
121
|
+
accessMode: e.accessMode ? e.accessMode.map((i) => k.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
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
124
|
hazard: e.hazard ? e.hazard.map((i) => P.deserialize(i)).filter((i) => i !== void 0) : void 0,
|
|
125
|
-
exemption: e.exemption ? e.exemption.map((i) =>
|
|
125
|
+
exemption: e.exemption ? e.exemption.map((i) => Nt.deserialize(i)).filter((i) => i !== void 0) : void 0
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
@@ -170,7 +170,7 @@ const b = class b {
|
|
|
170
170
|
}
|
|
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
|
-
let
|
|
173
|
+
let It = b;
|
|
174
174
|
class Pt {
|
|
175
175
|
constructor(t = null, e = null, i = null) {
|
|
176
176
|
this.certifiedBy = t, this.credential = e, this.report = i;
|
|
@@ -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
|
|
217
|
-
const
|
|
216
|
+
let k = y;
|
|
217
|
+
const L = class L {
|
|
218
218
|
constructor(t) {
|
|
219
219
|
if (typeof t == "string") {
|
|
220
|
-
if (!
|
|
220
|
+
if (!L.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) =>
|
|
225
|
+
(i) => L.VALID_MODES.has(i.toLowerCase())
|
|
226
226
|
);
|
|
227
227
|
if (e.length === 0)
|
|
228
228
|
return;
|
|
@@ -235,11 +235,11 @@ const x = class x {
|
|
|
235
235
|
static deserialize(t) {
|
|
236
236
|
if (!t) return;
|
|
237
237
|
if (typeof t == "string")
|
|
238
|
-
return new
|
|
238
|
+
return new L(t);
|
|
239
239
|
if (!Array.isArray(t)) return;
|
|
240
|
-
const e = t.filter((i) => i ?
|
|
240
|
+
const e = t.filter((i) => i ? L.VALID_MODES.has(i.toLowerCase()) : !1);
|
|
241
241
|
if (e.length !== 0)
|
|
242
|
-
return new
|
|
242
|
+
return new L(e);
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
245
245
|
* Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
|
|
@@ -248,8 +248,8 @@ const x = class x {
|
|
|
248
248
|
return this.value;
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
|
|
252
|
-
let
|
|
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;
|
|
253
253
|
const l = class l {
|
|
254
254
|
constructor(t) {
|
|
255
255
|
this.value = t;
|
|
@@ -309,10 +309,10 @@ const S = class S {
|
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
S.NONE = new S("none"), S.DOCUMENTED = new S("documented"), S.LEGAL = new S("legal"), S.TEMPORARY = new S("temporary"), S.TECHNICAL = new S("technical"), S.EAA_DISPROPORTIONATE_BURDEN = new S("eaa-disproportionate-burden"), S.EAA_FUNDAMENTAL_ALTERATION = new S("eaa-fundamental-alteration"), S.EAA_MICROENTERPRISE = new S("eaa-microenterprise"), S.EAA_TECHNICAL_IMPOSSIBILITY = new S("eaa-technical-impossibility"), S.EAA_TEMPORARY = new S("eaa-temporary");
|
|
312
|
-
let
|
|
313
|
-
const ee = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], ii = /* @__PURE__ */ JSON.parse(`{"format":{"audiobook":"Audiobook","audiobookJSON":"Audiobook Manifest","cbz":"Comic Book Archive","divina":"Divina Publication","divinaJSON":"Divina Publication Manifest","epub":"EPUB","lcpa":"LCP Protected Audiobook","lcpdf":"LCP Protected PDF","lcpl":"LCP License Document","pdf":"PDF","rwp":"Readium Web Publication","rwpm":"Readium Web Publication Manifest","zab":"Audiobook Archive","zip":"ZIP Archive"},"kind":{"audiobook_one":"audiobook","audiobook_other":"audiobooks","book_one":"book","book_other":"books","comic_one":"comic","comic_other":"comics","document_one":"document","document_other":"documents"},"metadata":{"accessibility":{"display-guide":{"accessibility-summary":{"no-metadata":"No information is available","publisher-contact":"For more information about the accessibility of this product, please contact the publisher: ","title":"Accessibility summary"},"additional-accessibility-information":{"aria":{"compact":"ARIA roles included","descriptive":"Content is enhanced with ARIA roles to optimize organization and facilitate navigation"},"audio-descriptions":"Audio descriptions","braille":"Braille","color-not-sole-means-of-conveying-information":"Color is not the sole means of conveying information","dyslexia-readability":"Dyslexia readability","full-ruby-annotations":"Full ruby annotations","high-contrast-between-foreground-and-background-audio":"High contrast between foreground and background audio","high-contrast-between-text-and-background":"High contrast between foreground text and background","large-print":"Large print","page-breaks":{"compact":"Page breaks included","descriptive":"Page breaks included from the original print source"},"ruby-annotations":"Some Ruby annotations","sign-language":"Sign language","tactile-graphics":{"compact":"Tactile graphics included","descriptive":"Tactile graphics have been integrated to facilitate access to visual elements for blind people"},"tactile-objects":"Tactile 3D objects","text-to-speech-hinting":"Text-to-speech hinting provided","title":"Additional accessibility information","ultra-high-contrast-between-text-and-background":"Ultra high contrast between text and background","visible-page-numbering":"Visible page numbering","without-background-sounds":"Without background sounds"},"conformance":{"a":{"compact":"This publication meets minimum accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level A standard"},"aa":{"compact":"This publication meets accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AA standard"},"aaa":{"compact":"This publication exceeds accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AAA standard"},"certifier":"The publication was certified by ","certifier-credentials":"The certifier's credential is ","details":{"certification-info":"The publication was certified on ","certifier-report":"For more information refer to the certifier's report","claim":"This publication claims to meet","epub-accessibility-1-0":"EPUB Accessibility 1.0","epub-accessibility-1-1":"EPUB Accessibility 1.1","level-a":"Level A","level-aa":"Level AA","level-aaa":"Level AAA","wcag-2-0":{"compact":"WCAG 2.0","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.0"},"wcag-2-1":{"compact":"WCAG 2.1","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.1"},"wcag-2-2":{"compact":"WCAG 2.2","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.2"}},"details-title":"Detailed conformance information","no":"No information is available","title":"Conformance","unknown-standard":"Conformance to accepted standards for accessibility of this publication cannot be determined"},"hazards":{"flashing":{"compact":"Flashing content","descriptive":"The publication contains flashing content that can cause photosensitive seizures"},"flashing-none":{"compact":"No flashing hazards","descriptive":"The publication does not contain flashing content that can cause photosensitive seizures"},"flashing-unknown":{"compact":"Flashing hazards not known","descriptive":"The presence of flashing content that can cause photosensitive seizures could not be determined"},"motion":{"compact":"Motion simulation","descriptive":"The publication contains motion simulations that can cause motion sickness"},"motion-none":{"compact":"No motion simulation hazards","descriptive":"The publication does not contain motion simulations that can cause motion sickness"},"motion-unknown":{"compact":"Motion simulation hazards not known","descriptive":"The presence of motion simulations that can cause motion sickness could not be determined"},"no-metadata":"No information is available","none":{"compact":"No hazards","descriptive":"The publication contains no hazards"},"sound":{"compact":"Sounds","descriptive":"The publication contains sounds that can cause sensitivity issues"},"sound-none":{"compact":"No sound hazards","descriptive":"The publication does not contain sounds that can cause sensitivity issues"},"sound-unknown":{"compact":"Sound hazards not known","descriptive":"The presence of sounds that can cause sensitivity issues could not be determined"},"title":"Hazards","unknown":"The presence of hazards is unknown"},"legal-considerations":{"exempt":{"compact":"Claims an accessibility exemption in some jurisdictions","descriptive":"This publication claims an accessibility exemption in some jurisdictions"},"no-metadata":"No information is available","title":"Legal considerations"},"navigation":{"index":{"compact":"Index","descriptive":"Index with links to referenced entries"},"no-metadata":"No information is available","page-navigation":{"compact":"Go to page","descriptive":"Page list to go to pages from the print source version"},"structural":{"compact":"Headings","descriptive":"Elements such as headings, tables, etc for structured navigation"},"title":"Navigation","toc":{"compact":"Table of contents","descriptive":"Table of contents to all chapters of the text via links"}},"rich-content":{"accessible-chemistry-as-latex":{"compact":"Chemical formulas in LaTeX","descriptive":"Chemical formulas in accessible format (LaTeX)"},"accessible-chemistry-as-mathml":{"compact":"Chemical formulas in MathML","descriptive":"Chemical formulas in accessible format (MathML)"},"accessible-math-as-latex":{"compact":"Math as LaTeX","descriptive":"Math formulas in accessible format (LaTeX)"},"accessible-math-described":"Text descriptions of math are provided","closed-captions":{"compact":"Videos have closed captions","descriptive":"Videos included in publications have closed captions"},"extended-descriptions":"Information-rich images are described by extended descriptions","math-as-mathml":{"compact":"Math as MathML","descriptive":"Math formulas in accessible format (MathML)"},"open-captions":{"compact":"Videos have open captions","descriptive":"Videos included in publications have open captions"},"title":"Rich content","transcript":"Transcript(s) provided","unknown":"No information is available"},"ways-of-reading":{"nonvisual-reading":{"alt-text":{"compact":"Has alternative text","descriptive":"Has alternative text descriptions for images"},"no-metadata":"No information about nonvisual reading is available","none":{"compact":"Not readable in read aloud or dynamic braille","descriptive":"The content is not readable as read aloud speech or dynamic braille"},"not-fully":{"compact":"Not fully readable in read aloud or dynamic braille","descriptive":"Not all of the content will be readable as read aloud speech or dynamic braille"},"readable":{"compact":"Readable in read aloud or dynamic braille","descriptive":"All content can be read as read aloud speech or dynamic braille"}},"prerecorded-audio":{"complementary":{"compact":"Prerecorded audio clips","descriptive":"Prerecorded audio clips are embedded in the content"},"no-metadata":"No information about prerecorded audio is available","only":{"compact":"Prerecorded audio only","descriptive":"Audiobook with no text alternative"},"synchronized":{"compact":"Prerecorded audio synchronized with text","descriptive":"All the content is available as prerecorded audio synchronized with text"}},"title":"Ways of reading","visual-adjustments":{"modifiable":{"compact":"Appearance can be modified","descriptive":"Appearance of the text and page layout can be modified according to the capabilities of the reading system (font family and font size, spaces between paragraphs, sentences, words, and letters, as well as color of background and text)"},"unknown":"No information about appearance modifiability is available","unmodifiable":{"compact":"Appearance cannot be modified","descriptive":"Text and page layout cannot be modified as the reading experience is close to a print version, but reading systems can still provide zooming options"}}}}},"altIdentifier_one":"alternate identifier","altIdentifier_other":"alternate identifiers","artist_one":"artist","artist_other":"artists","author_one":"author","author_other":"authors","collection_one":"editorial collection","collection_other":"editorial collections","colorist_one":"colorist","colorist_other":"colorists","contributor_one":"contributor","contributor_other":"contributors","description":"description","duration":"duration","editor_one":"editor","editor_other":"editors","identifier_one":"identifier","identifier_other":"identifiers","illustrator_one":"illustrator","illustrator_other":"illustrators","imprint_one":"imprint","imprint_other":"imprints","inker_one":"inker","inker_other":"inkers","language_one":"language","language_other":"languages","letterer_one":"letterer","letterer_other":"letterers","modified":"modification date","narrator_one":"narrator","narrator_other":"narrators","numberOfPages":"print length","penciler_one":"penciler","penciler_other":"pencilers","published":"publication date","publisher_one":"publisher","publisher_other":"publishers","series_one":"series","series_other":"series","subject_one":"subject","subject_other":"subjects","subtitle":"subtitle","title":"title","translator_one":"translator","translator_other":"translators"}}`), si = {
|
|
314
|
-
publication:
|
|
315
|
-
},
|
|
312
|
+
let Nt = S;
|
|
313
|
+
const ie = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], si = /* @__PURE__ */ JSON.parse(`{"format":{"audiobook":"Audiobook","audiobookJSON":"Audiobook Manifest","cbz":"Comic Book Archive","divina":"Divina Publication","divinaJSON":"Divina Publication Manifest","epub":"EPUB","lcpa":"LCP Protected Audiobook","lcpdf":"LCP Protected PDF","lcpl":"LCP License Document","pdf":"PDF","rwp":"Readium Web Publication","rwpm":"Readium Web Publication Manifest","zab":"Audiobook Archive","zip":"ZIP Archive"},"kind":{"audiobook_one":"audiobook","audiobook_other":"audiobooks","book_one":"book","book_other":"books","comic_one":"comic","comic_other":"comics","document_one":"document","document_other":"documents"},"metadata":{"accessibility":{"display-guide":{"accessibility-summary":{"no-metadata":"No information is available","publisher-contact":"For more information about the accessibility of this product, please contact the publisher: ","title":"Accessibility summary"},"additional-accessibility-information":{"aria":{"compact":"ARIA roles included","descriptive":"Content is enhanced with ARIA roles to optimize organization and facilitate navigation"},"audio-descriptions":"Audio descriptions","braille":"Braille","color-not-sole-means-of-conveying-information":"Color is not the sole means of conveying information","dyslexia-readability":"Dyslexia readability","full-ruby-annotations":"Full ruby annotations","high-contrast-between-foreground-and-background-audio":"High contrast between foreground and background audio","high-contrast-between-text-and-background":"High contrast between foreground text and background","large-print":"Large print","page-breaks":{"compact":"Page breaks included","descriptive":"Page breaks included from the original print source"},"ruby-annotations":"Some Ruby annotations","sign-language":"Sign language","tactile-graphics":{"compact":"Tactile graphics included","descriptive":"Tactile graphics have been integrated to facilitate access to visual elements for blind people"},"tactile-objects":"Tactile 3D objects","text-to-speech-hinting":"Text-to-speech hinting provided","title":"Additional accessibility information","ultra-high-contrast-between-text-and-background":"Ultra high contrast between text and background","visible-page-numbering":"Visible page numbering","without-background-sounds":"Without background sounds"},"conformance":{"a":{"compact":"This publication meets minimum accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level A standard"},"aa":{"compact":"This publication meets accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AA standard"},"aaa":{"compact":"This publication exceeds accepted accessibility standards","descriptive":"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AAA standard"},"certifier":"The publication was certified by ","certifier-credentials":"The certifier's credential is ","details":{"certification-info":"The publication was certified on ","certifier-report":"For more information refer to the certifier's report","claim":"This publication claims to meet","epub-accessibility-1-0":"EPUB Accessibility 1.0","epub-accessibility-1-1":"EPUB Accessibility 1.1","level-a":"Level A","level-aa":"Level AA","level-aaa":"Level AAA","wcag-2-0":{"compact":"WCAG 2.0","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.0"},"wcag-2-1":{"compact":"WCAG 2.1","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.1"},"wcag-2-2":{"compact":"WCAG 2.2","descriptive":"Web Content Accessibility Guidelines (WCAG) 2.2"}},"details-title":"Detailed conformance information","no":"No information is available","title":"Conformance","unknown-standard":"Conformance to accepted standards for accessibility of this publication cannot be determined"},"hazards":{"flashing":{"compact":"Flashing content","descriptive":"The publication contains flashing content that can cause photosensitive seizures"},"flashing-none":{"compact":"No flashing hazards","descriptive":"The publication does not contain flashing content that can cause photosensitive seizures"},"flashing-unknown":{"compact":"Flashing hazards not known","descriptive":"The presence of flashing content that can cause photosensitive seizures could not be determined"},"motion":{"compact":"Motion simulation","descriptive":"The publication contains motion simulations that can cause motion sickness"},"motion-none":{"compact":"No motion simulation hazards","descriptive":"The publication does not contain motion simulations that can cause motion sickness"},"motion-unknown":{"compact":"Motion simulation hazards not known","descriptive":"The presence of motion simulations that can cause motion sickness could not be determined"},"no-metadata":"No information is available","none":{"compact":"No hazards","descriptive":"The publication contains no hazards"},"sound":{"compact":"Sounds","descriptive":"The publication contains sounds that can cause sensitivity issues"},"sound-none":{"compact":"No sound hazards","descriptive":"The publication does not contain sounds that can cause sensitivity issues"},"sound-unknown":{"compact":"Sound hazards not known","descriptive":"The presence of sounds that can cause sensitivity issues could not be determined"},"title":"Hazards","unknown":"The presence of hazards is unknown"},"legal-considerations":{"exempt":{"compact":"Claims an accessibility exemption in some jurisdictions","descriptive":"This publication claims an accessibility exemption in some jurisdictions"},"no-metadata":"No information is available","title":"Legal considerations"},"navigation":{"index":{"compact":"Index","descriptive":"Index with links to referenced entries"},"no-metadata":"No information is available","page-navigation":{"compact":"Go to page","descriptive":"Page list to go to pages from the print source version"},"structural":{"compact":"Headings","descriptive":"Elements such as headings, tables, etc for structured navigation"},"title":"Navigation","toc":{"compact":"Table of contents","descriptive":"Table of contents to all chapters of the text via links"}},"rich-content":{"accessible-chemistry-as-latex":{"compact":"Chemical formulas in LaTeX","descriptive":"Chemical formulas in accessible format (LaTeX)"},"accessible-chemistry-as-mathml":{"compact":"Chemical formulas in MathML","descriptive":"Chemical formulas in accessible format (MathML)"},"accessible-math-as-latex":{"compact":"Math as LaTeX","descriptive":"Math formulas in accessible format (LaTeX)"},"accessible-math-described":"Text descriptions of math are provided","closed-captions":{"compact":"Videos have closed captions","descriptive":"Videos included in publications have closed captions"},"extended-descriptions":"Information-rich images are described by extended descriptions","math-as-mathml":{"compact":"Math as MathML","descriptive":"Math formulas in accessible format (MathML)"},"open-captions":{"compact":"Videos have open captions","descriptive":"Videos included in publications have open captions"},"title":"Rich content","transcript":"Transcript(s) provided","unknown":"No information is available"},"ways-of-reading":{"nonvisual-reading":{"alt-text":{"compact":"Has alternative text","descriptive":"Has alternative text descriptions for images"},"no-metadata":"No information about nonvisual reading is available","none":{"compact":"Not readable in read aloud or dynamic braille","descriptive":"The content is not readable as read aloud speech or dynamic braille"},"not-fully":{"compact":"Not fully readable in read aloud or dynamic braille","descriptive":"Not all of the content will be readable as read aloud speech or dynamic braille"},"readable":{"compact":"Readable in read aloud or dynamic braille","descriptive":"All content can be read as read aloud speech or dynamic braille"}},"prerecorded-audio":{"complementary":{"compact":"Prerecorded audio clips","descriptive":"Prerecorded audio clips are embedded in the content"},"no-metadata":"No information about prerecorded audio is available","only":{"compact":"Prerecorded audio only","descriptive":"Audiobook with no text alternative"},"synchronized":{"compact":"Prerecorded audio synchronized with text","descriptive":"All the content is available as prerecorded audio synchronized with text"}},"title":"Ways of reading","visual-adjustments":{"modifiable":{"compact":"Appearance can be modified","descriptive":"Appearance of the text and page layout can be modified according to the capabilities of the reading system (font family and font size, spaces between paragraphs, sentences, words, and letters, as well as color of background and text)"},"unknown":"No information about appearance modifiability is available","unmodifiable":{"compact":"Appearance cannot be modified","descriptive":"Text and page layout cannot be modified as the reading experience is close to a print version, but reading systems can still provide zooming options"}}}}},"altIdentifier_one":"alternate identifier","altIdentifier_other":"alternate identifiers","artist_one":"artist","artist_other":"artists","author_one":"author","author_other":"authors","collection_one":"editorial collection","collection_other":"editorial collections","colorist_one":"colorist","colorist_other":"colorists","contributor_one":"contributor","contributor_other":"contributors","description":"description","duration":"duration","editor_one":"editor","editor_other":"editors","identifier_one":"identifier","identifier_other":"identifiers","illustrator_one":"illustrator","illustrator_other":"illustrators","imprint_one":"imprint","imprint_other":"imprints","inker_one":"inker","inker_other":"inkers","language_one":"language","language_other":"languages","letterer_one":"letterer","letterer_other":"letterers","modified":"modification date","narrator_one":"narrator","narrator_other":"narrators","numberOfPages":"print length","penciler_one":"penciler","penciler_other":"pencilers","published":"publication date","publisher_one":"publisher","publisher_other":"publishers","series_one":"series","series_other":"series","subject_one":"subject","subject_other":"subjects","subtitle":"subtitle","title":"title","translator_one":"translator","translator_other":"translators"}}`), ri = {
|
|
314
|
+
publication: si
|
|
315
|
+
}, se = {
|
|
316
316
|
fr: () => import("./fr-C5HEel98.js"),
|
|
317
317
|
ar: () => import("./ar-DyHX_uy2.js"),
|
|
318
318
|
da: () => import("./da-Dct0PS3E.js"),
|
|
@@ -323,13 +323,13 @@ const ee = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], ii = /* @__PURE__ */ J
|
|
|
323
323
|
sv: () => import("./sv-BfzAFsVN.js")
|
|
324
324
|
// 'tr': () => import('@edrlab/thorium-locales/publication-metadata/tr.json'),
|
|
325
325
|
// 'uk': () => import('@edrlab/thorium-locales/publication-metadata/uk.json')
|
|
326
|
-
},
|
|
327
|
-
class
|
|
326
|
+
}, re = ri?.publication?.metadata?.accessibility?.["display-guide"] || {};
|
|
327
|
+
class $ {
|
|
328
328
|
constructor() {
|
|
329
|
-
this.currentLocaleCode = "en", this.locale =
|
|
329
|
+
this.currentLocaleCode = "en", this.locale = re, this.loadedLocales = {}, this.loadedLocales.en = re;
|
|
330
330
|
}
|
|
331
331
|
static getInstance() {
|
|
332
|
-
return
|
|
332
|
+
return $.instance || ($.instance = new $()), $.instance;
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
335
|
* Loads a locale dynamically
|
|
@@ -337,14 +337,14 @@ class Y {
|
|
|
337
337
|
* @returns Promise indicating if the locale was loaded successfully
|
|
338
338
|
*/
|
|
339
339
|
async loadLocale(t) {
|
|
340
|
-
if (!
|
|
340
|
+
if (!ie.includes(t))
|
|
341
341
|
return console.warn(`Locale '${t}' is not enabled`), !1;
|
|
342
342
|
if (t in this.loadedLocales)
|
|
343
343
|
return !0;
|
|
344
344
|
try {
|
|
345
|
-
if (!(t in
|
|
345
|
+
if (!(t in se))
|
|
346
346
|
return console.warn(`Locale file not found for: ${t}`), !1;
|
|
347
|
-
const r = (await
|
|
347
|
+
const r = (await se[t]()).default?.publication?.metadata?.accessibility?.["display-guide"];
|
|
348
348
|
return r ? (this.loadedLocales[t] = r, !0) : (console.warn(`No accessibility strings found in locale ${t}`), !1);
|
|
349
349
|
} catch (e) {
|
|
350
350
|
return console.warn(`Failed to load locale ${t}:`, e), !1;
|
|
@@ -378,7 +378,7 @@ class Y {
|
|
|
378
378
|
* Gets a list of available locale codes
|
|
379
379
|
*/
|
|
380
380
|
getAvailableLocales() {
|
|
381
|
-
return
|
|
381
|
+
return ie;
|
|
382
382
|
}
|
|
383
383
|
getNestedValue(t, e) {
|
|
384
384
|
const i = e.split(".");
|
|
@@ -400,9 +400,9 @@ class Y {
|
|
|
400
400
|
return e === void 0 && this.currentLocaleCode !== "en" && (e = this.getNestedValue(this.loadedLocales.en, t)), e !== void 0 ? typeof e == "string" ? { compact: e, descriptive: e } : e : (console.warn(`Missing localization for key: ${t}`), { compact: "", descriptive: "" });
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
const f =
|
|
404
|
-
var
|
|
405
|
-
class
|
|
403
|
+
const f = $.getInstance();
|
|
404
|
+
var X = /* @__PURE__ */ ((s) => (s.reflowable = "reflowable", s.fixed = "fixed", s.scrolled = "scrolled", s))(X || {}), ni = /* @__PURE__ */ ((s) => (s.Unknown = "unknown", s.Modifiable = "modifiable", s.Unmodifiable = "unmodifiable", s))(ni || {}), ai = /* @__PURE__ */ ((s) => (s.NoMetadata = "noMetadata", s.Readable = "readable", s.NotFully = "notFully", s.Unreadable = "unreadable", s))(ai || {}), oi = /* @__PURE__ */ ((s) => (s.NoMetadata = "noMetadata", s.Synchronized = "synchronized", s.AudioOnly = "audioOnly", s.AudioComplementary = "audioComplementary", s))(oi || {});
|
|
405
|
+
class Dt {
|
|
406
406
|
constructor(t = "unknown", e = "noMetadata", i = !1, r = "noMetadata") {
|
|
407
407
|
this.id = "ways-of-reading.title", this.visualAdjustments = t, this.nonvisualReading = e, this.nonvisualReadingAltText = i, this.prerecordedAudio = r, this.shouldDisplay = !0;
|
|
408
408
|
const n = f.getString(this.id);
|
|
@@ -438,33 +438,33 @@ class kt {
|
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
static fromPublication(t) {
|
|
441
|
-
const e = t.metadata.accessibility ?? new V(), i = e.feature ?? [], r = t.metadata.layout ===
|
|
442
|
-
const
|
|
443
|
-
return Array.isArray(
|
|
444
|
-
}), m = a.some((d) => d.value ===
|
|
445
|
-
const
|
|
446
|
-
return Array.isArray(
|
|
447
|
-
}), p = !(a.length === 0 && o.length === 0) && !a.some((d) => d.value ===
|
|
448
|
-
const
|
|
449
|
-
return Array.isArray(
|
|
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;
|
|
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,
|
|
456
|
-
const
|
|
457
|
-
return Array.isArray(
|
|
458
|
-
}) ? "audioOnly" : a.some((d) => d.value ===
|
|
459
|
-
return new
|
|
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";
|
|
459
|
+
return new Dt(
|
|
460
460
|
n,
|
|
461
461
|
g,
|
|
462
462
|
A,
|
|
463
|
-
|
|
463
|
+
N
|
|
464
464
|
);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
class
|
|
467
|
+
class Ut {
|
|
468
468
|
constructor(t = !1, e = !1, i = !1, r = !1) {
|
|
469
469
|
this.id = "navigation.title", this.tableOfContents = t, this.index = e, this.headings = i, this.page = r, this.noMetadata = !t && !e && !i && !r;
|
|
470
470
|
const n = f.getString(this.id);
|
|
@@ -511,7 +511,7 @@ class Dt {
|
|
|
511
511
|
}
|
|
512
512
|
static fromPublication(t) {
|
|
513
513
|
const i = (t.metadata.accessibility ?? new V()).feature ?? [];
|
|
514
|
-
return new
|
|
514
|
+
return new Ut(
|
|
515
515
|
i.some((r) => r.value === v.TABLE_OF_CONTENTS.value),
|
|
516
516
|
i.some((r) => r.value === v.INDEX.value),
|
|
517
517
|
i.some((r) => r.value === v.STRUCTURAL_NAVIGATION.value),
|
|
@@ -519,8 +519,8 @@ class Dt {
|
|
|
519
519
|
);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
var
|
|
523
|
-
class
|
|
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
|
+
class Mt {
|
|
524
524
|
constructor(t = !1, e = !1, i = !1, r = !1, n = !1, a = !1, o = !1, h = !1, m = !1) {
|
|
525
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
526
|
const p = f.getString(this.id);
|
|
@@ -607,7 +607,7 @@ class Ut {
|
|
|
607
607
|
}
|
|
608
608
|
static fromPublication(t) {
|
|
609
609
|
const i = (t.metadata.accessibility ?? new V()).feature ?? [];
|
|
610
|
-
return new
|
|
610
|
+
return new Mt(
|
|
611
611
|
i.some((r) => r.value === v.LONG_DESCRIPTION.value),
|
|
612
612
|
i.some((r) => r.value === v.DESCRIBED_MATH.value),
|
|
613
613
|
i.some((r) => r.value === v.MATH_ML.value),
|
|
@@ -620,11 +620,11 @@ class Ut {
|
|
|
620
620
|
);
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
class
|
|
623
|
+
class Bt {
|
|
624
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
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
|
|
627
|
-
if (this.title =
|
|
626
|
+
const N = f.getString(this.id);
|
|
627
|
+
if (this.title = N.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",
|
|
@@ -731,7 +731,7 @@ class Mt {
|
|
|
731
731
|
}
|
|
732
732
|
static fromPublication(t) {
|
|
733
733
|
const i = (t.metadata.accessibility ?? new V()).feature ?? [];
|
|
734
|
-
return new
|
|
734
|
+
return new Bt(
|
|
735
735
|
i.some((r) => r.value === v.PAGE_BREAK_MARKERS.value || r.value === v.PRINT_PAGE_NUMBERS.value),
|
|
736
736
|
i.some((r) => r.value === v.ARIA.value),
|
|
737
737
|
i.some((r) => r.value === v.AUDIO_DESCRIPTION.value),
|
|
@@ -748,8 +748,8 @@ class Mt {
|
|
|
748
748
|
);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
var
|
|
752
|
-
class
|
|
751
|
+
var li = /* @__PURE__ */ ((s) => (s.yes = "yes", s.no = "no", s.unknown = "unknown", s.noMetadata = "noMetadata", s))(li || {});
|
|
752
|
+
class Gt {
|
|
753
753
|
constructor(t = "unknown", e = "unknown", i = "unknown") {
|
|
754
754
|
this.id = "hazards.title", this.flashing = t, this.motion = e, this.sound = i;
|
|
755
755
|
const r = f.getString(this.id);
|
|
@@ -852,10 +852,10 @@ class Bt {
|
|
|
852
852
|
let n;
|
|
853
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;
|
|
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
|
|
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);
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
|
-
class
|
|
858
|
+
class Wt {
|
|
859
859
|
constructor(t = []) {
|
|
860
860
|
this.id = "conformance.title", this.profiles = t, this.shouldDisplay = !0;
|
|
861
861
|
const e = f.getString(this.id);
|
|
@@ -900,10 +900,10 @@ class Gt {
|
|
|
900
900
|
}
|
|
901
901
|
static fromPublication(t) {
|
|
902
902
|
const e = t.metadata.accessibility?.conformsTo ?? [];
|
|
903
|
-
return new
|
|
903
|
+
return new Wt(e);
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
|
-
class
|
|
906
|
+
class Ht {
|
|
907
907
|
constructor(t = !1) {
|
|
908
908
|
this.id = "legal-considerations.title", this.exemption = t, this.shouldDisplay = this.exemption;
|
|
909
909
|
const e = f.getString(this.id);
|
|
@@ -925,10 +925,10 @@ class Wt {
|
|
|
925
925
|
}
|
|
926
926
|
static fromPublication(t) {
|
|
927
927
|
const i = (t.metadata.accessibility?.exemption ?? []).length > 0;
|
|
928
|
-
return new
|
|
928
|
+
return new Ht(i);
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
|
-
class
|
|
931
|
+
class Ft {
|
|
932
932
|
constructor(t) {
|
|
933
933
|
this.id = "accessibility-summary.title", this.shouldDisplay = !0;
|
|
934
934
|
const e = f.getString(this.id);
|
|
@@ -950,12 +950,12 @@ class Ht {
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
static fromPublication(t) {
|
|
953
|
-
return new
|
|
953
|
+
return new Ft(t);
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
-
class
|
|
956
|
+
class rr {
|
|
957
957
|
constructor(t) {
|
|
958
|
-
this.waysOfReading =
|
|
958
|
+
this.waysOfReading = Dt.fromPublication(t), this.navigation = Ut.fromPublication(t), this.richContent = Mt.fromPublication(t), this.additionalInformation = Bt.fromPublication(t), this.hazards = Gt.fromPublication(t), this.conformance = Wt.fromPublication(t), this.legal = Ht.fromPublication(t), this.accessibilitySummary = Ft.fromPublication(t), this.fields = [
|
|
959
959
|
this.waysOfReading,
|
|
960
960
|
this.navigation,
|
|
961
961
|
this.richContent,
|
|
@@ -967,7 +967,7 @@ class sr {
|
|
|
967
967
|
];
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
|
-
class
|
|
970
|
+
class _t {
|
|
971
971
|
/**
|
|
972
972
|
* Creates a [Encryption].
|
|
973
973
|
*/
|
|
@@ -979,7 +979,7 @@ class Ft {
|
|
|
979
979
|
*/
|
|
980
980
|
static deserialize(t) {
|
|
981
981
|
if (t && t.algorithm)
|
|
982
|
-
return new
|
|
982
|
+
return new _t({
|
|
983
983
|
algorithm: t.algorithm,
|
|
984
984
|
compression: t.compression,
|
|
985
985
|
originalLength: t.originalLength,
|
|
@@ -995,8 +995,8 @@ class Ft {
|
|
|
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
|
|
999
|
-
class
|
|
998
|
+
var Lt = /* @__PURE__ */ ((s) => (s.left = "left", s.right = "right", s.center = "center", s))(Lt || {});
|
|
999
|
+
class U {
|
|
1000
1000
|
constructor(t) {
|
|
1001
1001
|
this.otherProperties = t;
|
|
1002
1002
|
}
|
|
@@ -1008,7 +1008,7 @@ class D {
|
|
|
1008
1008
|
*/
|
|
1009
1009
|
static deserialize(t) {
|
|
1010
1010
|
if (t)
|
|
1011
|
-
return new
|
|
1011
|
+
return new U(t);
|
|
1012
1012
|
}
|
|
1013
1013
|
/**
|
|
1014
1014
|
* Serializes a [Properties] to its RWPM JSON representation.
|
|
@@ -1023,12 +1023,12 @@ class D {
|
|
|
1023
1023
|
const e = Object.assign({}, this.otherProperties);
|
|
1024
1024
|
for (const i in t)
|
|
1025
1025
|
e[i] = t[i];
|
|
1026
|
-
return new
|
|
1026
|
+
return new U(e);
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
Object.defineProperty(
|
|
1029
|
+
Object.defineProperty(U.prototype, "encryption", {
|
|
1030
1030
|
get: function() {
|
|
1031
|
-
return
|
|
1031
|
+
return _t.deserialize(this.otherProperties.encrypted);
|
|
1032
1032
|
}
|
|
1033
1033
|
});
|
|
1034
1034
|
class Vt {
|
|
@@ -1054,26 +1054,26 @@ class Vt {
|
|
|
1054
1054
|
return this.activeClass && (t.activeClass = this.activeClass), this.playbackActiveClass && (t.playbackActiveClass = this.playbackActiveClass), t;
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function hi(s) {
|
|
1058
1058
|
return s && Array.isArray(s) ? s : void 0;
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
return s && typeof s == "string" ? [s] :
|
|
1060
|
+
function _(s) {
|
|
1061
|
+
return s && typeof s == "string" ? [s] : hi(s);
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function lt(s) {
|
|
1064
1064
|
return typeof s == "string" ? new Date(s) : void 0;
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function Z(s) {
|
|
1067
1067
|
return isNaN(s) ? void 0 : s;
|
|
1068
1068
|
}
|
|
1069
|
-
function
|
|
1070
|
-
return
|
|
1069
|
+
function z(s) {
|
|
1070
|
+
return Z(s) !== void 0 && Math.sign(s) >= 0 ? s : void 0;
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function ht(s) {
|
|
1073
1073
|
const t = new Array();
|
|
1074
1074
|
return s.forEach((e) => t.push(e)), t;
|
|
1075
1075
|
}
|
|
1076
|
-
class
|
|
1076
|
+
class J {
|
|
1077
1077
|
/** Creates an AltIdentifier object */
|
|
1078
1078
|
constructor(t) {
|
|
1079
1079
|
this.value = t.value, this.scheme = t.scheme;
|
|
@@ -1084,9 +1084,9 @@ class Z {
|
|
|
1084
1084
|
static deserialize(t) {
|
|
1085
1085
|
if (t) {
|
|
1086
1086
|
if (typeof t == "string")
|
|
1087
|
-
return new
|
|
1087
|
+
return new J({ value: t });
|
|
1088
1088
|
if (typeof t == "object" && t.value)
|
|
1089
|
-
return new
|
|
1089
|
+
return new J({
|
|
1090
1090
|
value: t.value,
|
|
1091
1091
|
scheme: t.scheme
|
|
1092
1092
|
});
|
|
@@ -1116,8 +1116,8 @@ 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
|
|
1120
|
-
a[
|
|
1119
|
+
const N = A[0].toLocaleLowerCase(), d = N === "charset" ? A[1].toUpperCase() : A[1];
|
|
1120
|
+
a[N] = d;
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
1123
1123
|
const o = {}, h = Object.keys(a);
|
|
@@ -1561,7 +1561,7 @@ class c {
|
|
|
1561
1561
|
});
|
|
1562
1562
|
}
|
|
1563
1563
|
}
|
|
1564
|
-
class
|
|
1564
|
+
class ut {
|
|
1565
1565
|
constructor(t) {
|
|
1566
1566
|
this.uri = t, this.parameters = this.getParameters(t);
|
|
1567
1567
|
}
|
|
@@ -1601,7 +1601,7 @@ class T {
|
|
|
1601
1601
|
*/
|
|
1602
1602
|
static deserialize(t) {
|
|
1603
1603
|
if (!t) return;
|
|
1604
|
-
const e =
|
|
1604
|
+
const e = Z(t.progression), i = Z(t.totalProgression), r = Z(t.position), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set([
|
|
1605
1605
|
"fragment",
|
|
1606
1606
|
"fragments",
|
|
1607
1607
|
"progression",
|
|
@@ -1611,7 +1611,7 @@ class T {
|
|
|
1611
1611
|
return Object.entries(t).forEach(([o, h]) => {
|
|
1612
1612
|
a.has(o) || n.set(o, h);
|
|
1613
1613
|
}), new T({
|
|
1614
|
-
fragments:
|
|
1614
|
+
fragments: _(t.fragments || t.fragment),
|
|
1615
1615
|
progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
|
|
1616
1616
|
totalProgression: i !== void 0 && i >= 0 && i <= 1 ? i : void 0,
|
|
1617
1617
|
position: r !== void 0 && r > 0 ? r : void 0,
|
|
@@ -1626,7 +1626,7 @@ class T {
|
|
|
1626
1626
|
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;
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
|
-
class
|
|
1629
|
+
class nt {
|
|
1630
1630
|
/**
|
|
1631
1631
|
* Creates a [Text].
|
|
1632
1632
|
*/
|
|
@@ -1638,7 +1638,7 @@ class rt {
|
|
|
1638
1638
|
*/
|
|
1639
1639
|
static deserialize(t) {
|
|
1640
1640
|
if (t)
|
|
1641
|
-
return new
|
|
1641
|
+
return new nt({
|
|
1642
1642
|
after: t.after,
|
|
1643
1643
|
before: t.before,
|
|
1644
1644
|
highlight: t.highlight
|
|
@@ -1652,7 +1652,7 @@ class rt {
|
|
|
1652
1652
|
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;
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
|
-
class
|
|
1655
|
+
class D {
|
|
1656
1656
|
/**
|
|
1657
1657
|
* Creates a [Locator].
|
|
1658
1658
|
*/
|
|
@@ -1664,12 +1664,12 @@ class k {
|
|
|
1664
1664
|
*/
|
|
1665
1665
|
static deserialize(t) {
|
|
1666
1666
|
if (t && t.href && t.type)
|
|
1667
|
-
return new
|
|
1667
|
+
return new D({
|
|
1668
1668
|
href: t.href,
|
|
1669
1669
|
type: t.type,
|
|
1670
1670
|
title: t.title,
|
|
1671
1671
|
locations: T.deserialize(t.locations),
|
|
1672
|
-
text:
|
|
1672
|
+
text: nt.deserialize(t.text)
|
|
1673
1673
|
});
|
|
1674
1674
|
}
|
|
1675
1675
|
/**
|
|
@@ -1683,7 +1683,7 @@ class k {
|
|
|
1683
1683
|
* Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
|
|
1684
1684
|
*/
|
|
1685
1685
|
copyWithLocations(t) {
|
|
1686
|
-
return new
|
|
1686
|
+
return new D({
|
|
1687
1687
|
href: this.href,
|
|
1688
1688
|
type: this.type,
|
|
1689
1689
|
title: this.title,
|
|
@@ -1692,7 +1692,7 @@ class k {
|
|
|
1692
1692
|
});
|
|
1693
1693
|
}
|
|
1694
1694
|
}
|
|
1695
|
-
class
|
|
1695
|
+
class M {
|
|
1696
1696
|
/**
|
|
1697
1697
|
* Creates a [Link].
|
|
1698
1698
|
*/
|
|
@@ -1704,21 +1704,21 @@ class U {
|
|
|
1704
1704
|
*/
|
|
1705
1705
|
static deserialize(t) {
|
|
1706
1706
|
if (!(!t || typeof t.href != "string"))
|
|
1707
|
-
return new
|
|
1707
|
+
return new M({
|
|
1708
1708
|
href: t.href,
|
|
1709
1709
|
templated: t.templated,
|
|
1710
1710
|
type: t.type,
|
|
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
|
-
properties:
|
|
1714
|
-
height:
|
|
1715
|
-
width:
|
|
1716
|
-
size:
|
|
1717
|
-
duration:
|
|
1718
|
-
bitrate:
|
|
1719
|
-
languages:
|
|
1720
|
-
alternates:
|
|
1721
|
-
children:
|
|
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),
|
|
1719
|
+
languages: _(t.language),
|
|
1720
|
+
alternates: C.deserialize(t.alternate),
|
|
1721
|
+
children: C.deserialize(t.children)
|
|
1722
1722
|
});
|
|
1723
1723
|
}
|
|
1724
1724
|
/**
|
|
@@ -1726,7 +1726,7 @@ class U {
|
|
|
1726
1726
|
*/
|
|
1727
1727
|
serialize() {
|
|
1728
1728
|
const t = { href: this.href };
|
|
1729
|
-
return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel =
|
|
1729
|
+
return this.templated !== void 0 && (t.templated = this.templated), this.type !== void 0 && (t.type = this.type), this.title !== void 0 && (t.title = this.title), this.rels && (t.rel = ht(this.rels)), this.properties && (t.properties = this.properties.serialize()), this.height !== void 0 && (t.height = this.height), this.width !== void 0 && (t.width = this.width), this.size !== void 0 && (t.size = this.size), this.duration !== void 0 && (t.duration = this.duration), this.bitrate !== void 0 && (t.bitrate = this.bitrate), this.languages && (t.language = this.languages), this.alternates && (t.alternate = this.alternates.serialize()), this.children && (t.children = this.children.serialize()), t;
|
|
1730
1730
|
}
|
|
1731
1731
|
/** MediaType of the linked resource. */
|
|
1732
1732
|
get mediaType() {
|
|
@@ -1743,14 +1743,14 @@ class U {
|
|
|
1743
1743
|
}
|
|
1744
1744
|
/** List of URI template parameter keys, if the `Link` is templated. */
|
|
1745
1745
|
get templateParameters() {
|
|
1746
|
-
return this.templated ? new
|
|
1746
|
+
return this.templated ? new ut(this.href).parameters : /* @__PURE__ */ new Set();
|
|
1747
1747
|
}
|
|
1748
1748
|
/** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
|
|
1749
1749
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
1750
1750
|
*/
|
|
1751
1751
|
expandTemplate(t) {
|
|
1752
|
-
return new
|
|
1753
|
-
href: new
|
|
1752
|
+
return new M({
|
|
1753
|
+
href: new ut(this.href).expand(t),
|
|
1754
1754
|
templated: !1
|
|
1755
1755
|
});
|
|
1756
1756
|
}
|
|
@@ -1758,15 +1758,15 @@ class U {
|
|
|
1758
1758
|
* Makes a copy of this [Link] after merging in the given additional other [properties].
|
|
1759
1759
|
*/
|
|
1760
1760
|
addProperties(t) {
|
|
1761
|
-
const e =
|
|
1762
|
-
return e.properties = e.properties ? e.properties?.add(t) : new
|
|
1761
|
+
const e = M.deserialize(this.serialize());
|
|
1762
|
+
return e.properties = e.properties ? e.properties?.add(t) : new U(t), e;
|
|
1763
1763
|
}
|
|
1764
1764
|
/**
|
|
1765
1765
|
* Creates a [Locator] from a reading order [Link].
|
|
1766
1766
|
*/
|
|
1767
1767
|
get locator() {
|
|
1768
1768
|
let t = this.href.split("#");
|
|
1769
|
-
return new
|
|
1769
|
+
return new D({
|
|
1770
1770
|
href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
|
|
1771
1771
|
type: this.type ?? "",
|
|
1772
1772
|
title: this.title,
|
|
@@ -1776,7 +1776,7 @@ class U {
|
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
}
|
|
1779
|
-
class
|
|
1779
|
+
class C {
|
|
1780
1780
|
/**
|
|
1781
1781
|
* Creates a [Links].
|
|
1782
1782
|
*/
|
|
@@ -1788,8 +1788,8 @@ class O {
|
|
|
1788
1788
|
*/
|
|
1789
1789
|
static deserialize(t) {
|
|
1790
1790
|
if (t && Array.isArray(t))
|
|
1791
|
-
return new
|
|
1792
|
-
t.map((e) =>
|
|
1791
|
+
return new C(
|
|
1792
|
+
t.map((e) => M.deserialize(e)).filter((e) => e !== void 0)
|
|
1793
1793
|
);
|
|
1794
1794
|
}
|
|
1795
1795
|
/**
|
|
@@ -1870,13 +1870,13 @@ class O {
|
|
|
1870
1870
|
return this.items.filter((t) => t.type);
|
|
1871
1871
|
}
|
|
1872
1872
|
}
|
|
1873
|
-
const
|
|
1873
|
+
const W = class W {
|
|
1874
1874
|
/**
|
|
1875
1875
|
* translations can be a string or a collection of language/translation pairs,
|
|
1876
1876
|
* for a single string the language is assumed to be undefined
|
|
1877
1877
|
*/
|
|
1878
1878
|
constructor(t) {
|
|
1879
|
-
this.translations = typeof t == "string" ? { [
|
|
1879
|
+
this.translations = typeof t == "string" ? { [W.UNDEFINED_LANGUAGE]: t } : t;
|
|
1880
1880
|
}
|
|
1881
1881
|
/**
|
|
1882
1882
|
* Parses a [LocalizedString] from its RWPM JSON representation.
|
|
@@ -1900,7 +1900,7 @@ const G = class G {
|
|
|
1900
1900
|
*/
|
|
1901
1901
|
static deserialize(t) {
|
|
1902
1902
|
if (t && (typeof t == "string" || t.constructor === Object))
|
|
1903
|
-
return new
|
|
1903
|
+
return new W(t);
|
|
1904
1904
|
}
|
|
1905
1905
|
serialize() {
|
|
1906
1906
|
return this.translations;
|
|
@@ -1914,12 +1914,12 @@ const G = class G {
|
|
|
1914
1914
|
* 4. returns empty string
|
|
1915
1915
|
*/
|
|
1916
1916
|
getTranslation(t) {
|
|
1917
|
-
return this.translations[t ||
|
|
1917
|
+
return this.translations[t || W.UNDEFINED_LANGUAGE] || this.translations[W.UNDEFINED_LANGUAGE] || this.translations[W.LANGUAGE_EN] || (Object.values(this.translations).length === 0 ? "" : Object.values(this.translations)[0]);
|
|
1918
1918
|
}
|
|
1919
1919
|
};
|
|
1920
|
-
|
|
1921
|
-
let
|
|
1922
|
-
class
|
|
1920
|
+
W.UNDEFINED_LANGUAGE = "und", W.LANGUAGE_EN = "en";
|
|
1921
|
+
let B = W;
|
|
1922
|
+
class dt {
|
|
1923
1923
|
/**
|
|
1924
1924
|
* Creates a [Contributor] object.
|
|
1925
1925
|
*/
|
|
@@ -1933,16 +1933,16 @@ class ut {
|
|
|
1933
1933
|
*/
|
|
1934
1934
|
static deserialize(t) {
|
|
1935
1935
|
if (t)
|
|
1936
|
-
return typeof t == "string" ? new
|
|
1937
|
-
name:
|
|
1938
|
-
}) : t.name ? new
|
|
1939
|
-
name:
|
|
1940
|
-
sortAs:
|
|
1936
|
+
return typeof t == "string" ? new dt({
|
|
1937
|
+
name: B.deserialize(t)
|
|
1938
|
+
}) : t.name ? new dt({
|
|
1939
|
+
name: B.deserialize(t.name),
|
|
1940
|
+
sortAs: B.deserialize(t.sortAs),
|
|
1941
1941
|
identifier: t.identifier,
|
|
1942
|
-
altIdentifiers: t.altIdentifier ? Array.isArray(t.altIdentifier) ? new Set(t.altIdentifier.map((e) =>
|
|
1943
|
-
roles: t.role ? new Set(
|
|
1944
|
-
links:
|
|
1945
|
-
position:
|
|
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
|
+
roles: t.role ? new Set(_(t.role)) : void 0,
|
|
1944
|
+
links: C.deserialize(t.links),
|
|
1945
|
+
position: Z(t.position)
|
|
1946
1946
|
}) : void 0;
|
|
1947
1947
|
}
|
|
1948
1948
|
/**
|
|
@@ -1950,10 +1950,10 @@ class ut {
|
|
|
1950
1950
|
*/
|
|
1951
1951
|
serialize() {
|
|
1952
1952
|
const t = { name: this.name.serialize() };
|
|
1953
|
-
return this.sortAs !== void 0 && (t.sortAs = this.sortAs.serialize()), this.identifier !== void 0 && (t.identifier = this.identifier), this.altIdentifiers && (t.altIdentifier =
|
|
1953
|
+
return this.sortAs !== void 0 && (t.sortAs = this.sortAs.serialize()), this.identifier !== void 0 && (t.identifier = this.identifier), this.altIdentifiers && (t.altIdentifier = ht(this.altIdentifiers).map((e) => e.serialize())), this.roles && (t.role = ht(this.roles)), this.links && (t.links = this.links.serialize()), this.position !== void 0 && (t.position = this.position), t;
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
|
-
class
|
|
1956
|
+
class O {
|
|
1957
1957
|
/**
|
|
1958
1958
|
* Creates a [Contributors] object.
|
|
1959
1959
|
*/
|
|
@@ -1967,8 +1967,8 @@ class N {
|
|
|
1967
1967
|
static deserialize(t) {
|
|
1968
1968
|
if (!t) return;
|
|
1969
1969
|
const e = Array.isArray(t) ? t : [t];
|
|
1970
|
-
return new
|
|
1971
|
-
e.map((i) =>
|
|
1970
|
+
return new O(
|
|
1971
|
+
e.map((i) => dt.deserialize(i)).filter((i) => i !== void 0)
|
|
1972
1972
|
);
|
|
1973
1973
|
}
|
|
1974
1974
|
/**
|
|
@@ -1978,7 +1978,7 @@ class N {
|
|
|
1978
1978
|
return this.items.map((t) => t.serialize());
|
|
1979
1979
|
}
|
|
1980
1980
|
}
|
|
1981
|
-
class
|
|
1981
|
+
class Q {
|
|
1982
1982
|
/** Creates an Array of [Subject]. */
|
|
1983
1983
|
constructor(t) {
|
|
1984
1984
|
this.items = t && t.items ? t.items : /* @__PURE__ */ new Map();
|
|
@@ -1990,9 +1990,9 @@ class q {
|
|
|
1990
1990
|
if (!(t && typeof t == "object")) return;
|
|
1991
1991
|
const e = /* @__PURE__ */ new Map();
|
|
1992
1992
|
return Object.entries(t).forEach(([i, r]) => {
|
|
1993
|
-
const n =
|
|
1993
|
+
const n = O.deserialize(r);
|
|
1994
1994
|
n && n.items.length > 0 && e.set(i, n);
|
|
1995
|
-
}), new
|
|
1995
|
+
}), new Q({ items: e });
|
|
1996
1996
|
}
|
|
1997
1997
|
/**
|
|
1998
1998
|
* Serializes a [BelongsTo] to its RWPM JSON representation.
|
|
@@ -2004,11 +2004,11 @@ class q {
|
|
|
2004
2004
|
), t;
|
|
2005
2005
|
}
|
|
2006
2006
|
}
|
|
2007
|
-
var
|
|
2008
|
-
function
|
|
2009
|
-
return s === "rtl" ?
|
|
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
|
+
function nr(s) {
|
|
2009
|
+
return s === "rtl" ? Lt.right : Lt.left;
|
|
2010
2010
|
}
|
|
2011
|
-
class
|
|
2011
|
+
class ft {
|
|
2012
2012
|
/** Creates a [Subject]. */
|
|
2013
2013
|
constructor(t) {
|
|
2014
2014
|
this.name = t.name, this.sortAs = t.sortAs, this.code = t.code, this.scheme = t.scheme, this.links = t.links;
|
|
@@ -2020,14 +2020,14 @@ class dt {
|
|
|
2020
2020
|
*/
|
|
2021
2021
|
static deserialize(t) {
|
|
2022
2022
|
if (t)
|
|
2023
|
-
return typeof t == "string" ? new
|
|
2024
|
-
name:
|
|
2025
|
-
}) : t.name ? new
|
|
2026
|
-
name:
|
|
2027
|
-
sortAs: t.sortAs ?
|
|
2023
|
+
return typeof t == "string" ? new ft({
|
|
2024
|
+
name: B.deserialize(t)
|
|
2025
|
+
}) : t.name ? new ft({
|
|
2026
|
+
name: B.deserialize(t.name),
|
|
2027
|
+
sortAs: t.sortAs ? B.deserialize(t.sortAs) : void 0,
|
|
2028
2028
|
code: t.code,
|
|
2029
2029
|
scheme: t.scheme,
|
|
2030
|
-
links:
|
|
2030
|
+
links: C.deserialize(t.links)
|
|
2031
2031
|
}) : void 0;
|
|
2032
2032
|
}
|
|
2033
2033
|
/**
|
|
@@ -2038,7 +2038,7 @@ class dt {
|
|
|
2038
2038
|
return this.sortAs !== void 0 && (t.sortAs = this.sortAs.serialize()), this.code !== void 0 && (t.code = this.code), this.scheme !== void 0 && (t.scheme = this.scheme), this.links && (t.links = this.links.serialize()), t;
|
|
2039
2039
|
}
|
|
2040
2040
|
}
|
|
2041
|
-
class
|
|
2041
|
+
class Yt {
|
|
2042
2042
|
/** Creates an Array of [Subject]. */
|
|
2043
2043
|
constructor(t) {
|
|
2044
2044
|
this.items = t;
|
|
@@ -2049,8 +2049,8 @@ class _t {
|
|
|
2049
2049
|
static deserialize(t) {
|
|
2050
2050
|
if (!t) return;
|
|
2051
2051
|
const e = Array.isArray(t) ? t : [t];
|
|
2052
|
-
return new
|
|
2053
|
-
e.map((i) =>
|
|
2052
|
+
return new Yt(
|
|
2053
|
+
e.map((i) => ft.deserialize(i)).filter((i) => i !== void 0)
|
|
2054
2054
|
);
|
|
2055
2055
|
}
|
|
2056
2056
|
/**
|
|
@@ -2060,8 +2060,8 @@ class _t {
|
|
|
2060
2060
|
return this.items.map((t) => t.serialize());
|
|
2061
2061
|
}
|
|
2062
2062
|
}
|
|
2063
|
-
var
|
|
2064
|
-
class
|
|
2063
|
+
var ui = /* @__PURE__ */ ((s) => (s.all = "all", s.none = "none", s))(ui || {});
|
|
2064
|
+
class $t {
|
|
2065
2065
|
/** Creates a [TDM] object */
|
|
2066
2066
|
constructor(t) {
|
|
2067
2067
|
this.reservation = t.reservation, this.policy = t.policy;
|
|
@@ -2071,7 +2071,7 @@ class Yt {
|
|
|
2071
2071
|
*/
|
|
2072
2072
|
static deserialize(t) {
|
|
2073
2073
|
if (t)
|
|
2074
|
-
return new
|
|
2074
|
+
return new $t({
|
|
2075
2075
|
reservation: t.reservation,
|
|
2076
2076
|
policy: t.policy
|
|
2077
2077
|
});
|
|
@@ -2084,10 +2084,10 @@ class Yt {
|
|
|
2084
2084
|
return this.reservation !== void 0 && (t.reservation = this.reservation), this.policy !== void 0 && (t.policy = this.policy), t;
|
|
2085
2085
|
}
|
|
2086
2086
|
}
|
|
2087
|
-
const
|
|
2087
|
+
const et = class et {
|
|
2088
2088
|
/** Creates [Metadata] object */
|
|
2089
2089
|
constructor(t) {
|
|
2090
|
-
this.title = t.title, this.typeUri = t.typeUri, this.conformsTo = t.conformsTo, this.identifier = t.identifier, this.altIdentifier = t.altIdentifier, this.subtitle = t.subtitle, this.sortAs = t.sortAs, this.artists = t.artists, this.authors = t.authors, this.colorists = t.colorists, this.contributors = t.contributors, this.editors = t.editors, this.illustrators = t.illustrators, this.inkers = t.inkers, this.letterers = t.letterers, this.narrators = t.narrators, this.pencilers = t.pencilers, this.translators = t.translators, this.languages = t.languages, this.description = t.description, this.publishers = t.publishers, this.imprints = t.imprints, this.published = t.published, this.modified = t.modified, this.subjects = t.subjects, this.belongsTo = t.belongsTo, this.belongsToCollections = t.belongsToCollections, this.belongsToSeries = t.belongsToSeries, this.belongsToCollections && this.belongsToCollections.items.length > 0 && (this.belongsTo || (this.belongsTo = new
|
|
2090
|
+
this.title = t.title, this.typeUri = t.typeUri, this.conformsTo = t.conformsTo, this.identifier = t.identifier, this.altIdentifier = t.altIdentifier, this.subtitle = t.subtitle, this.sortAs = t.sortAs, this.artists = t.artists, this.authors = t.authors, this.colorists = t.colorists, this.contributors = t.contributors, this.editors = t.editors, this.illustrators = t.illustrators, this.inkers = t.inkers, this.letterers = t.letterers, this.narrators = t.narrators, this.pencilers = t.pencilers, this.translators = t.translators, this.languages = t.languages, this.description = t.description, this.publishers = t.publishers, this.imprints = t.imprints, this.published = t.published, this.modified = t.modified, this.subjects = t.subjects, this.belongsTo = t.belongsTo, this.belongsToCollections = t.belongsToCollections, this.belongsToSeries = t.belongsToSeries, this.belongsToCollections && this.belongsToCollections.items.length > 0 && (this.belongsTo || (this.belongsTo = new Q()), this.belongsTo.items.set("collection", this.belongsToCollections)), this.belongsToSeries && this.belongsToSeries.items.length > 0 && (this.belongsTo || (this.belongsTo = new Q()), this.belongsTo.items.set("series", this.belongsToSeries)), this.layout = t.layout, this.readingProgression = t.readingProgression, this.duration = t.duration, this.numberOfPages = t.numberOfPages, this.accessibility = t.accessibility, this.tdm = t.tdm, this.otherMetadata = t.otherMetadata;
|
|
2091
2091
|
}
|
|
2092
2092
|
/**
|
|
2093
2093
|
* Parses a [Metadata] from its RWPM JSON representation.
|
|
@@ -2096,9 +2096,9 @@ const tt = class tt {
|
|
|
2096
2096
|
*/
|
|
2097
2097
|
static deserialize(t) {
|
|
2098
2098
|
if (!(t && t.title)) return;
|
|
2099
|
-
const e =
|
|
2100
|
-
let
|
|
2101
|
-
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);
|
|
2100
|
+
let ot = Object.assign({}, t);
|
|
2101
|
+
return et.mappedProperties.forEach((ti) => delete ot[ti]), Object.keys(ot).length === 0 && (ot = void 0), new et({
|
|
2102
2102
|
title: e,
|
|
2103
2103
|
typeUri: i,
|
|
2104
2104
|
conformsTo: r,
|
|
@@ -2111,27 +2111,27 @@ const tt = class tt {
|
|
|
2111
2111
|
colorists: u,
|
|
2112
2112
|
contributors: g,
|
|
2113
2113
|
editors: A,
|
|
2114
|
-
illustrators:
|
|
2114
|
+
illustrators: N,
|
|
2115
2115
|
inkers: d,
|
|
2116
|
-
letterers:
|
|
2117
|
-
narrators:
|
|
2118
|
-
pencilers:
|
|
2119
|
-
translators:
|
|
2120
|
-
languages:
|
|
2121
|
-
description:
|
|
2122
|
-
publishers:
|
|
2123
|
-
imprints:
|
|
2116
|
+
letterers: x,
|
|
2117
|
+
narrators: G,
|
|
2118
|
+
pencilers: Be,
|
|
2119
|
+
translators: Ge,
|
|
2120
|
+
languages: We,
|
|
2121
|
+
description: He,
|
|
2122
|
+
publishers: Fe,
|
|
2123
|
+
imprints: _e,
|
|
2124
2124
|
published: Ve,
|
|
2125
|
-
modified:
|
|
2126
|
-
subjects:
|
|
2127
|
-
belongsTo:
|
|
2128
|
-
layout:
|
|
2129
|
-
readingProgression:
|
|
2130
|
-
duration:
|
|
2131
|
-
numberOfPages:
|
|
2132
|
-
accessibility:
|
|
2133
|
-
tdm:
|
|
2134
|
-
otherMetadata:
|
|
2125
|
+
modified: Ye,
|
|
2126
|
+
subjects: $e,
|
|
2127
|
+
belongsTo: Xe,
|
|
2128
|
+
layout: Ze,
|
|
2129
|
+
readingProgression: Je,
|
|
2130
|
+
duration: qe,
|
|
2131
|
+
numberOfPages: Qe,
|
|
2132
|
+
accessibility: Ke,
|
|
2133
|
+
tdm: je,
|
|
2134
|
+
otherMetadata: ot
|
|
2135
2135
|
});
|
|
2136
2136
|
}
|
|
2137
2137
|
/**
|
|
@@ -2161,12 +2161,12 @@ const tt = class tt {
|
|
|
2161
2161
|
return null;
|
|
2162
2162
|
for (const t of this.conformsTo)
|
|
2163
2163
|
switch (t) {
|
|
2164
|
-
case
|
|
2165
|
-
return this.layout ||
|
|
2166
|
-
case
|
|
2167
|
-
return this.layout ===
|
|
2168
|
-
case
|
|
2169
|
-
case
|
|
2164
|
+
case q.EPUB:
|
|
2165
|
+
return this.layout || X.reflowable;
|
|
2166
|
+
case q.DIVINA:
|
|
2167
|
+
return this.layout === X.reflowable ? X.fixed : this.layout || X.fixed;
|
|
2168
|
+
case q.AUDIOBOOK:
|
|
2169
|
+
case q.PDF:
|
|
2170
2170
|
return null;
|
|
2171
2171
|
}
|
|
2172
2172
|
return null;
|
|
@@ -2180,23 +2180,23 @@ const tt = class tt {
|
|
|
2180
2180
|
if (this.readingProgression)
|
|
2181
2181
|
return this.readingProgression;
|
|
2182
2182
|
if (this.languages?.length !== 1)
|
|
2183
|
-
return
|
|
2183
|
+
return F.ltr;
|
|
2184
2184
|
const t = this.languages[0].toLowerCase();
|
|
2185
2185
|
if (t === "zh-hant" || t === "zh-tw")
|
|
2186
|
-
return
|
|
2186
|
+
return F.rtl;
|
|
2187
2187
|
switch (t.split("-")[0]) {
|
|
2188
2188
|
case "ar":
|
|
2189
|
-
return
|
|
2189
|
+
return F.rtl;
|
|
2190
2190
|
case "fa":
|
|
2191
|
-
return
|
|
2191
|
+
return F.rtl;
|
|
2192
2192
|
case "he":
|
|
2193
|
-
return
|
|
2193
|
+
return F.rtl;
|
|
2194
2194
|
default:
|
|
2195
|
-
return
|
|
2195
|
+
return F.ltr;
|
|
2196
2196
|
}
|
|
2197
2197
|
}
|
|
2198
2198
|
};
|
|
2199
|
-
|
|
2199
|
+
et.mappedProperties = [
|
|
2200
2200
|
"title",
|
|
2201
2201
|
"@type",
|
|
2202
2202
|
"conformsTo",
|
|
@@ -2230,24 +2230,24 @@ tt.mappedProperties = [
|
|
|
2230
2230
|
"accessibility",
|
|
2231
2231
|
"tdm"
|
|
2232
2232
|
];
|
|
2233
|
-
let
|
|
2234
|
-
|
|
2233
|
+
let pt = et;
|
|
2234
|
+
pt.prototype.getMediaOverlay = function() {
|
|
2235
2235
|
const s = this.otherMetadata?.mediaOverlay;
|
|
2236
2236
|
if (s)
|
|
2237
2237
|
return Vt.deserialize(s);
|
|
2238
2238
|
};
|
|
2239
|
-
|
|
2239
|
+
U.prototype.getContains = function() {
|
|
2240
2240
|
return new Set(this.otherProperties.contains || []);
|
|
2241
2241
|
};
|
|
2242
|
-
class
|
|
2242
|
+
class Xt {
|
|
2243
2243
|
constructor(t) {
|
|
2244
2244
|
this.links = t.links, this.guided = t.guided;
|
|
2245
2245
|
}
|
|
2246
2246
|
static deserialize(t) {
|
|
2247
2247
|
if (t)
|
|
2248
|
-
return new
|
|
2249
|
-
links:
|
|
2250
|
-
guided:
|
|
2248
|
+
return new Xt({
|
|
2249
|
+
links: C.deserialize(t.links),
|
|
2250
|
+
guided: K.deserializeArray(t.guided)
|
|
2251
2251
|
});
|
|
2252
2252
|
}
|
|
2253
2253
|
serialize() {
|
|
@@ -2255,7 +2255,7 @@ class $t {
|
|
|
2255
2255
|
return this.links !== void 0 && (t.links = this.links.serialize()), this.guided !== void 0 && (t.guided = this.guided.map((e) => e.serialize())), t;
|
|
2256
2256
|
}
|
|
2257
2257
|
}
|
|
2258
|
-
class
|
|
2258
|
+
class mt {
|
|
2259
2259
|
constructor(t) {
|
|
2260
2260
|
this.plain = t.plain, this.ssml = t.ssml, this.language = t.language;
|
|
2261
2261
|
}
|
|
@@ -2265,9 +2265,9 @@ class pt {
|
|
|
2265
2265
|
static deserialize(t) {
|
|
2266
2266
|
if (t != null) {
|
|
2267
2267
|
if (typeof t == "string")
|
|
2268
|
-
return new
|
|
2268
|
+
return new mt({ plain: t });
|
|
2269
2269
|
if (t.plain || t.ssml || t.language)
|
|
2270
|
-
return new
|
|
2270
|
+
return new mt({
|
|
2271
2271
|
plain: t.plain,
|
|
2272
2272
|
ssml: t.ssml,
|
|
2273
2273
|
language: t.language
|
|
@@ -2282,7 +2282,7 @@ class pt {
|
|
|
2282
2282
|
return this.plain !== void 0 && (t.plain = this.plain), this.ssml !== void 0 && (t.ssml = this.ssml), this.language !== void 0 && (t.language = this.language), Object.keys(t).length > 0 ? t : void 0;
|
|
2283
2283
|
}
|
|
2284
2284
|
}
|
|
2285
|
-
class
|
|
2285
|
+
class K {
|
|
2286
2286
|
/**
|
|
2287
2287
|
* Creates a [GuidedNavigation] object.
|
|
2288
2288
|
*/
|
|
@@ -2313,15 +2313,15 @@ class X {
|
|
|
2313
2313
|
*/
|
|
2314
2314
|
static deserialize(t) {
|
|
2315
2315
|
if (t)
|
|
2316
|
-
return new
|
|
2316
|
+
return new K({
|
|
2317
2317
|
audioref: t.audioref,
|
|
2318
|
-
children:
|
|
2318
|
+
children: K.deserializeArray(t.children),
|
|
2319
2319
|
imgref: t.imgref,
|
|
2320
|
-
role: t.role ? new Set(
|
|
2320
|
+
role: t.role ? new Set(_(t.role)) : void 0,
|
|
2321
2321
|
level: typeof t.level == "number" ? t.level : void 0,
|
|
2322
|
-
text:
|
|
2322
|
+
text: mt.deserialize(t.text),
|
|
2323
2323
|
textref: t.textref,
|
|
2324
|
-
description:
|
|
2324
|
+
description: K.deserialize(t.description)
|
|
2325
2325
|
});
|
|
2326
2326
|
}
|
|
2327
2327
|
/**
|
|
@@ -2329,14 +2329,14 @@ class X {
|
|
|
2329
2329
|
*/
|
|
2330
2330
|
static deserializeArray(t) {
|
|
2331
2331
|
if (Array.isArray(t))
|
|
2332
|
-
return t.map((e) =>
|
|
2332
|
+
return t.map((e) => K.deserialize(e)).filter((e) => e !== void 0);
|
|
2333
2333
|
}
|
|
2334
2334
|
/**
|
|
2335
2335
|
* Serializes a [GuidedNavigationObject] to its RWPM JSON representation.
|
|
2336
2336
|
*/
|
|
2337
2337
|
serialize() {
|
|
2338
2338
|
const t = {};
|
|
2339
|
-
if (this.audioref !== void 0 && (t.audioref = this.audioref), this.children !== void 0 && (t.children = this.children.map((e) => e.serialize())), this.imgref !== void 0 && (t.imgref = this.imgref), this.role !== void 0 && (t.role =
|
|
2339
|
+
if (this.audioref !== void 0 && (t.audioref = this.audioref), this.children !== void 0 && (t.children = this.children.map((e) => e.serialize())), this.imgref !== void 0 && (t.imgref = this.imgref), this.role !== void 0 && (t.role = ht(this.role)), this.level !== void 0 && (t.level = this.level), this.text !== void 0) {
|
|
2340
2340
|
const e = this.text.serialize();
|
|
2341
2341
|
e !== void 0 && (t.text = e);
|
|
2342
2342
|
}
|
|
@@ -2373,16 +2373,16 @@ class X {
|
|
|
2373
2373
|
return e.length === 1 ? [isNaN(e[0]) ? void 0 : e[0], void 0] : e.length > 2 ? [void 0, void 0] : [isNaN(e[0]) ? void 0 : e[0], isNaN(e[1]) ? void 0 : e[1]];
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function di(s, t) {
|
|
2377
2377
|
return t.length > 1 ? t.indexOf(s.slice(-1)) > -1 : s.slice(-1) === t;
|
|
2378
2378
|
}
|
|
2379
|
-
function
|
|
2379
|
+
function fi(s, t) {
|
|
2380
2380
|
return s.slice(s.length - t.length) === t;
|
|
2381
2381
|
}
|
|
2382
|
-
const
|
|
2383
|
-
endsWith:
|
|
2384
|
-
endsWithChar:
|
|
2385
|
-
},
|
|
2382
|
+
const wt = {
|
|
2383
|
+
endsWith: fi,
|
|
2384
|
+
endsWithChar: di
|
|
2385
|
+
}, pi = [
|
|
2386
2386
|
"ie",
|
|
2387
2387
|
"eg",
|
|
2388
2388
|
"ext",
|
|
@@ -2474,16 +2474,16 @@ const yt = {
|
|
|
2474
2474
|
"Fri",
|
|
2475
2475
|
"Sat"
|
|
2476
2476
|
];
|
|
2477
|
-
function
|
|
2478
|
-
return /^[A-Z][a-z].*/.test(s) ||
|
|
2479
|
-
}
|
|
2480
|
-
function pi(s) {
|
|
2481
|
-
return de(s) || /``|"|'/.test(s.substring(0, 2));
|
|
2477
|
+
function fe(s) {
|
|
2478
|
+
return /^[A-Z][a-z].*/.test(s) || Ot(s);
|
|
2482
2479
|
}
|
|
2483
2480
|
function mi(s) {
|
|
2484
|
-
return
|
|
2481
|
+
return fe(s) || /``|"|'/.test(s.substring(0, 2));
|
|
2482
|
+
}
|
|
2483
|
+
function gi(s) {
|
|
2484
|
+
return ~pi.indexOf(s.replace(/\W+/g, ""));
|
|
2485
2485
|
}
|
|
2486
|
-
function
|
|
2486
|
+
function bi(s, t) {
|
|
2487
2487
|
if (s === "a.m." || s === "p.m.") {
|
|
2488
2488
|
var e = t.replace(/\W+/g, "").slice(-3).toLowerCase();
|
|
2489
2489
|
if (e === "day")
|
|
@@ -2491,23 +2491,23 @@ function gi(s, t) {
|
|
|
2491
2491
|
}
|
|
2492
2492
|
return !1;
|
|
2493
2493
|
}
|
|
2494
|
-
function
|
|
2494
|
+
function ne(s) {
|
|
2495
2495
|
var t = s.replace(/[\(\)\[\]\{\}]/g, "").match(/(.\.)*/);
|
|
2496
2496
|
return t && t[0].length > 0;
|
|
2497
2497
|
}
|
|
2498
|
-
function
|
|
2499
|
-
return s.length <= 3 ? !0 :
|
|
2498
|
+
function ae(s) {
|
|
2499
|
+
return s.length <= 3 ? !0 : fe(s);
|
|
2500
2500
|
}
|
|
2501
|
-
function
|
|
2501
|
+
function Ot(s, t) {
|
|
2502
2502
|
return t && (s = s.slice(t - 1, t + 2)), !isNaN(Number(s));
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function vi(s) {
|
|
2505
2505
|
return s.match(/^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/);
|
|
2506
2506
|
}
|
|
2507
|
-
function
|
|
2507
|
+
function Ai(s) {
|
|
2508
2508
|
return s.match(/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/);
|
|
2509
2509
|
}
|
|
2510
|
-
function
|
|
2510
|
+
function yi(s) {
|
|
2511
2511
|
var t = 0;
|
|
2512
2512
|
if ((t = s.indexOf(".")) > -1 || (t = s.indexOf("!")) > -1 || (t = s.indexOf("?")) > -1) {
|
|
2513
2513
|
var e = s.charAt(t + 1);
|
|
@@ -2516,10 +2516,10 @@ function Ai(s) {
|
|
|
2516
2516
|
}
|
|
2517
2517
|
return !1;
|
|
2518
2518
|
}
|
|
2519
|
-
function
|
|
2519
|
+
function wi(s) {
|
|
2520
2520
|
return s === "." || s === "!" || s === "?";
|
|
2521
2521
|
}
|
|
2522
|
-
function
|
|
2522
|
+
function Si(s, t) {
|
|
2523
2523
|
t = Object.assign(t || {}, {
|
|
2524
2524
|
newlineBoundary: t && t.newlineBoundary || !0
|
|
2525
2525
|
});
|
|
@@ -2529,26 +2529,26 @@ function wi(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(
|
|
2533
|
-
return !e.test(
|
|
2532
|
+
var m, p = [i, null], u = i, g = h.slice(o + 1).find(function(N) {
|
|
2533
|
+
return !e.test(N.value);
|
|
2534
2534
|
});
|
|
2535
2535
|
if (i === `
|
|
2536
|
-
` && t.newlineBoundary ||
|
|
2536
|
+
` && t.newlineBoundary || wi(i) || wt.endsWithChar(i, "?!"))
|
|
2537
2537
|
return p;
|
|
2538
|
-
if (
|
|
2538
|
+
if (wt.endsWithChar(i, ".")) {
|
|
2539
2539
|
if (g) {
|
|
2540
|
-
if (i.length === 2 && isNaN(i.charAt(0)) && i.match(/[a-zA-Z]/) ||
|
|
2540
|
+
if (i.length === 2 && isNaN(i.charAt(0)) && i.match(/[a-zA-Z]/) || gi(i))
|
|
2541
2541
|
return u;
|
|
2542
|
-
if (
|
|
2543
|
-
if (
|
|
2542
|
+
if (mi(g.value)) {
|
|
2543
|
+
if (bi(i, g.value) || Ot(g.value) && ae(i))
|
|
2544
2544
|
return u;
|
|
2545
|
-
} else if (
|
|
2545
|
+
} else if (wt.endsWith(i, "..") || ne(i) || ae(i))
|
|
2546
2546
|
return u;
|
|
2547
2547
|
}
|
|
2548
2548
|
return p;
|
|
2549
2549
|
}
|
|
2550
2550
|
let A;
|
|
2551
|
-
return (A = i.indexOf(".")) > -1 && (
|
|
2551
|
+
return (A = i.indexOf(".")) > -1 && (Ot(i, A) || ne(i) || Ai(i) || vi(i)) ? u : (m = yi(i)) ? [
|
|
2552
2552
|
m[0] + m[1],
|
|
2553
2553
|
null,
|
|
2554
2554
|
m[2]
|
|
@@ -2560,13 +2560,13 @@ function wi(s, t) {
|
|
|
2560
2560
|
})
|
|
2561
2561
|
);
|
|
2562
2562
|
}
|
|
2563
|
-
const
|
|
2564
|
-
function
|
|
2563
|
+
const Ei = (s, ...t) => (...e) => s(...t, ...e);
|
|
2564
|
+
function Ti(s) {
|
|
2565
2565
|
return {
|
|
2566
|
-
sentences: Si
|
|
2566
|
+
sentences: Ei(Si, s)
|
|
2567
2567
|
};
|
|
2568
2568
|
}
|
|
2569
|
-
function
|
|
2569
|
+
function Ii(s, t) {
|
|
2570
2570
|
return t ? s.reduce(function(e, i) {
|
|
2571
2571
|
var r = [
|
|
2572
2572
|
i.index,
|
|
@@ -2576,11 +2576,11 @@ function Ti(s, t) {
|
|
|
2576
2576
|
return [e, r].join(":");
|
|
2577
2577
|
}, t) : null;
|
|
2578
2578
|
}
|
|
2579
|
-
function
|
|
2579
|
+
function xi(s) {
|
|
2580
2580
|
const { index: t, offset: e, value: i, ...r } = s;
|
|
2581
2581
|
return r;
|
|
2582
2582
|
}
|
|
2583
|
-
function
|
|
2583
|
+
function Ni(s, t) {
|
|
2584
2584
|
var e = 0;
|
|
2585
2585
|
return Array.isArray(t) || (t = [t]), t.map(function(i) {
|
|
2586
2586
|
return i === null ? null : (typeof i == "string" && (i = {
|
|
@@ -2590,7 +2590,7 @@ function xi(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
|
|
2593
|
+
function Li(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) {
|
|
@@ -2607,17 +2607,17 @@ function Ni(s, t) {
|
|
|
2607
2607
|
offset: Math.max(i, e.length)
|
|
2608
2608
|
};
|
|
2609
2609
|
}
|
|
2610
|
-
const
|
|
2611
|
-
tokensId:
|
|
2612
|
-
normalize:
|
|
2613
|
-
properties:
|
|
2614
|
-
merge:
|
|
2610
|
+
const j = {
|
|
2611
|
+
tokensId: Ii,
|
|
2612
|
+
normalize: Ni,
|
|
2613
|
+
properties: xi,
|
|
2614
|
+
merge: Li
|
|
2615
2615
|
};
|
|
2616
|
-
var
|
|
2617
|
-
"([^" +
|
|
2616
|
+
var Oi = ' \r\n !"#$%&()*+,-.\\/:;<=>?@[\\]^_`{|}~', zi = new RegExp(
|
|
2617
|
+
"([^" + Oi + "]+)"
|
|
2618
2618
|
);
|
|
2619
|
-
function
|
|
2620
|
-
if (!(this instanceof
|
|
2619
|
+
function R(s) {
|
|
2620
|
+
if (!(this instanceof R)) return new R(s);
|
|
2621
2621
|
this.opts = Object.assign({
|
|
2622
2622
|
cacheGet: function(t) {
|
|
2623
2623
|
return null;
|
|
@@ -2626,7 +2626,7 @@ function z(s) {
|
|
|
2626
2626
|
}
|
|
2627
2627
|
}, s);
|
|
2628
2628
|
}
|
|
2629
|
-
|
|
2629
|
+
R.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);
|
|
@@ -2636,7 +2636,7 @@ z.prototype.split = function(t, e = {}) {
|
|
|
2636
2636
|
value: r,
|
|
2637
2637
|
index: 0,
|
|
2638
2638
|
offset: r.length
|
|
2639
|
-
}] : Array.isArray(r) || (r = [r]), o =
|
|
2639
|
+
}] : Array.isArray(r) || (r = [r]), o = j.tokensId(r, e.cache()), o && (h = i.opts.cacheGet(o), h))
|
|
2640
2640
|
return h;
|
|
2641
2641
|
var m = r.map(function(p, u) {
|
|
2642
2642
|
var g = r[u + 1], A = t(
|
|
@@ -2647,10 +2647,10 @@ z.prototype.split = function(t, e = {}) {
|
|
|
2647
2647
|
u,
|
|
2648
2648
|
r
|
|
2649
2649
|
) || [];
|
|
2650
|
-
if (A =
|
|
2651
|
-
var
|
|
2650
|
+
if (A = j.normalize(p, A), e.preserveProperties) {
|
|
2651
|
+
var N = j.properties(p);
|
|
2652
2652
|
A = A.map(function(d) {
|
|
2653
|
-
return Object.assign({}, d,
|
|
2653
|
+
return Object.assign({}, d, N);
|
|
2654
2654
|
});
|
|
2655
2655
|
}
|
|
2656
2656
|
return a = p, A;
|
|
@@ -2658,7 +2658,7 @@ z.prototype.split = function(t, e = {}) {
|
|
|
2658
2658
|
return o && i.opts.cacheSet(o, m), m;
|
|
2659
2659
|
};
|
|
2660
2660
|
};
|
|
2661
|
-
|
|
2661
|
+
R.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
2664
|
var m = o.index, p = h + m, u = o[0] || "", g = u.length;
|
|
@@ -2688,25 +2688,25 @@ z.prototype.re = function(t, e = {}) {
|
|
|
2688
2688
|
}
|
|
2689
2689
|
});
|
|
2690
2690
|
};
|
|
2691
|
-
|
|
2691
|
+
R.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 = [];
|
|
2695
2695
|
function o() {
|
|
2696
2696
|
if (a.length != 0) {
|
|
2697
|
-
var h =
|
|
2697
|
+
var h = j.merge(a, e.mergeWith);
|
|
2698
2698
|
n.push(h), a = [];
|
|
2699
2699
|
}
|
|
2700
2700
|
}
|
|
2701
2701
|
return i.split(function(h, m) {
|
|
2702
2702
|
var p = t.apply(null, arguments);
|
|
2703
|
-
p =
|
|
2703
|
+
p = j.normalize(m, p), p.forEach(function(u) {
|
|
2704
2704
|
u === null ? o() : a.push(u);
|
|
2705
2705
|
});
|
|
2706
2706
|
})(r), o(), n;
|
|
2707
2707
|
};
|
|
2708
2708
|
};
|
|
2709
|
-
|
|
2709
|
+
R.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 @@ z.prototype.filter = function(t) {
|
|
|
2716
2716
|
};
|
|
2717
2717
|
});
|
|
2718
2718
|
};
|
|
2719
|
-
|
|
2719
|
+
R.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 @@ z.prototype.extend = function(t) {
|
|
|
2726
2726
|
}, r);
|
|
2727
2727
|
});
|
|
2728
2728
|
};
|
|
2729
|
-
|
|
2729
|
+
R.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 @@ z.prototype.ifthen = function(s, t) {
|
|
|
2734
2734
|
return n;
|
|
2735
2735
|
});
|
|
2736
2736
|
};
|
|
2737
|
-
|
|
2737
|
+
R.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
|
-
|
|
2744
|
+
R.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
|
-
|
|
2748
|
+
R.prototype.serie = function(...t) {
|
|
2749
2749
|
return t.reduce((e, i) => (...r) => i(e(...r)));
|
|
2750
2750
|
};
|
|
2751
|
-
|
|
2751
|
+
R.prototype.merge = function() {
|
|
2752
2752
|
return this.splitAndMerge((s) => [s]);
|
|
2753
2753
|
};
|
|
2754
|
-
|
|
2754
|
+
R.prototype.sections = function() {
|
|
2755
2755
|
return this.re(/([^\n\.,;!?]+)/i, { split: !1 });
|
|
2756
2756
|
};
|
|
2757
|
-
|
|
2758
|
-
return this.re(
|
|
2757
|
+
R.prototype.words = function() {
|
|
2758
|
+
return this.re(zi);
|
|
2759
2759
|
};
|
|
2760
|
-
|
|
2760
|
+
R.prototype.characters = function() {
|
|
2761
2761
|
return this.re(/[^\s]/);
|
|
2762
2762
|
};
|
|
2763
|
-
var
|
|
2764
|
-
const Ri = (s, t) => "Segmenter" in Intl ? new
|
|
2765
|
-
class
|
|
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 {
|
|
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");
|
|
@@ -2774,7 +2774,7 @@ class Ci {
|
|
|
2774
2774
|
const e = this.segmenter.segment(t), i = [];
|
|
2775
2775
|
for (let r of e) {
|
|
2776
2776
|
if (this.unit === "word" && r.isWordLike === !1) continue;
|
|
2777
|
-
const n =
|
|
2777
|
+
const n = pe(r.segment);
|
|
2778
2778
|
n !== null && i.push([r.index, r.index + n.length]);
|
|
2779
2779
|
}
|
|
2780
2780
|
return i;
|
|
@@ -2783,7 +2783,7 @@ class Ci {
|
|
|
2783
2783
|
class Pi {
|
|
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
|
|
2786
|
+
this.tokenizer = new R();
|
|
2787
2787
|
}
|
|
2788
2788
|
tokenize(t) {
|
|
2789
2789
|
let e = [];
|
|
@@ -2792,7 +2792,7 @@ class Pi {
|
|
|
2792
2792
|
e = this.tokenizer.words()(t);
|
|
2793
2793
|
break;
|
|
2794
2794
|
case "sentence":
|
|
2795
|
-
this.isEnglish ? e =
|
|
2795
|
+
this.isEnglish ? e = Ti(this.tokenizer).sentences()(t) : e = this.tokenizer.sections()(t);
|
|
2796
2796
|
break;
|
|
2797
2797
|
default:
|
|
2798
2798
|
e = [];
|
|
@@ -2801,18 +2801,231 @@ class Pi {
|
|
|
2801
2801
|
const i = [];
|
|
2802
2802
|
return e.forEach((r) => {
|
|
2803
2803
|
if (r.value.length === 0) return;
|
|
2804
|
-
const n =
|
|
2804
|
+
const n = pe(r.value);
|
|
2805
2805
|
n !== null && i.push([r.index, r.index + n.length]);
|
|
2806
2806
|
}), i;
|
|
2807
2807
|
}
|
|
2808
2808
|
}
|
|
2809
|
-
const
|
|
2809
|
+
const Di = new RegExp("[\\p{L}\\p{N}]+", "u"), pe = (s) => {
|
|
2810
2810
|
const t = s.trimEnd();
|
|
2811
|
-
return t.length === 0 || t.match(
|
|
2811
|
+
return t.length === 0 || t.match(Di) === null ? null : t;
|
|
2812
2812
|
};
|
|
2813
|
-
class
|
|
2813
|
+
class I {
|
|
2814
|
+
constructor(t, e) {
|
|
2815
|
+
this._allItems = t, this.linkMap = e;
|
|
2816
|
+
}
|
|
2817
|
+
static build(t, e = {}) {
|
|
2818
|
+
const i = t.toc?.items ?? [], r = t.readingOrder.items, { depth: n } = e, a = /* @__PURE__ */ new Map(), o = [];
|
|
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 = {
|
|
2821
|
+
title: u,
|
|
2822
|
+
references: [m.href],
|
|
2823
|
+
children: g.length > 0 ? g : void 0
|
|
2824
|
+
}, N = I.findTocLink(i, p, n);
|
|
2825
|
+
a.set(A, N ?? m), o.push(A);
|
|
2826
|
+
}
|
|
2827
|
+
return new I(o, a);
|
|
2828
|
+
}
|
|
2829
|
+
/**
|
|
2830
|
+
* The active depth limit for TOC traversal (title resolution and child
|
|
2831
|
+
* collection). `undefined` means unlimited. Setting the same value again
|
|
2832
|
+
* is a no-op; a new value invalidates the cached items and flat list.
|
|
2833
|
+
*/
|
|
2834
|
+
get depth() {
|
|
2835
|
+
return this._depth;
|
|
2836
|
+
}
|
|
2837
|
+
set depth(t) {
|
|
2838
|
+
this._depth !== t && (this._depth = t, this._items = void 0, this._flat = void 0);
|
|
2839
|
+
}
|
|
2840
|
+
/** Top-level timeline items. Cached; invalidated when `depth` changes. */
|
|
2841
|
+
get items() {
|
|
2842
|
+
return this._items || (this._items = this._depth !== void 0 ? I.trimToDepth(this._allItems, this._depth) : this._allItems), this._items;
|
|
2843
|
+
}
|
|
2844
|
+
locate(t) {
|
|
2845
|
+
const e = t.href.split("#")[0], i = t.locations?.time();
|
|
2846
|
+
let r;
|
|
2847
|
+
if (i !== void 0)
|
|
2848
|
+
for (const n of this.flat)
|
|
2849
|
+
this.itemMatchesTime(n, e, i) && (r = n);
|
|
2850
|
+
return r || (r = this.flat.find((n) => this.bareHrefFromItem(n) === e)), r;
|
|
2851
|
+
}
|
|
2852
|
+
adjacentTo(t) {
|
|
2853
|
+
const e = this.flat.indexOf(t);
|
|
2854
|
+
return {
|
|
2855
|
+
previous: e > 0 ? this.flat[e - 1] : void 0,
|
|
2856
|
+
next: e >= 0 && e < this.flat.length - 1 ? this.flat[e + 1] : void 0
|
|
2857
|
+
};
|
|
2858
|
+
}
|
|
2859
|
+
segmentsForHref(t) {
|
|
2860
|
+
const e = t.split("#")[0], i = this.items.find((r) => this.bareHrefFromItem(r) === e);
|
|
2861
|
+
return i ? i.children?.length ? i.children : [i] : [];
|
|
2862
|
+
}
|
|
2863
|
+
itemAtProgression(t, e, i) {
|
|
2864
|
+
const r = t.split("#")[0], n = this.items.find((o) => this.bareHrefFromItem(o) === r);
|
|
2865
|
+
if (!n) return;
|
|
2866
|
+
if (!n.children?.length) return n;
|
|
2867
|
+
if (i !== void 0) {
|
|
2868
|
+
const o = e * i;
|
|
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;
|
|
2874
|
+
}
|
|
2875
|
+
return h;
|
|
2876
|
+
}
|
|
2877
|
+
const a = Math.min(Math.floor(e * n.children.length), n.children.length - 1);
|
|
2878
|
+
return n.children[a];
|
|
2879
|
+
}
|
|
2880
|
+
ancestors(t) {
|
|
2881
|
+
return this.ancestorPath(this.items, t) ?? [];
|
|
2882
|
+
}
|
|
2883
|
+
linkFor(t) {
|
|
2884
|
+
return this.linkMap.get(t);
|
|
2885
|
+
}
|
|
2886
|
+
get flat() {
|
|
2887
|
+
return this._flat || (this._flat = this.flattenItems(this.items)), this._flat;
|
|
2888
|
+
}
|
|
2889
|
+
// -------------------------------------------------------------------------
|
|
2890
|
+
// TOC title resolution
|
|
2891
|
+
// -------------------------------------------------------------------------
|
|
2892
|
+
/**
|
|
2893
|
+
* Resolve a display title for `bare` from the TOC, looking no deeper than
|
|
2894
|
+
* `maxDepth` levels (1 = top-level entries only). Priority:
|
|
2895
|
+
* 1. A start-of-resource entry: bare href or `#t=0` (audio).
|
|
2896
|
+
* 2. Exactly one fragment entry referencing this resource — unambiguous.
|
|
2897
|
+
* 3. Multiple fragment entries — ambiguous, returns `undefined`.
|
|
2898
|
+
*/
|
|
2899
|
+
static findTitleInToc(t, e, i) {
|
|
2900
|
+
const { atStart: r, fragments: n } = I.collectTocCandidates(t, e, i, 1);
|
|
2901
|
+
if (r.length > 0) return r[0].title;
|
|
2902
|
+
if (n.length === 1) return n[0].title;
|
|
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
|
+
/**
|
|
2913
|
+
* Collect all TOC entries that reference `bare` as flat children, walking
|
|
2914
|
+
* up to `maxDepth` levels deep. Start-of-resource entries (#t=0 or no
|
|
2915
|
+
* fragment) are excluded — they contribute to title resolution, not children.
|
|
2916
|
+
* Order follows TOC declaration (depth-first).
|
|
2917
|
+
*/
|
|
2918
|
+
static collectChildrenFromToc(t, e, i, r, n) {
|
|
2919
|
+
if (i !== void 0 && r > i) return [];
|
|
2920
|
+
const a = [];
|
|
2921
|
+
for (const o of t) {
|
|
2922
|
+
if (I.bareHref(o.href) === e && o.title && !I.isStartOfResource(o.href)) {
|
|
2923
|
+
const h = { title: o.title, references: [o.href] };
|
|
2924
|
+
n.set(h, o), a.push(h);
|
|
2925
|
+
}
|
|
2926
|
+
o.children?.items?.length && a.push(...I.collectChildrenFromToc(
|
|
2927
|
+
o.children.items,
|
|
2928
|
+
e,
|
|
2929
|
+
i,
|
|
2930
|
+
r + 1,
|
|
2931
|
+
n
|
|
2932
|
+
));
|
|
2933
|
+
}
|
|
2934
|
+
return a;
|
|
2935
|
+
}
|
|
2936
|
+
/**
|
|
2937
|
+
* Walk the TOC tree up to `maxDepth` levels and collect all entries whose
|
|
2938
|
+
* bare href matches `bare`, split into start-of-resource entries and
|
|
2939
|
+
* fragment entries.
|
|
2940
|
+
*/
|
|
2941
|
+
static collectTocCandidates(t, e, i, r) {
|
|
2942
|
+
if (i !== void 0 && r > i)
|
|
2943
|
+
return { atStart: [], fragments: [] };
|
|
2944
|
+
const n = [], a = [];
|
|
2945
|
+
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(
|
|
2948
|
+
o.children.items,
|
|
2949
|
+
e,
|
|
2950
|
+
i,
|
|
2951
|
+
r + 1
|
|
2952
|
+
);
|
|
2953
|
+
n.push(...h.atStart), a.push(...h.fragments);
|
|
2954
|
+
}
|
|
2955
|
+
return { atStart: n, fragments: a };
|
|
2956
|
+
}
|
|
2957
|
+
/**
|
|
2958
|
+
* A TOC href points to the start of its resource when it has no fragment,
|
|
2959
|
+
* or when the fragment is `t=0` (audio: explicit beginning of the file).
|
|
2960
|
+
*/
|
|
2961
|
+
static isStartOfResource(t) {
|
|
2962
|
+
const e = t.split("#")[1];
|
|
2963
|
+
return e ? e === "t=0" : !0;
|
|
2964
|
+
}
|
|
2965
|
+
// -------------------------------------------------------------------------
|
|
2966
|
+
// Shared utilities
|
|
2967
|
+
// -------------------------------------------------------------------------
|
|
2968
|
+
static trimToDepth(t, e) {
|
|
2969
|
+
return t.map((i) => ({
|
|
2970
|
+
...i,
|
|
2971
|
+
children: e > 1 && i.children?.length ? I.trimToDepth(i.children, e - 1) : void 0
|
|
2972
|
+
}));
|
|
2973
|
+
}
|
|
2974
|
+
flattenItems(t) {
|
|
2975
|
+
const e = [];
|
|
2976
|
+
for (const i of t)
|
|
2977
|
+
e.push(i), i.children && e.push(...this.flattenItems(i.children));
|
|
2978
|
+
return e;
|
|
2979
|
+
}
|
|
2980
|
+
itemMatchesTime(t, e, i) {
|
|
2981
|
+
for (const r of t.references) {
|
|
2982
|
+
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))
|
|
2984
|
+
return !0;
|
|
2985
|
+
}
|
|
2986
|
+
return !1;
|
|
2987
|
+
}
|
|
2988
|
+
static parseTimeFragment(t) {
|
|
2989
|
+
if (!t) return 0;
|
|
2990
|
+
const e = t.match(/(?:^|&)t=(\d+(?:\.\d+)?)/);
|
|
2991
|
+
return e ? parseFloat(e[1]) : 0;
|
|
2992
|
+
}
|
|
2993
|
+
bareHrefFromItem(t) {
|
|
2994
|
+
return (t.references[0] ?? "").split("#")[0];
|
|
2995
|
+
}
|
|
2996
|
+
timeFromItem(t) {
|
|
2997
|
+
const e = t.references[0];
|
|
2998
|
+
if (!e) return;
|
|
2999
|
+
const i = e.split("#")[1];
|
|
3000
|
+
if (!i) return;
|
|
3001
|
+
const r = i.match(/(?:^|&)t=(\d+(?:\.\d+)?)/);
|
|
3002
|
+
return r ? parseFloat(r[1]) : void 0;
|
|
3003
|
+
}
|
|
3004
|
+
ancestorPath(t, e) {
|
|
3005
|
+
for (const i of t) {
|
|
3006
|
+
if (i === e) return [];
|
|
3007
|
+
if (i.children) {
|
|
3008
|
+
const r = this.ancestorPath(i.children, e);
|
|
3009
|
+
if (r !== null) return [i, ...r];
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
return null;
|
|
3013
|
+
}
|
|
3014
|
+
static bareHref(t) {
|
|
3015
|
+
return t.split("#")[0];
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
class Y {
|
|
2814
3019
|
constructor(t) {
|
|
2815
|
-
this.fetcher = new
|
|
3020
|
+
this.fetcher = new ei(), t.fetcher && (this.fetcher = t.fetcher), this.manifest = t.manifest, this.context = t.manifest.context, this.metadata = t.manifest.metadata, this.links = t.manifest.links, this.readingOrder = t.manifest.readingOrder, this.resources = t.manifest.resources, this.toc = t.manifest.toc, this.subcollections = t.manifest.subcollections;
|
|
3021
|
+
}
|
|
3022
|
+
/**
|
|
3023
|
+
* Returns the publication's timeline, built from its reading order and table of contents.
|
|
3024
|
+
* Called with no arguments, the result is cached. Pass options to build a fresh timeline
|
|
3025
|
+
* with a specific configuration (e.g. a depth limit).
|
|
3026
|
+
*/
|
|
3027
|
+
get timeline() {
|
|
3028
|
+
return this._timeline || (this._timeline = I.build(this)), this._timeline;
|
|
2816
3029
|
}
|
|
2817
3030
|
/** The URL where this publication is served, computed from the `Link` with `self` relation.
|
|
2818
3031
|
* e.g. https://provider.com/pub1293/manifest.json gives https://provider.com/pub1293/
|
|
@@ -2872,7 +3085,7 @@ class _ {
|
|
|
2872
3085
|
const e = await this.get(
|
|
2873
3086
|
t
|
|
2874
3087
|
).readAsJSON();
|
|
2875
|
-
return e.total ? e.positions.map((i) =>
|
|
3088
|
+
return e.total ? e.positions.map((i) => D.deserialize(i)).filter((i) => i !== void 0) : [];
|
|
2876
3089
|
}
|
|
2877
3090
|
async guideForLink(t) {
|
|
2878
3091
|
const e = (a) => a.alternates?.findWithMediaType(
|
|
@@ -2888,13 +3101,13 @@ class _ {
|
|
|
2888
3101
|
)), !i) return;
|
|
2889
3102
|
let r = i.href;
|
|
2890
3103
|
if (i.templated) {
|
|
2891
|
-
const a = new
|
|
2892
|
-
a.parameters.has("ref") && (o.ref = t.href), r = new
|
|
3104
|
+
const a = new ut(r), o = {};
|
|
3105
|
+
a.parameters.has("ref") && (o.ref = t.href), r = new ut(r).expand(o);
|
|
2893
3106
|
}
|
|
2894
|
-
const n = await this.get(new
|
|
3107
|
+
const n = await this.get(new M({
|
|
2895
3108
|
href: r
|
|
2896
3109
|
})).readAsJSON();
|
|
2897
|
-
return
|
|
3110
|
+
return Xt.deserialize(n);
|
|
2898
3111
|
}
|
|
2899
3112
|
/**
|
|
2900
3113
|
* Returns the resource targeted by the given non-templated [link].
|
|
@@ -2903,25 +3116,25 @@ class _ {
|
|
|
2903
3116
|
return this.fetcher.get(t);
|
|
2904
3117
|
}
|
|
2905
3118
|
}
|
|
2906
|
-
|
|
3119
|
+
Y.prototype.getPageList = function() {
|
|
2907
3120
|
return this.linksWithRole("pageList");
|
|
2908
3121
|
};
|
|
2909
|
-
|
|
3122
|
+
Y.prototype.getLandmarks = function() {
|
|
2910
3123
|
return this.linksWithRole("landmarks");
|
|
2911
3124
|
};
|
|
2912
|
-
|
|
3125
|
+
Y.prototype.getListOfAudioClips = function() {
|
|
2913
3126
|
return this.linksWithRole("loa");
|
|
2914
3127
|
};
|
|
2915
|
-
|
|
3128
|
+
Y.prototype.getListOfIllustrations = function() {
|
|
2916
3129
|
return this.linksWithRole("loi");
|
|
2917
3130
|
};
|
|
2918
|
-
|
|
3131
|
+
Y.prototype.getListOfTables = function() {
|
|
2919
3132
|
return this.linksWithRole("lot");
|
|
2920
3133
|
};
|
|
2921
|
-
|
|
3134
|
+
Y.prototype.getListOfVideoClips = function() {
|
|
2922
3135
|
return this.linksWithRole("lov");
|
|
2923
3136
|
};
|
|
2924
|
-
class
|
|
3137
|
+
class gt {
|
|
2925
3138
|
/**
|
|
2926
3139
|
* Creates a [DomRange].
|
|
2927
3140
|
*/
|
|
@@ -2933,10 +3146,10 @@ class mt {
|
|
|
2933
3146
|
*/
|
|
2934
3147
|
static deserialize(t) {
|
|
2935
3148
|
if (!(t && t.cssSelector)) return;
|
|
2936
|
-
let e =
|
|
3149
|
+
let e = z(t.textNodeIndex);
|
|
2937
3150
|
if (e === void 0) return;
|
|
2938
|
-
let i =
|
|
2939
|
-
return i === void 0 && (i =
|
|
3151
|
+
let i = z(t.charOffset);
|
|
3152
|
+
return i === void 0 && (i = z(t.offset)), new gt({
|
|
2940
3153
|
cssSelector: t.cssSelector,
|
|
2941
3154
|
textNodeIndex: e,
|
|
2942
3155
|
charOffset: i
|
|
@@ -2953,7 +3166,7 @@ class mt {
|
|
|
2953
3166
|
return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
|
|
2954
3167
|
}
|
|
2955
3168
|
}
|
|
2956
|
-
class
|
|
3169
|
+
class Kt {
|
|
2957
3170
|
/**
|
|
2958
3171
|
* Creates a [DomRange].
|
|
2959
3172
|
*/
|
|
@@ -2965,11 +3178,11 @@ class Xt {
|
|
|
2965
3178
|
*/
|
|
2966
3179
|
static deserialize(t) {
|
|
2967
3180
|
if (!t) return;
|
|
2968
|
-
let e =
|
|
3181
|
+
let e = gt.deserialize(t.start);
|
|
2969
3182
|
if (e)
|
|
2970
|
-
return new
|
|
3183
|
+
return new Kt({
|
|
2971
3184
|
start: e,
|
|
2972
|
-
end:
|
|
3185
|
+
end: gt.deserialize(t.end)
|
|
2973
3186
|
});
|
|
2974
3187
|
}
|
|
2975
3188
|
/**
|
|
@@ -2987,7 +3200,7 @@ T.prototype.getPartialCfi = function() {
|
|
|
2987
3200
|
return this.otherLocations?.get("partialCfi");
|
|
2988
3201
|
};
|
|
2989
3202
|
T.prototype.getDomRange = function() {
|
|
2990
|
-
return
|
|
3203
|
+
return Kt.deserialize(this.otherLocations?.get("domRange"));
|
|
2991
3204
|
};
|
|
2992
3205
|
T.prototype.fragmentParameters = function() {
|
|
2993
3206
|
return new Map(
|
|
@@ -3021,7 +3234,7 @@ T.prototype.space = function() {
|
|
|
3021
3234
|
if (t.length === 4 && !t.some(isNaN))
|
|
3022
3235
|
return t;
|
|
3023
3236
|
};
|
|
3024
|
-
class
|
|
3237
|
+
class Zt {
|
|
3025
3238
|
/** Creates a [Price]. */
|
|
3026
3239
|
constructor(t) {
|
|
3027
3240
|
this.currency = t.currency, this.value = t.value;
|
|
@@ -3034,9 +3247,9 @@ class Kt {
|
|
|
3034
3247
|
let e = t.currency;
|
|
3035
3248
|
if (!(e && typeof e == "string" && e.length > 0))
|
|
3036
3249
|
return;
|
|
3037
|
-
let i =
|
|
3250
|
+
let i = z(t.value);
|
|
3038
3251
|
if (i !== void 0)
|
|
3039
|
-
return new
|
|
3252
|
+
return new Zt({ currency: e, value: i });
|
|
3040
3253
|
}
|
|
3041
3254
|
/**
|
|
3042
3255
|
* Serializes a [Price] to its RWPM JSON representation.
|
|
@@ -3045,7 +3258,7 @@ class Kt {
|
|
|
3045
3258
|
return { currency: this.currency, value: this.value };
|
|
3046
3259
|
}
|
|
3047
3260
|
}
|
|
3048
|
-
class
|
|
3261
|
+
class tt {
|
|
3049
3262
|
/** Creates a [Acquisition]. */
|
|
3050
3263
|
constructor(t) {
|
|
3051
3264
|
this.type = t.type, this.children = t.children;
|
|
@@ -3055,14 +3268,14 @@ class j {
|
|
|
3055
3268
|
*/
|
|
3056
3269
|
static deserialize(t) {
|
|
3057
3270
|
if (t && t.type)
|
|
3058
|
-
return new
|
|
3271
|
+
return new tt({
|
|
3059
3272
|
type: t.type,
|
|
3060
|
-
children:
|
|
3273
|
+
children: tt.deserializeArray(t.children)
|
|
3061
3274
|
});
|
|
3062
3275
|
}
|
|
3063
3276
|
static deserializeArray(t) {
|
|
3064
3277
|
if (Array.isArray(t))
|
|
3065
|
-
return t.map((e) =>
|
|
3278
|
+
return t.map((e) => tt.deserialize(e)).filter((e) => e !== void 0);
|
|
3066
3279
|
}
|
|
3067
3280
|
/**
|
|
3068
3281
|
* Serializes a [Acquisition] to its RWPM JSON representation.
|
|
@@ -3072,7 +3285,7 @@ class j {
|
|
|
3072
3285
|
return this.children && (t.children = this.children.map((e) => e.serialize())), t;
|
|
3073
3286
|
}
|
|
3074
3287
|
}
|
|
3075
|
-
class
|
|
3288
|
+
class Jt {
|
|
3076
3289
|
/** Creates a [Price]. */
|
|
3077
3290
|
constructor(t) {
|
|
3078
3291
|
this.total = t.total, this.position = t.position;
|
|
@@ -3082,9 +3295,9 @@ class Zt {
|
|
|
3082
3295
|
*/
|
|
3083
3296
|
static deserialize(t) {
|
|
3084
3297
|
if (t)
|
|
3085
|
-
return new
|
|
3086
|
-
total:
|
|
3087
|
-
position:
|
|
3298
|
+
return new Jt({
|
|
3299
|
+
total: z(t.total),
|
|
3300
|
+
position: z(t.position)
|
|
3088
3301
|
});
|
|
3089
3302
|
}
|
|
3090
3303
|
/**
|
|
@@ -3095,7 +3308,7 @@ class Zt {
|
|
|
3095
3308
|
return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
|
|
3096
3309
|
}
|
|
3097
3310
|
}
|
|
3098
|
-
class
|
|
3311
|
+
class qt {
|
|
3099
3312
|
/** Creates a [Copies]. */
|
|
3100
3313
|
constructor(t) {
|
|
3101
3314
|
this.total = t.total, this.available = t.available;
|
|
@@ -3105,9 +3318,9 @@ class Jt {
|
|
|
3105
3318
|
*/
|
|
3106
3319
|
static deserialize(t) {
|
|
3107
3320
|
if (t)
|
|
3108
|
-
return new
|
|
3109
|
-
total:
|
|
3110
|
-
available:
|
|
3321
|
+
return new qt({
|
|
3322
|
+
total: z(t.total),
|
|
3323
|
+
available: z(t.available)
|
|
3111
3324
|
});
|
|
3112
3325
|
}
|
|
3113
3326
|
/**
|
|
@@ -3118,8 +3331,8 @@ class Jt {
|
|
|
3118
3331
|
return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
|
|
3119
3332
|
}
|
|
3120
3333
|
}
|
|
3121
|
-
var
|
|
3122
|
-
class
|
|
3334
|
+
var Ui = /* @__PURE__ */ ((s) => (s.available = "available", s.reserved = "reserved", s.ready = "ready", s))(Ui || {});
|
|
3335
|
+
class Qt {
|
|
3123
3336
|
/** Creates a [Availability]. */
|
|
3124
3337
|
constructor(t) {
|
|
3125
3338
|
this.state = t.state, this.since = t.since, this.until = t.until;
|
|
@@ -3129,10 +3342,10 @@ class qt {
|
|
|
3129
3342
|
*/
|
|
3130
3343
|
static deserialize(t) {
|
|
3131
3344
|
if (t && t.state)
|
|
3132
|
-
return new
|
|
3345
|
+
return new Qt({
|
|
3133
3346
|
state: t.state,
|
|
3134
|
-
since:
|
|
3135
|
-
until:
|
|
3347
|
+
since: lt(t.since),
|
|
3348
|
+
until: lt(t.until)
|
|
3136
3349
|
});
|
|
3137
3350
|
}
|
|
3138
3351
|
/**
|
|
@@ -3143,33 +3356,33 @@ class qt {
|
|
|
3143
3356
|
return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
|
|
3144
3357
|
}
|
|
3145
3358
|
}
|
|
3146
|
-
|
|
3147
|
-
return
|
|
3359
|
+
U.prototype.getNumberOfItems = function() {
|
|
3360
|
+
return z(this.otherProperties.numberOfItems);
|
|
3148
3361
|
};
|
|
3149
|
-
|
|
3150
|
-
return
|
|
3362
|
+
U.prototype.getPrice = function() {
|
|
3363
|
+
return Zt.deserialize(this.otherProperties.price);
|
|
3151
3364
|
};
|
|
3152
|
-
|
|
3365
|
+
U.prototype.getIndirectAcquisitions = function() {
|
|
3153
3366
|
const s = this.otherProperties.indirectAcquisition;
|
|
3154
3367
|
if (s && Array.isArray(s))
|
|
3155
|
-
return s.map((t) =>
|
|
3368
|
+
return s.map((t) => tt.deserialize(t)).filter((t) => t !== void 0);
|
|
3156
3369
|
};
|
|
3157
|
-
|
|
3158
|
-
return
|
|
3370
|
+
U.prototype.getHolds = function() {
|
|
3371
|
+
return Jt.deserialize(this.otherProperties.holds);
|
|
3159
3372
|
};
|
|
3160
|
-
|
|
3161
|
-
return
|
|
3373
|
+
U.prototype.getCopies = function() {
|
|
3374
|
+
return qt.deserialize(this.otherProperties.copies);
|
|
3162
3375
|
};
|
|
3163
|
-
|
|
3164
|
-
return
|
|
3376
|
+
U.prototype.getAvailability = function() {
|
|
3377
|
+
return Qt.deserialize(this.otherProperties.availability);
|
|
3165
3378
|
};
|
|
3166
|
-
|
|
3167
|
-
return
|
|
3379
|
+
U.prototype.getAuthenticate = function() {
|
|
3380
|
+
return M.deserialize(this.otherProperties.authenticate);
|
|
3168
3381
|
};
|
|
3169
|
-
|
|
3382
|
+
Y.prototype.getImages = function() {
|
|
3170
3383
|
return this.linksWithRole("images");
|
|
3171
3384
|
};
|
|
3172
|
-
class
|
|
3385
|
+
class ar {
|
|
3173
3386
|
/**
|
|
3174
3387
|
* Extracts the full raw text, or returns null if no text content can be found.
|
|
3175
3388
|
* @param separator Separator to use between individual elements. Defaults to newline.
|
|
@@ -3188,13 +3401,13 @@ class nr {
|
|
|
3188
3401
|
return t;
|
|
3189
3402
|
}
|
|
3190
3403
|
}
|
|
3191
|
-
class
|
|
3404
|
+
class oe {
|
|
3192
3405
|
constructor(t, e) {
|
|
3193
3406
|
this.key = t, this.value = e;
|
|
3194
3407
|
}
|
|
3195
3408
|
}
|
|
3196
|
-
var
|
|
3197
|
-
class
|
|
3409
|
+
var zt = /* @__PURE__ */ ((s) => (s.ACCESSIBILITY_LABEL = "accessibilityLabel", s.LANGUAGE = "language", s))(zt || {});
|
|
3410
|
+
class me {
|
|
3198
3411
|
constructor(t = []) {
|
|
3199
3412
|
this._attributes = t;
|
|
3200
3413
|
}
|
|
@@ -3223,12 +3436,12 @@ class pe {
|
|
|
3223
3436
|
return this._attributes.filter((e) => e.key === t).map((e) => e.value);
|
|
3224
3437
|
}
|
|
3225
3438
|
}
|
|
3226
|
-
class
|
|
3439
|
+
class ge extends me {
|
|
3227
3440
|
constructor(t, e = []) {
|
|
3228
3441
|
super(e), this.locator = t;
|
|
3229
3442
|
}
|
|
3230
3443
|
}
|
|
3231
|
-
class
|
|
3444
|
+
class yt extends ge {
|
|
3232
3445
|
/**
|
|
3233
3446
|
* Human-readable text representation for this element.
|
|
3234
3447
|
*/
|
|
@@ -3236,17 +3449,17 @@ class At extends me {
|
|
|
3236
3449
|
return this.accessibilityLabel;
|
|
3237
3450
|
}
|
|
3238
3451
|
}
|
|
3239
|
-
class
|
|
3452
|
+
class Mi extends yt {
|
|
3240
3453
|
constructor(t, e, i = []) {
|
|
3241
3454
|
super(t, i), this.embeddedLink = e;
|
|
3242
3455
|
}
|
|
3243
3456
|
}
|
|
3244
|
-
class
|
|
3457
|
+
class Bi extends yt {
|
|
3245
3458
|
constructor(t, e, i = []) {
|
|
3246
3459
|
super(t, i), this.embeddedLink = e;
|
|
3247
3460
|
}
|
|
3248
3461
|
}
|
|
3249
|
-
class
|
|
3462
|
+
class Gi extends yt {
|
|
3250
3463
|
constructor(t, e, i, r = []) {
|
|
3251
3464
|
super(t, r), this.embeddedLink = e, this.caption = i;
|
|
3252
3465
|
}
|
|
@@ -3254,12 +3467,12 @@ class Bi extends At {
|
|
|
3254
3467
|
return (this.caption?.length || 0) > 0 ? this.caption : super.text;
|
|
3255
3468
|
}
|
|
3256
3469
|
}
|
|
3257
|
-
class
|
|
3470
|
+
class be extends me {
|
|
3258
3471
|
constructor(t, e, i = []) {
|
|
3259
3472
|
super(i), this.locator = t, this.text = e;
|
|
3260
3473
|
}
|
|
3261
3474
|
}
|
|
3262
|
-
class
|
|
3475
|
+
class Ct extends yt {
|
|
3263
3476
|
constructor(t, e, i, r = []) {
|
|
3264
3477
|
super(t, r), this.role = e, this.segments = i;
|
|
3265
3478
|
}
|
|
@@ -3267,7 +3480,7 @@ class zt extends At {
|
|
|
3267
3480
|
return this.segments.map((t) => t.text).join("");
|
|
3268
3481
|
}
|
|
3269
3482
|
}
|
|
3270
|
-
class
|
|
3483
|
+
class Wi {
|
|
3271
3484
|
constructor(t) {
|
|
3272
3485
|
this.level = t;
|
|
3273
3486
|
}
|
|
@@ -3275,17 +3488,17 @@ class Gi {
|
|
|
3275
3488
|
return `heading-${this.level}`;
|
|
3276
3489
|
}
|
|
3277
3490
|
}
|
|
3278
|
-
const
|
|
3491
|
+
const Hi = {
|
|
3279
3492
|
role: "body"
|
|
3280
|
-
},
|
|
3493
|
+
}, Fi = {
|
|
3281
3494
|
role: "footnote"
|
|
3282
3495
|
};
|
|
3283
|
-
class
|
|
3496
|
+
class _i {
|
|
3284
3497
|
constructor(t, e) {
|
|
3285
3498
|
this.referenceUrl = t, this.referenceTitle = e, this.role = "quote";
|
|
3286
3499
|
}
|
|
3287
3500
|
}
|
|
3288
|
-
class
|
|
3501
|
+
class or {
|
|
3289
3502
|
/**
|
|
3290
3503
|
*
|
|
3291
3504
|
* @param defaultLanguage The default assumed language
|
|
@@ -3297,8 +3510,8 @@ class ar {
|
|
|
3297
3510
|
this.defaultLanguage = t, this.contextSnippetLength = i, this.textTokenizerFactory = r;
|
|
3298
3511
|
}
|
|
3299
3512
|
tokenize(t) {
|
|
3300
|
-
return t instanceof
|
|
3301
|
-
new
|
|
3513
|
+
return t instanceof Ct ? [
|
|
3514
|
+
new Ct(
|
|
3302
3515
|
t.locator,
|
|
3303
3516
|
t.role,
|
|
3304
3517
|
t.segments.map((e) => this.tokenizeSegment(e)).flat()
|
|
@@ -3306,8 +3519,8 @@ class ar {
|
|
|
3306
3519
|
] : [t];
|
|
3307
3520
|
}
|
|
3308
3521
|
tokenizeSegment(t) {
|
|
3309
|
-
return this.textTokenizerFactory(t.language ?? this.defaultLanguage).tokenize(t.text).map((e) => new
|
|
3310
|
-
new
|
|
3522
|
+
return this.textTokenizerFactory(t.language ?? this.defaultLanguage).tokenize(t.text).map((e) => new be(
|
|
3523
|
+
new D({
|
|
3311
3524
|
href: t.locator.href,
|
|
3312
3525
|
type: t.locator.type,
|
|
3313
3526
|
title: t.locator.title,
|
|
@@ -3320,19 +3533,19 @@ class ar {
|
|
|
3320
3533
|
}
|
|
3321
3534
|
extractTextContextIn(t, e) {
|
|
3322
3535
|
const i = t.substring(e[1], e[1] + this.contextSnippetLength), r = t.substring(e[0] - this.contextSnippetLength, e[0]);
|
|
3323
|
-
return new
|
|
3536
|
+
return new nt({
|
|
3324
3537
|
after: i.length > 0 ? i : void 0,
|
|
3325
3538
|
before: r.length > 0 ? r : void 0,
|
|
3326
3539
|
highlight: t.substring(e[0], e[1])
|
|
3327
3540
|
});
|
|
3328
3541
|
}
|
|
3329
3542
|
}
|
|
3330
|
-
class
|
|
3543
|
+
class it extends Error {
|
|
3331
3544
|
constructor(t) {
|
|
3332
3545
|
super(t);
|
|
3333
3546
|
}
|
|
3334
3547
|
}
|
|
3335
|
-
class
|
|
3548
|
+
class jt {
|
|
3336
3549
|
/**
|
|
3337
3550
|
* Advances to the next item and returns it, or null if we reached the end.
|
|
3338
3551
|
*/
|
|
@@ -3351,7 +3564,7 @@ let Vi = class {
|
|
|
3351
3564
|
this.element = t, this.direction = e;
|
|
3352
3565
|
}
|
|
3353
3566
|
};
|
|
3354
|
-
class
|
|
3567
|
+
class lr extends jt {
|
|
3355
3568
|
constructor(t, e, i) {
|
|
3356
3569
|
super(), this.publication = t, this.startLocator = e, this.resourceContentIteratorFactories = i, this._currentIterator = null, this.currentElement = null;
|
|
3357
3570
|
}
|
|
@@ -3362,7 +3575,7 @@ class cr extends Qt {
|
|
|
3362
3575
|
), this.currentElement !== null;
|
|
3363
3576
|
}
|
|
3364
3577
|
previous() {
|
|
3365
|
-
if (this.currentElement?.direction !== -1) throw new
|
|
3578
|
+
if (this.currentElement?.direction !== -1) throw new it("Called previous() without a successful call to hasPrevious() first");
|
|
3366
3579
|
return this.currentElement.element;
|
|
3367
3580
|
}
|
|
3368
3581
|
async hasNext() {
|
|
@@ -3372,7 +3585,7 @@ class cr extends Qt {
|
|
|
3372
3585
|
), this.currentElement !== null;
|
|
3373
3586
|
}
|
|
3374
3587
|
next() {
|
|
3375
|
-
if (this.currentElement?.direction !== 1) throw new
|
|
3588
|
+
if (this.currentElement?.direction !== 1) throw new it("Called next() without a successful call to hasNext() first");
|
|
3376
3589
|
return this.currentElement.element;
|
|
3377
3590
|
}
|
|
3378
3591
|
async nextIn(t) {
|
|
@@ -3422,7 +3635,7 @@ class cr extends Qt {
|
|
|
3422
3635
|
return null;
|
|
3423
3636
|
}
|
|
3424
3637
|
}
|
|
3425
|
-
class
|
|
3638
|
+
class St extends ge {
|
|
3426
3639
|
constructor(t, e, i = []) {
|
|
3427
3640
|
super(t, i), this.element = e;
|
|
3428
3641
|
}
|
|
@@ -3430,24 +3643,24 @@ class wt extends me {
|
|
|
3430
3643
|
return this.element.text;
|
|
3431
3644
|
}
|
|
3432
3645
|
}
|
|
3433
|
-
class
|
|
3646
|
+
class ce {
|
|
3434
3647
|
constructor(t, e) {
|
|
3435
3648
|
this.element = t, this.direction = e;
|
|
3436
3649
|
}
|
|
3437
3650
|
}
|
|
3438
|
-
class
|
|
3651
|
+
class hr extends jt {
|
|
3439
3652
|
constructor(t, e) {
|
|
3440
3653
|
super(), this.pageContent = t, this.startLocator = e, this.pageContentFiltered = [], this.currentElement = null, this.currentProgression = 0, this.currentElementIndex = 0;
|
|
3441
3654
|
const i = this.pageContent.filter(
|
|
3442
3655
|
(r) => r?.str !== " " && r?.str !== ""
|
|
3443
3656
|
);
|
|
3444
|
-
if (this.pageContentFiltered = i.map((r) => new
|
|
3657
|
+
if (this.pageContentFiltered = i.map((r) => new St(r.locator, {
|
|
3445
3658
|
index: i.indexOf(r),
|
|
3446
3659
|
text: r.str,
|
|
3447
3660
|
readingDirection: r.dir
|
|
3448
3661
|
})), this.startLocator && (this.currentProgression = this.startLocator?.locations?.progression || 0, this.updateElementIndex()), this.pageContentFiltered.length > 0) {
|
|
3449
3662
|
const r = this.currentElementIndex;
|
|
3450
|
-
(r || r === 0) && (this.currentElement = new
|
|
3663
|
+
(r || r === 0) && (this.currentElement = new ce(
|
|
3451
3664
|
this.pageContentFiltered[r],
|
|
3452
3665
|
1
|
|
3453
3666
|
/* Forward */
|
|
@@ -3465,7 +3678,7 @@ class lr extends Qt {
|
|
|
3465
3678
|
) !== null;
|
|
3466
3679
|
}
|
|
3467
3680
|
previous() {
|
|
3468
|
-
if (!this.currentElement) throw new
|
|
3681
|
+
if (!this.currentElement) throw new it("Called next() without a successful call to hasNext() first");
|
|
3469
3682
|
if (this.currentElement = this.nextIn(
|
|
3470
3683
|
-1
|
|
3471
3684
|
/* Backward */
|
|
@@ -3473,7 +3686,7 @@ class lr extends Qt {
|
|
|
3473
3686
|
const t = this.currentElementIndex - 1;
|
|
3474
3687
|
this.currentProgression = t / this.pageContentFiltered.length * 100, this.currentElementIndex = t;
|
|
3475
3688
|
}
|
|
3476
|
-
return this.currentElement ? this.currentElement.element : new
|
|
3689
|
+
return this.currentElement ? this.currentElement.element : new St(new D({ href: "", type: "" }), { index: -1, text: "" });
|
|
3477
3690
|
}
|
|
3478
3691
|
async hasNext() {
|
|
3479
3692
|
return this.currentElement?.direction, this.nextIn(
|
|
@@ -3491,13 +3704,13 @@ class lr extends Qt {
|
|
|
3491
3704
|
const e = t + 1;
|
|
3492
3705
|
this.currentProgression = e / this.pageContentFiltered.length * 100, this.currentElementIndex = e;
|
|
3493
3706
|
}
|
|
3494
|
-
return this.currentElement ? this.currentElement.element : new
|
|
3707
|
+
return this.currentElement ? this.currentElement.element : new St(new D({ href: "", type: "" }), { index: -1, text: "" });
|
|
3495
3708
|
}
|
|
3496
3709
|
nextIn(t) {
|
|
3497
3710
|
const e = this.currentElementIndex;
|
|
3498
3711
|
if (e === null || e === this.pageContentFiltered.length - 1 && t === 1 || e === 0 && t === -1) return null;
|
|
3499
3712
|
const i = this.pageContentFiltered[e + t];
|
|
3500
|
-
return i ? new
|
|
3713
|
+
return i ? new ce(i, t) : null;
|
|
3501
3714
|
}
|
|
3502
3715
|
/**
|
|
3503
3716
|
* Updates the current [PDFReadableElement] position in the pageContentFiltered array
|
|
@@ -3507,7 +3720,7 @@ class lr extends Qt {
|
|
|
3507
3720
|
return this.currentProgression === 0 ? 0 : this.currentProgression < 0 || this.currentProgression >= 100 ? null : Math.floor(this.currentProgression * this.pageContentFiltered.length / 100);
|
|
3508
3721
|
}
|
|
3509
3722
|
}
|
|
3510
|
-
const
|
|
3723
|
+
const Yi = [
|
|
3511
3724
|
"OBJECT",
|
|
3512
3725
|
"BASE",
|
|
3513
3726
|
"FONT",
|
|
@@ -3575,10 +3788,10 @@ const _i = [
|
|
|
3575
3788
|
"NOBR",
|
|
3576
3789
|
"RB"
|
|
3577
3790
|
];
|
|
3578
|
-
function
|
|
3579
|
-
return
|
|
3791
|
+
function le(s) {
|
|
3792
|
+
return Yi.includes(s.nodeName.toUpperCase());
|
|
3580
3793
|
}
|
|
3581
|
-
function
|
|
3794
|
+
function Et(s, t) {
|
|
3582
3795
|
const e = s.getAttribute("src");
|
|
3583
3796
|
if (!e?.length) return null;
|
|
3584
3797
|
try {
|
|
@@ -3587,15 +3800,15 @@ function St(s, t) {
|
|
|
3587
3800
|
return e;
|
|
3588
3801
|
}
|
|
3589
3802
|
}
|
|
3590
|
-
const
|
|
3803
|
+
const st = "[\\s\\u0085\\u00A0\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]", $i = new RegExp(`^${st}+$`, "g"), Xi = new RegExp(`^${st}+|${st}+$/g`, "g"), ve = new RegExp(`^${st}+`, "g"), Ae = new RegExp(`${st}+$`, "g"), ct = (s) => (
|
|
3591
3804
|
// Normal spaces, \t, \n, \v, \f, \r, U+0085, U+00A0, U+2000 to U+200A, U+2028, U+2029, U+202F, U+205F, U+3000
|
|
3592
|
-
s?.length ?
|
|
3593
|
-
),
|
|
3594
|
-
before: t + (
|
|
3595
|
-
highlight:
|
|
3596
|
-
after:
|
|
3805
|
+
s?.length ? $i.test(s) : !0
|
|
3806
|
+
), ye = (s) => s.replace(Xi, ""), Ki = (s) => s.replace(ve, ""), Zi = (s) => s.replace(Ae, ""), he = (s, t = "") => new nt({
|
|
3807
|
+
before: t + (ve.exec(s)?.[0] ?? ""),
|
|
3808
|
+
highlight: ye(s),
|
|
3809
|
+
after: Ae.exec(s)?.[0] ?? ""
|
|
3597
3810
|
});
|
|
3598
|
-
function
|
|
3811
|
+
function Ji(s) {
|
|
3599
3812
|
for (; s; ) {
|
|
3600
3813
|
let t = s.getAttribute("lang") || s.getAttributeNS("http://www.w3.org/1999/xhtml", "lang") || s.getAttributeNS("http://www.w3.org/XML/1998/namespace", "lang");
|
|
3601
3814
|
if (t) return t;
|
|
@@ -3603,11 +3816,11 @@ function Zi(s) {
|
|
|
3603
3816
|
}
|
|
3604
3817
|
return null;
|
|
3605
3818
|
}
|
|
3606
|
-
function
|
|
3819
|
+
function qi(s, t) {
|
|
3607
3820
|
const e = s.length > 0 && s[s.length - 1] === " ";
|
|
3608
3821
|
let i = !1, r = !1;
|
|
3609
3822
|
for (let n = 0; n < t.length; n++)
|
|
3610
|
-
if (
|
|
3823
|
+
if (ct(t[n])) {
|
|
3611
3824
|
if (e && !r || i)
|
|
3612
3825
|
continue;
|
|
3613
3826
|
s += " ", i = !0;
|
|
@@ -3617,10 +3830,10 @@ function Ji(s, t) {
|
|
|
3617
3830
|
}
|
|
3618
3831
|
return s;
|
|
3619
3832
|
}
|
|
3620
|
-
function
|
|
3833
|
+
function we(s) {
|
|
3621
3834
|
return typeof s == "object" && s !== null && s.nodeType === Node.ELEMENT_NODE;
|
|
3622
3835
|
}
|
|
3623
|
-
const
|
|
3836
|
+
const bt = {
|
|
3624
3837
|
NONE: "",
|
|
3625
3838
|
DESCENDANT: " ",
|
|
3626
3839
|
CHILD: " > "
|
|
@@ -3632,14 +3845,14 @@ const gt = {
|
|
|
3632
3845
|
nthchild: "nthchild",
|
|
3633
3846
|
nthoftype: "nthoftype"
|
|
3634
3847
|
};
|
|
3635
|
-
function
|
|
3848
|
+
function Qi(s, t) {
|
|
3636
3849
|
return Object.values(s).includes(t);
|
|
3637
3850
|
}
|
|
3638
|
-
const
|
|
3639
|
-
function
|
|
3640
|
-
console.warn(`${
|
|
3851
|
+
const ji = "CssSelectorGenerator";
|
|
3852
|
+
function vt(s = "unknown problem", ...t) {
|
|
3853
|
+
console.warn(`${ji}: ${s}`, ...t);
|
|
3641
3854
|
}
|
|
3642
|
-
const
|
|
3855
|
+
const ts = {
|
|
3643
3856
|
selectors: [
|
|
3644
3857
|
E.id,
|
|
3645
3858
|
E.class,
|
|
@@ -3657,165 +3870,165 @@ const ji = {
|
|
|
3657
3870
|
maxCandidates: Number.POSITIVE_INFINITY,
|
|
3658
3871
|
useScope: !1
|
|
3659
3872
|
};
|
|
3660
|
-
function
|
|
3661
|
-
return Array.isArray(s) ? s.filter((t) =>
|
|
3873
|
+
function es(s) {
|
|
3874
|
+
return Array.isArray(s) ? s.filter((t) => Qi(E, t)) : [];
|
|
3662
3875
|
}
|
|
3663
|
-
function
|
|
3876
|
+
function Se(s) {
|
|
3664
3877
|
return s instanceof RegExp;
|
|
3665
3878
|
}
|
|
3666
|
-
function
|
|
3667
|
-
return ["string", "function"].includes(typeof s) ||
|
|
3879
|
+
function is(s) {
|
|
3880
|
+
return ["string", "function"].includes(typeof s) || Se(s);
|
|
3668
3881
|
}
|
|
3669
|
-
function
|
|
3670
|
-
return Array.isArray(s) ? s.filter(
|
|
3882
|
+
function ue(s) {
|
|
3883
|
+
return Array.isArray(s) ? s.filter(is) : [];
|
|
3671
3884
|
}
|
|
3672
|
-
function
|
|
3885
|
+
function ss(s) {
|
|
3673
3886
|
return s instanceof Node;
|
|
3674
3887
|
}
|
|
3675
|
-
function
|
|
3888
|
+
function de(s) {
|
|
3676
3889
|
const t = [
|
|
3677
3890
|
Node.DOCUMENT_NODE,
|
|
3678
3891
|
Node.DOCUMENT_FRAGMENT_NODE,
|
|
3679
3892
|
// this includes Shadow DOM root
|
|
3680
3893
|
Node.ELEMENT_NODE
|
|
3681
3894
|
];
|
|
3682
|
-
return
|
|
3895
|
+
return ss(s) && t.includes(s.nodeType);
|
|
3683
3896
|
}
|
|
3684
|
-
function
|
|
3685
|
-
if (
|
|
3686
|
-
return s.contains(t) ||
|
|
3897
|
+
function Ee(s, t) {
|
|
3898
|
+
if (de(s))
|
|
3899
|
+
return s.contains(t) || vt("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 not work as intended."), s;
|
|
3687
3900
|
const e = t.getRootNode({ composed: !1 });
|
|
3688
|
-
return
|
|
3901
|
+
return de(e) ? (e !== document && vt("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."), e) : ee(t);
|
|
3689
3902
|
}
|
|
3690
|
-
function
|
|
3903
|
+
function Tt(s) {
|
|
3691
3904
|
return typeof s == "number" ? s : Number.POSITIVE_INFINITY;
|
|
3692
3905
|
}
|
|
3693
|
-
function
|
|
3694
|
-
const e = Object.assign(Object.assign({},
|
|
3906
|
+
function rs(s, t = {}) {
|
|
3907
|
+
const e = Object.assign(Object.assign({}, ts), t);
|
|
3695
3908
|
return {
|
|
3696
|
-
selectors:
|
|
3697
|
-
whitelist:
|
|
3698
|
-
blacklist:
|
|
3699
|
-
root:
|
|
3909
|
+
selectors: es(e.selectors),
|
|
3910
|
+
whitelist: ue(e.whitelist),
|
|
3911
|
+
blacklist: ue(e.blacklist),
|
|
3912
|
+
root: Ee(e.root, s),
|
|
3700
3913
|
combineWithinSelector: !!e.combineWithinSelector,
|
|
3701
3914
|
combineBetweenSelectors: !!e.combineBetweenSelectors,
|
|
3702
3915
|
includeTag: !!e.includeTag,
|
|
3703
|
-
maxCombinations:
|
|
3704
|
-
maxCandidates:
|
|
3916
|
+
maxCombinations: Tt(e.maxCombinations),
|
|
3917
|
+
maxCandidates: Tt(e.maxCandidates),
|
|
3705
3918
|
useScope: !!e.useScope,
|
|
3706
|
-
maxResults:
|
|
3919
|
+
maxResults: Tt(e.maxResults)
|
|
3707
3920
|
};
|
|
3708
3921
|
}
|
|
3709
|
-
function
|
|
3922
|
+
function at(s = []) {
|
|
3710
3923
|
const [t = [], ...e] = s;
|
|
3711
3924
|
return e.length === 0 ? t : e.reduce((i, r) => i.filter((n) => r.includes(n)), t);
|
|
3712
3925
|
}
|
|
3713
|
-
function
|
|
3926
|
+
function ns(s) {
|
|
3714
3927
|
return [].concat(...s);
|
|
3715
3928
|
}
|
|
3716
|
-
function
|
|
3929
|
+
function as(s) {
|
|
3717
3930
|
return s.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
3718
3931
|
}
|
|
3719
3932
|
function Rt(s) {
|
|
3720
3933
|
const t = s.map((e) => {
|
|
3721
|
-
if (
|
|
3934
|
+
if (Se(e))
|
|
3722
3935
|
return (i) => e.test(i);
|
|
3723
3936
|
if (typeof e == "function")
|
|
3724
3937
|
return (i) => {
|
|
3725
3938
|
const r = e(i);
|
|
3726
|
-
return typeof r != "boolean" ? (
|
|
3939
|
+
return typeof r != "boolean" ? (vt("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : r;
|
|
3727
3940
|
};
|
|
3728
3941
|
if (typeof e == "string") {
|
|
3729
|
-
const i = new RegExp("^" +
|
|
3942
|
+
const i = new RegExp("^" + as(e) + "$");
|
|
3730
3943
|
return (r) => i.test(r);
|
|
3731
3944
|
}
|
|
3732
|
-
return
|
|
3945
|
+
return vt("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
3733
3946
|
});
|
|
3734
3947
|
return (e) => t.some((i) => i(e));
|
|
3735
3948
|
}
|
|
3736
|
-
function
|
|
3737
|
-
const i = Array.from(
|
|
3949
|
+
function te(s, t, e) {
|
|
3950
|
+
const i = Array.from(Ee(e, s[0]).querySelectorAll(t));
|
|
3738
3951
|
return i.length === s.length && s.every((r) => i.includes(r));
|
|
3739
3952
|
}
|
|
3740
|
-
function
|
|
3741
|
-
t = t ??
|
|
3953
|
+
function Te(s, t) {
|
|
3954
|
+
t = t ?? ee(s);
|
|
3742
3955
|
const e = [];
|
|
3743
3956
|
let i = s;
|
|
3744
|
-
for (;
|
|
3957
|
+
for (; we(i) && i !== t; )
|
|
3745
3958
|
e.push(i), i = i.parentElement;
|
|
3746
3959
|
return e;
|
|
3747
3960
|
}
|
|
3748
|
-
function
|
|
3749
|
-
return
|
|
3961
|
+
function os(s, t) {
|
|
3962
|
+
return at(s.map((e) => Te(e, t)));
|
|
3750
3963
|
}
|
|
3751
|
-
function
|
|
3964
|
+
function ee(s) {
|
|
3752
3965
|
return s.ownerDocument.querySelector(":root");
|
|
3753
3966
|
}
|
|
3754
|
-
const
|
|
3967
|
+
const Ie = ", ", cs = new RegExp([
|
|
3755
3968
|
"^$",
|
|
3756
3969
|
// empty or not set
|
|
3757
3970
|
"\\s"
|
|
3758
3971
|
// contains whitespace
|
|
3759
|
-
].join("|")),
|
|
3972
|
+
].join("|")), ls = new RegExp([
|
|
3760
3973
|
"^$"
|
|
3761
3974
|
// empty or not set
|
|
3762
|
-
].join("|")),
|
|
3975
|
+
].join("|")), xe = [
|
|
3763
3976
|
E.nthoftype,
|
|
3764
3977
|
E.tag,
|
|
3765
3978
|
E.id,
|
|
3766
3979
|
E.class,
|
|
3767
3980
|
E.attribute,
|
|
3768
3981
|
E.nthchild
|
|
3769
|
-
],
|
|
3982
|
+
], hs = Rt([
|
|
3770
3983
|
"class",
|
|
3771
3984
|
"id",
|
|
3772
3985
|
// Angular attributes
|
|
3773
3986
|
"ng-*"
|
|
3774
3987
|
]);
|
|
3775
|
-
function
|
|
3988
|
+
function us({ name: s }) {
|
|
3776
3989
|
return `[${s}]`;
|
|
3777
3990
|
}
|
|
3778
|
-
function
|
|
3991
|
+
function ds({ name: s, value: t }) {
|
|
3779
3992
|
return `[${s}='${t}']`;
|
|
3780
3993
|
}
|
|
3781
|
-
function
|
|
3994
|
+
function fs({ nodeName: s, nodeValue: t }, e) {
|
|
3782
3995
|
const i = e.tagName.toLowerCase();
|
|
3783
|
-
return ["input", "option"].includes(i) && s === "value" || s === "src" && t?.startsWith("data:") ? !1 : !
|
|
3996
|
+
return ["input", "option"].includes(i) && s === "value" || s === "src" && t?.startsWith("data:") ? !1 : !hs(s);
|
|
3784
3997
|
}
|
|
3785
|
-
function
|
|
3998
|
+
function ps({ nodeName: s, nodeValue: t }) {
|
|
3786
3999
|
return {
|
|
3787
|
-
name:
|
|
3788
|
-
value:
|
|
4000
|
+
name: rt(s),
|
|
4001
|
+
value: rt(t ?? void 0)
|
|
3789
4002
|
};
|
|
3790
4003
|
}
|
|
3791
|
-
function
|
|
3792
|
-
const t = Array.from(s.attributes).filter((e) =>
|
|
4004
|
+
function Ne(s) {
|
|
4005
|
+
const t = Array.from(s.attributes).filter((e) => fs(e, s)).map(ps);
|
|
3793
4006
|
return [
|
|
3794
|
-
...t.map(
|
|
3795
|
-
...t.map(
|
|
4007
|
+
...t.map(us),
|
|
4008
|
+
...t.map(ds)
|
|
3796
4009
|
];
|
|
3797
4010
|
}
|
|
3798
|
-
function ps(s) {
|
|
3799
|
-
const t = s.map(xe);
|
|
3800
|
-
return nt(t);
|
|
3801
|
-
}
|
|
3802
|
-
function Ne(s) {
|
|
3803
|
-
var t;
|
|
3804
|
-
return ((t = s.getAttribute("class")) !== null && t !== void 0 ? t : "").trim().split(/\s+/).filter((e) => !cs.test(e)).map((e) => `.${st(e)}`);
|
|
3805
|
-
}
|
|
3806
4011
|
function ms(s) {
|
|
3807
4012
|
const t = s.map(Ne);
|
|
3808
|
-
return
|
|
4013
|
+
return at(t);
|
|
3809
4014
|
}
|
|
3810
4015
|
function Le(s) {
|
|
3811
4016
|
var t;
|
|
3812
|
-
|
|
3813
|
-
return !os.test(e) && jt([s], i, r) ? [i] : [];
|
|
4017
|
+
return ((t = s.getAttribute("class")) !== null && t !== void 0 ? t : "").trim().split(/\s+/).filter((e) => !ls.test(e)).map((e) => `.${rt(e)}`);
|
|
3814
4018
|
}
|
|
3815
4019
|
function gs(s) {
|
|
3816
|
-
|
|
4020
|
+
const t = s.map(Le);
|
|
4021
|
+
return at(t);
|
|
3817
4022
|
}
|
|
3818
4023
|
function Oe(s) {
|
|
4024
|
+
var t;
|
|
4025
|
+
const e = (t = s.getAttribute("id")) !== null && t !== void 0 ? t : "", i = `#${rt(e)}`, r = s.getRootNode({ composed: !1 });
|
|
4026
|
+
return !cs.test(e) && te([s], i, r) ? [i] : [];
|
|
4027
|
+
}
|
|
4028
|
+
function bs(s) {
|
|
4029
|
+
return s.length === 0 || s.length > 1 ? [] : Oe(s[0]);
|
|
4030
|
+
}
|
|
4031
|
+
function ze(s) {
|
|
3819
4032
|
var t;
|
|
3820
4033
|
const e = (t = s.parentElement) === null || t === void 0 ? void 0 : t.children;
|
|
3821
4034
|
if (e) {
|
|
@@ -3825,21 +4038,21 @@ function Oe(s) {
|
|
|
3825
4038
|
}
|
|
3826
4039
|
return [];
|
|
3827
4040
|
}
|
|
3828
|
-
function
|
|
3829
|
-
return
|
|
4041
|
+
function vs(s) {
|
|
4042
|
+
return at(s.map(ze));
|
|
3830
4043
|
}
|
|
3831
|
-
function
|
|
4044
|
+
function Ce(s) {
|
|
3832
4045
|
return [
|
|
3833
|
-
|
|
4046
|
+
rt(s.tagName.toLowerCase())
|
|
3834
4047
|
];
|
|
3835
4048
|
}
|
|
3836
4049
|
function Re(s) {
|
|
3837
4050
|
const t = [
|
|
3838
|
-
...new Set(
|
|
4051
|
+
...new Set(ns(s.map(Ce)))
|
|
3839
4052
|
];
|
|
3840
4053
|
return t.length === 0 || t.length > 1 ? [] : [t[0]];
|
|
3841
4054
|
}
|
|
3842
|
-
function
|
|
4055
|
+
function ke(s) {
|
|
3843
4056
|
const t = Re([s])[0], e = s.parentElement;
|
|
3844
4057
|
if (e) {
|
|
3845
4058
|
const r = Array.from(e.children).filter((n) => n.tagName.toLowerCase() === t).indexOf(s);
|
|
@@ -3850,18 +4063,18 @@ function Ce(s) {
|
|
|
3850
4063
|
}
|
|
3851
4064
|
return [];
|
|
3852
4065
|
}
|
|
3853
|
-
function
|
|
3854
|
-
return
|
|
4066
|
+
function As(s) {
|
|
4067
|
+
return at(s.map(ke));
|
|
3855
4068
|
}
|
|
3856
4069
|
function* Pe(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
|
|
3857
|
-
let e = 0, i =
|
|
4070
|
+
let e = 0, i = kt(1);
|
|
3858
4071
|
for (; i.length <= s.length && e < t; )
|
|
3859
|
-
e += 1, yield i.map((n) => s[n]), i =
|
|
4072
|
+
e += 1, yield i.map((n) => s[n]), i = ws(i, s.length - 1);
|
|
3860
4073
|
}
|
|
3861
|
-
function
|
|
4074
|
+
function ys(s = [], { maxResults: t = Number.POSITIVE_INFINITY } = {}) {
|
|
3862
4075
|
return Array.from(Pe(s, { maxResults: t }));
|
|
3863
4076
|
}
|
|
3864
|
-
function
|
|
4077
|
+
function ws(s = [], t = 0) {
|
|
3865
4078
|
const e = s.length;
|
|
3866
4079
|
if (e === 0)
|
|
3867
4080
|
return [];
|
|
@@ -3870,15 +4083,15 @@ function ys(s = [], t = 0) {
|
|
|
3870
4083
|
for (let r = e - 1; r >= 0; r--)
|
|
3871
4084
|
if (i[r] > t) {
|
|
3872
4085
|
if (r === 0)
|
|
3873
|
-
return
|
|
4086
|
+
return kt(e + 1);
|
|
3874
4087
|
i[r - 1]++, i[r] = i[r - 1] + 1;
|
|
3875
4088
|
}
|
|
3876
|
-
return i[e - 1] > t ?
|
|
4089
|
+
return i[e - 1] > t ? kt(e + 1) : i;
|
|
3877
4090
|
}
|
|
3878
|
-
function
|
|
4091
|
+
function kt(s = 1) {
|
|
3879
4092
|
return Array.from(Array(s).keys());
|
|
3880
4093
|
}
|
|
3881
|
-
function*
|
|
4094
|
+
function* Ss(s = {}) {
|
|
3882
4095
|
const t = Object.entries(s);
|
|
3883
4096
|
if (t.length === 0)
|
|
3884
4097
|
return;
|
|
@@ -3902,53 +4115,53 @@ function* ws(s = {}) {
|
|
|
3902
4115
|
});
|
|
3903
4116
|
}
|
|
3904
4117
|
}
|
|
3905
|
-
const
|
|
3906
|
-
function
|
|
3907
|
-
return CSS ? CSS.escape(s) :
|
|
4118
|
+
const Es = "3a".toUpperCase(), Ts = /[ !"#$%&'()\[\]{|}<>*+,./;=?@^`~\\]/;
|
|
4119
|
+
function rt(s = "") {
|
|
4120
|
+
return CSS ? CSS.escape(s) : Is(s);
|
|
3908
4121
|
}
|
|
3909
|
-
function
|
|
3910
|
-
return s.split("").map((t) => t === ":" ? `\\${
|
|
4122
|
+
function Is(s = "") {
|
|
4123
|
+
return s.split("").map((t) => t === ":" ? `\\${Es} ` : Ts.test(t) ? `\\${t}` : escape(t).replace(/%/g, "\\")).join("");
|
|
3911
4124
|
}
|
|
3912
|
-
const
|
|
4125
|
+
const xs = {
|
|
3913
4126
|
tag: Re,
|
|
3914
|
-
id:
|
|
3915
|
-
class:
|
|
3916
|
-
attribute:
|
|
3917
|
-
nthchild:
|
|
3918
|
-
nthoftype:
|
|
3919
|
-
},
|
|
3920
|
-
tag:
|
|
3921
|
-
id:
|
|
3922
|
-
class:
|
|
3923
|
-
attribute:
|
|
3924
|
-
nthchild:
|
|
3925
|
-
nthoftype:
|
|
4127
|
+
id: bs,
|
|
4128
|
+
class: gs,
|
|
4129
|
+
attribute: ms,
|
|
4130
|
+
nthchild: vs,
|
|
4131
|
+
nthoftype: As
|
|
4132
|
+
}, Ns = {
|
|
4133
|
+
tag: Ce,
|
|
4134
|
+
id: Oe,
|
|
4135
|
+
class: Le,
|
|
4136
|
+
attribute: Ne,
|
|
4137
|
+
nthchild: ze,
|
|
4138
|
+
nthoftype: ke
|
|
3926
4139
|
};
|
|
3927
|
-
function Ns(s, t) {
|
|
3928
|
-
return xs[t](s);
|
|
3929
|
-
}
|
|
3930
4140
|
function Ls(s, t) {
|
|
3931
|
-
|
|
4141
|
+
return Ns[t](s);
|
|
4142
|
+
}
|
|
4143
|
+
function Os(s, t) {
|
|
4144
|
+
const e = xs[t];
|
|
3932
4145
|
return e(s);
|
|
3933
4146
|
}
|
|
3934
|
-
function
|
|
4147
|
+
function zs(s = [], t, e) {
|
|
3935
4148
|
return s.filter((i) => e(i) || !t(i));
|
|
3936
4149
|
}
|
|
3937
|
-
function
|
|
4150
|
+
function Cs(s = [], t) {
|
|
3938
4151
|
return s.sort((e, i) => {
|
|
3939
4152
|
const r = t(e), n = t(i);
|
|
3940
4153
|
return r && !n ? -1 : !r && n ? 1 : 0;
|
|
3941
4154
|
});
|
|
3942
4155
|
}
|
|
3943
4156
|
function* Rs(s, t) {
|
|
3944
|
-
const e = /* @__PURE__ */ new Set(), i =
|
|
3945
|
-
for (const r of
|
|
4157
|
+
const e = /* @__PURE__ */ new Set(), i = ks(s, t);
|
|
4158
|
+
for (const r of Ms(i, t))
|
|
3946
4159
|
e.has(r) || (e.add(r), yield r);
|
|
3947
4160
|
}
|
|
3948
|
-
function
|
|
4161
|
+
function ks(s, t) {
|
|
3949
4162
|
const { blacklist: e, whitelist: i, combineWithinSelector: r, maxCombinations: n } = t, a = Rt(e), o = Rt(i), h = (m, p) => {
|
|
3950
|
-
const u =
|
|
3951
|
-
return m[p] = r ? Array.from(Pe(A, { maxResults: n })) : A.map((
|
|
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;
|
|
3952
4165
|
};
|
|
3953
4166
|
return Ps(t).reduce(h, {});
|
|
3954
4167
|
}
|
|
@@ -3956,72 +4169,72 @@ function Ps(s) {
|
|
|
3956
4169
|
const { selectors: t, includeTag: e } = s, i = [...t];
|
|
3957
4170
|
return e && !i.includes("tag") && i.push("tag"), i;
|
|
3958
4171
|
}
|
|
3959
|
-
function ks(s) {
|
|
3960
|
-
return s.includes(E.tag) || s.includes(E.nthoftype) ? [...s] : [...s, E.tag];
|
|
3961
|
-
}
|
|
3962
4172
|
function Ds(s) {
|
|
3963
|
-
|
|
3964
|
-
return i ? n.map(ks) : n;
|
|
4173
|
+
return s.includes(E.tag) || s.includes(E.nthoftype) ? [...s] : [...s, E.tag];
|
|
3965
4174
|
}
|
|
3966
|
-
function
|
|
3967
|
-
|
|
3968
|
-
|
|
4175
|
+
function Us(s) {
|
|
4176
|
+
const { selectors: t, combineBetweenSelectors: e, includeTag: i, maxCandidates: r } = s, n = e ? ys(t, { maxResults: r }) : t.map((a) => [a]);
|
|
4177
|
+
return i ? n.map(Ds) : n;
|
|
3969
4178
|
}
|
|
3970
4179
|
function* Ms(s, t) {
|
|
4180
|
+
for (const e of Us(t))
|
|
4181
|
+
yield* Bs(e, s);
|
|
4182
|
+
}
|
|
4183
|
+
function* Bs(s, t) {
|
|
3971
4184
|
const e = {};
|
|
3972
4185
|
for (const i of s) {
|
|
3973
4186
|
const r = t[i];
|
|
3974
4187
|
r && r.length > 0 && (e[i] = r);
|
|
3975
4188
|
}
|
|
3976
|
-
for (const i of
|
|
3977
|
-
yield
|
|
4189
|
+
for (const i of Ss(e))
|
|
4190
|
+
yield Ws(i);
|
|
3978
4191
|
}
|
|
3979
|
-
function
|
|
4192
|
+
function Gs(s, t) {
|
|
3980
4193
|
return t[s] ? t[s].join("") : "";
|
|
3981
4194
|
}
|
|
3982
|
-
function
|
|
3983
|
-
const t = [...
|
|
3984
|
-
return s[E.tag] && s[E.nthoftype] && t.splice(t.indexOf(E.tag), 1), t.map((e) =>
|
|
4195
|
+
function Ws(s = {}) {
|
|
4196
|
+
const t = [...xe];
|
|
4197
|
+
return s[E.tag] && s[E.nthoftype] && t.splice(t.indexOf(E.tag), 1), t.map((e) => Gs(e, s)).join("");
|
|
3985
4198
|
}
|
|
3986
|
-
function
|
|
4199
|
+
function Hs(s, t) {
|
|
3987
4200
|
return [
|
|
3988
|
-
...s.map((e) => t +
|
|
3989
|
-
...s.map((e) => t +
|
|
4201
|
+
...s.map((e) => t + bt.DESCENDANT + e),
|
|
4202
|
+
...s.map((e) => t + bt.CHILD + e)
|
|
3990
4203
|
];
|
|
3991
4204
|
}
|
|
3992
|
-
function*
|
|
4205
|
+
function* Fs(s, t) {
|
|
3993
4206
|
if (t === "")
|
|
3994
4207
|
yield* s;
|
|
3995
4208
|
else
|
|
3996
4209
|
for (const e of s)
|
|
3997
|
-
yield*
|
|
4210
|
+
yield* Hs([e], t);
|
|
3998
4211
|
}
|
|
3999
|
-
function*
|
|
4212
|
+
function* _s(s, t, e = "", i) {
|
|
4000
4213
|
const r = Rs(s, i);
|
|
4001
|
-
for (const n of
|
|
4002
|
-
|
|
4214
|
+
for (const n of Fs(r, e))
|
|
4215
|
+
te(s, n, t) && (yield n);
|
|
4003
4216
|
}
|
|
4004
4217
|
function* Vs(s, t, e = "", i) {
|
|
4005
4218
|
if (s.length === 0)
|
|
4006
4219
|
return null;
|
|
4007
4220
|
const r = [
|
|
4008
4221
|
s.length > 1 ? s : [],
|
|
4009
|
-
...
|
|
4222
|
+
...os(s, t).map((n) => [n])
|
|
4010
4223
|
];
|
|
4011
4224
|
for (const n of r)
|
|
4012
|
-
for (const a of
|
|
4225
|
+
for (const a of _s(n, t, e, i))
|
|
4013
4226
|
yield {
|
|
4014
4227
|
foundElements: n,
|
|
4015
4228
|
selector: a
|
|
4016
4229
|
};
|
|
4017
4230
|
}
|
|
4018
|
-
function*
|
|
4231
|
+
function* Ys({ elements: s, root: t, rootSelector: e = "", options: i }) {
|
|
4019
4232
|
let r = t, n = e, a = !0;
|
|
4020
4233
|
for (; a; ) {
|
|
4021
4234
|
let o = !1;
|
|
4022
4235
|
for (const h of Vs(s, r, n, i)) {
|
|
4023
4236
|
const { foundElements: m, selector: p } = h;
|
|
4024
|
-
if (o = !0,
|
|
4237
|
+
if (o = !0, te(s, p, t))
|
|
4025
4238
|
yield p;
|
|
4026
4239
|
else {
|
|
4027
4240
|
r = m[0], n = p;
|
|
@@ -4031,29 +4244,29 @@ function* _s({ elements: s, root: t, rootSelector: e = "", options: i }) {
|
|
|
4031
4244
|
o || (a = !1);
|
|
4032
4245
|
}
|
|
4033
4246
|
}
|
|
4034
|
-
function
|
|
4247
|
+
function $s(s) {
|
|
4035
4248
|
(s instanceof NodeList || s instanceof HTMLCollection) && (s = Array.from(s));
|
|
4036
|
-
const t = (Array.isArray(s) ? s : [s]).filter(
|
|
4249
|
+
const t = (Array.isArray(s) ? s : [s]).filter(we);
|
|
4037
4250
|
return [...new Set(t)];
|
|
4038
4251
|
}
|
|
4039
|
-
function
|
|
4252
|
+
function Xs(s) {
|
|
4040
4253
|
return {
|
|
4041
4254
|
value: s,
|
|
4042
4255
|
include: !1
|
|
4043
4256
|
};
|
|
4044
4257
|
}
|
|
4045
|
-
function
|
|
4258
|
+
function Ks(s, t, e = bt.NONE) {
|
|
4046
4259
|
const i = {};
|
|
4047
4260
|
return t.forEach((r) => {
|
|
4048
|
-
Reflect.set(i, r,
|
|
4261
|
+
Reflect.set(i, r, Ls(s, r).map(Xs));
|
|
4049
4262
|
}), {
|
|
4050
4263
|
element: s,
|
|
4051
4264
|
operator: e,
|
|
4052
4265
|
selectors: i
|
|
4053
4266
|
};
|
|
4054
4267
|
}
|
|
4055
|
-
function
|
|
4056
|
-
let e = [...
|
|
4268
|
+
function Zs({ selectors: s, operator: t }) {
|
|
4269
|
+
let e = [...xe];
|
|
4057
4270
|
s[E.tag] && s[E.nthoftype] && (e = e.filter((r) => r !== E.tag));
|
|
4058
4271
|
let i = "";
|
|
4059
4272
|
return e.forEach((r) => {
|
|
@@ -4063,31 +4276,31 @@ function Ks({ selectors: s, operator: t }) {
|
|
|
4063
4276
|
});
|
|
4064
4277
|
}), t + i;
|
|
4065
4278
|
}
|
|
4066
|
-
function
|
|
4067
|
-
const i =
|
|
4279
|
+
function Js(s, t) {
|
|
4280
|
+
const i = Te(s, t).reverse().map((r) => {
|
|
4068
4281
|
var n;
|
|
4069
|
-
const a =
|
|
4282
|
+
const a = Ks(r, [E.nthchild], bt.CHILD);
|
|
4070
4283
|
return ((n = a.selectors.nthchild) !== null && n !== void 0 ? n : []).forEach((o) => {
|
|
4071
4284
|
o.include = !0;
|
|
4072
4285
|
}), a;
|
|
4073
4286
|
});
|
|
4074
4287
|
return [
|
|
4075
4288
|
t ? ":scope" : ":root",
|
|
4076
|
-
...i.map(
|
|
4289
|
+
...i.map(Zs)
|
|
4077
4290
|
].join("");
|
|
4078
4291
|
}
|
|
4079
|
-
function
|
|
4080
|
-
return s.map((e) =>
|
|
4292
|
+
function qs(s, t) {
|
|
4293
|
+
return s.map((e) => Js(e, t)).join(Ie);
|
|
4081
4294
|
}
|
|
4082
|
-
function
|
|
4295
|
+
function De(s, t = {}) {
|
|
4083
4296
|
const e = Object.assign(Object.assign({}, t), { maxResults: 1 });
|
|
4084
|
-
return
|
|
4297
|
+
return Qs(s, e).next().value;
|
|
4085
4298
|
}
|
|
4086
|
-
function*
|
|
4299
|
+
function* Qs(s, t = {}) {
|
|
4087
4300
|
var e;
|
|
4088
|
-
const i =
|
|
4301
|
+
const i = $s(s), r = rs(i[0], t), n = (e = r.root) !== null && e !== void 0 ? e : ee(i[0]);
|
|
4089
4302
|
let a = 0;
|
|
4090
|
-
for (const o of
|
|
4303
|
+
for (const o of Ys({
|
|
4091
4304
|
elements: i,
|
|
4092
4305
|
options: r,
|
|
4093
4306
|
root: n,
|
|
@@ -4095,9 +4308,9 @@ function* qs(s, t = {}) {
|
|
|
4095
4308
|
}))
|
|
4096
4309
|
if (yield o, a++, a >= r.maxResults)
|
|
4097
4310
|
return;
|
|
4098
|
-
i.length > 1 && (yield i.map((o) =>
|
|
4311
|
+
i.length > 1 && (yield i.map((o) => De(o, r)).join(Ie), a++, a >= r.maxResults) || (yield qs(i, r.useScope ? n : void 0));
|
|
4099
4312
|
}
|
|
4100
|
-
class
|
|
4313
|
+
class ur extends jt {
|
|
4101
4314
|
constructor(t, e, i = 50) {
|
|
4102
4315
|
super(), this.resource = t, this.locator = e, this.beforeMaxLength = i, this.currentElement = null, this.currentIndex = null, this.parsedElementRecipes = null, this.parser = null;
|
|
4103
4316
|
}
|
|
@@ -4110,7 +4323,7 @@ class hr extends Qt {
|
|
|
4110
4323
|
}, !0) : !1;
|
|
4111
4324
|
}
|
|
4112
4325
|
previous() {
|
|
4113
|
-
if (!this.currentElement || this.currentElement.delta !== -1) throw new
|
|
4326
|
+
if (!this.currentElement || this.currentElement.delta !== -1) throw new it("Called previous() without a successful call to hasPrevious() first");
|
|
4114
4327
|
const t = this.currentElement.element;
|
|
4115
4328
|
return this.currentElement = null, t;
|
|
4116
4329
|
}
|
|
@@ -4123,7 +4336,7 @@ class hr extends Qt {
|
|
|
4123
4336
|
}, !0) : !1;
|
|
4124
4337
|
}
|
|
4125
4338
|
next() {
|
|
4126
|
-
if (!this.currentElement || this.currentElement.delta !== 1) throw new
|
|
4339
|
+
if (!this.currentElement || this.currentElement.delta !== 1) throw new it("Called next() without a successful call to hasNext() first");
|
|
4127
4340
|
const t = this.currentElement.element;
|
|
4128
4341
|
return this.currentElement = null, t;
|
|
4129
4342
|
}
|
|
@@ -4132,15 +4345,15 @@ class hr extends Qt {
|
|
|
4132
4345
|
}
|
|
4133
4346
|
async parseElements() {
|
|
4134
4347
|
const t = await this.resource.readAsString(), e = new DOMParser().parseFromString(t, this.locator.type);
|
|
4135
|
-
return this.parser = new
|
|
4348
|
+
return this.parser = new tr(
|
|
4136
4349
|
e,
|
|
4137
4350
|
this.locator,
|
|
4138
4351
|
this.locator.locations.getCssSelector() ? e.querySelector(this.locator.locations.getCssSelector()) : null,
|
|
4139
4352
|
this.beforeMaxLength
|
|
4140
|
-
),
|
|
4353
|
+
), js(this.parser, e.body), this.parser.result();
|
|
4141
4354
|
}
|
|
4142
4355
|
}
|
|
4143
|
-
function
|
|
4356
|
+
function js(s, t) {
|
|
4144
4357
|
let e = t, i = 0;
|
|
4145
4358
|
for (; e != null; )
|
|
4146
4359
|
if (s.head(e, i), e.firstChild != null)
|
|
@@ -4153,7 +4366,7 @@ function Qs(s, t) {
|
|
|
4153
4366
|
e = e?.nextSibling || null;
|
|
4154
4367
|
}
|
|
4155
4368
|
}
|
|
4156
|
-
class
|
|
4369
|
+
class tr {
|
|
4157
4370
|
constructor(t, e, i, r) {
|
|
4158
4371
|
this.doc = t, this.baseLocator = e, this.startElement = i, this.beforeMaxLength = r, this.elementRecipes = [], this.startIndex = 0, this.segmentRecipesAcc = [], this.textAcc = "", this.wholeRawTextAcc = null, this.elementRawTextAcc = "", this.rawTextAcc = "", this.currentLanguage = null, this.breadcrumbs = [], this.recipeCssSelectorCache = /* @__PURE__ */ new WeakMap();
|
|
4159
4372
|
}
|
|
@@ -4167,8 +4380,8 @@ class js {
|
|
|
4167
4380
|
const e = t.recipe.cssSelectorNode ? this.cssSelector(t.recipe.cssSelectorNode) : null;
|
|
4168
4381
|
if (t.type === 1) {
|
|
4169
4382
|
const i = t.recipe;
|
|
4170
|
-
return new
|
|
4171
|
-
new
|
|
4383
|
+
return new Gi(
|
|
4384
|
+
new D({
|
|
4172
4385
|
href: this.baseLocator.href,
|
|
4173
4386
|
type: this.baseLocator.type,
|
|
4174
4387
|
title: this.baseLocator.title,
|
|
@@ -4178,14 +4391,14 @@ class js {
|
|
|
4178
4391
|
])
|
|
4179
4392
|
} : {})
|
|
4180
4393
|
}),
|
|
4181
|
-
new
|
|
4394
|
+
new M({
|
|
4182
4395
|
href: i.href
|
|
4183
4396
|
}),
|
|
4184
4397
|
i.caption,
|
|
4185
4398
|
i.attributes
|
|
4186
4399
|
);
|
|
4187
4400
|
} else if (t.type === 2 || t.type === 3) {
|
|
4188
|
-
const i = new
|
|
4401
|
+
const i = new D({
|
|
4189
4402
|
href: this.baseLocator.href,
|
|
4190
4403
|
type: this.baseLocator.type,
|
|
4191
4404
|
title: this.baseLocator.title,
|
|
@@ -4195,22 +4408,22 @@ class js {
|
|
|
4195
4408
|
])
|
|
4196
4409
|
} : {})
|
|
4197
4410
|
}), r = t.recipe;
|
|
4198
|
-
return t.type === 3 ? new
|
|
4411
|
+
return t.type === 3 ? new Bi(
|
|
4199
4412
|
i,
|
|
4200
4413
|
r.link
|
|
4201
|
-
) : new
|
|
4414
|
+
) : new Mi(
|
|
4202
4415
|
i,
|
|
4203
4416
|
r.link
|
|
4204
4417
|
);
|
|
4205
4418
|
} else if (t.type === 0) {
|
|
4206
4419
|
const i = t.recipe, r = i.segments.map((n) => {
|
|
4207
4420
|
const a = n.cssSelectorNode ? this.cssSelector(n.cssSelectorNode) : null;
|
|
4208
|
-
return new
|
|
4209
|
-
new
|
|
4421
|
+
return new be(
|
|
4422
|
+
new D({
|
|
4210
4423
|
href: this.baseLocator.href,
|
|
4211
4424
|
type: this.baseLocator.type,
|
|
4212
4425
|
title: this.baseLocator.title,
|
|
4213
|
-
text:
|
|
4426
|
+
text: he(n.text, this.wholeRawTextAcc?.substring(n.beforeRange[0], n.beforeRange[1])),
|
|
4214
4427
|
locations: new T(a ? {
|
|
4215
4428
|
otherLocations: /* @__PURE__ */ new Map([
|
|
4216
4429
|
["cssSelector", a]
|
|
@@ -4221,12 +4434,12 @@ class js {
|
|
|
4221
4434
|
n.attributes
|
|
4222
4435
|
);
|
|
4223
4436
|
});
|
|
4224
|
-
return new
|
|
4225
|
-
new
|
|
4437
|
+
return new Ct(
|
|
4438
|
+
new D({
|
|
4226
4439
|
href: this.baseLocator.href,
|
|
4227
4440
|
type: this.baseLocator.type,
|
|
4228
4441
|
title: this.baseLocator.title,
|
|
4229
|
-
text:
|
|
4442
|
+
text: he(i.text, r.length && r[0].locator.text?.before || ""),
|
|
4230
4443
|
locations: new T(e ? {
|
|
4231
4444
|
otherLocations: /* @__PURE__ */ new Map([
|
|
4232
4445
|
["cssSelector", e]
|
|
@@ -4251,7 +4464,7 @@ class js {
|
|
|
4251
4464
|
}
|
|
4252
4465
|
n = n.parentElement;
|
|
4253
4466
|
}
|
|
4254
|
-
const a =
|
|
4467
|
+
const a = De(e, {
|
|
4255
4468
|
root: this.doc
|
|
4256
4469
|
});
|
|
4257
4470
|
return r.forEach((o, h) => o.forEach((m) => h.attributes.setNamedItem(m))), this.recipeCssSelectorCache.set(e, a), a;
|
|
@@ -4259,14 +4472,14 @@ class js {
|
|
|
4259
4472
|
// Implements NodeTraversor
|
|
4260
4473
|
head(t, e) {
|
|
4261
4474
|
if (t.nodeType == Node.ELEMENT_NODE) {
|
|
4262
|
-
const i = !
|
|
4475
|
+
const i = !le(t);
|
|
4263
4476
|
i && (this.flushText(), this.breadcrumbs.push(t));
|
|
4264
4477
|
const r = t.nodeName.toUpperCase();
|
|
4265
4478
|
if (r === "BR")
|
|
4266
4479
|
this.flushText();
|
|
4267
4480
|
else if (r === "IMG" || r === "AUDIO" || r === "VIDEO")
|
|
4268
4481
|
if (this.flushText(), r === "IMG") {
|
|
4269
|
-
const n = t, a =
|
|
4482
|
+
const n = t, a = Et(n, this.baseLocator.href);
|
|
4270
4483
|
let o = n.getAttribute("alt");
|
|
4271
4484
|
o?.length || (o = n.getAttribute("title")), a != null && this.elementRecipes.push({
|
|
4272
4485
|
type: 1,
|
|
@@ -4275,31 +4488,31 @@ class js {
|
|
|
4275
4488
|
caption: void 0,
|
|
4276
4489
|
// FIXME: Get the caption from figcaption
|
|
4277
4490
|
cssSelectorNode: t,
|
|
4278
|
-
attributes: o?.length ? [new
|
|
4279
|
-
|
|
4491
|
+
attributes: o?.length ? [new oe(
|
|
4492
|
+
zt.ACCESSIBILITY_LABEL,
|
|
4280
4493
|
o
|
|
4281
4494
|
)] : []
|
|
4282
4495
|
}
|
|
4283
4496
|
});
|
|
4284
4497
|
} else {
|
|
4285
|
-
const n = t, a =
|
|
4498
|
+
const n = t, a = Et(n, this.baseLocator.href);
|
|
4286
4499
|
let o;
|
|
4287
4500
|
if (a != null)
|
|
4288
|
-
o = new
|
|
4501
|
+
o = new M({
|
|
4289
4502
|
href: a
|
|
4290
4503
|
});
|
|
4291
4504
|
else {
|
|
4292
4505
|
const h = [...n.getElementsByTagName("source")].map((m) => {
|
|
4293
|
-
const p =
|
|
4294
|
-
return p ? new
|
|
4506
|
+
const p = Et(m, this.baseLocator.href);
|
|
4507
|
+
return p ? new M({
|
|
4295
4508
|
href: p,
|
|
4296
4509
|
type: m.getAttribute("type") || void 0
|
|
4297
4510
|
}) : null;
|
|
4298
4511
|
}).filter((m) => !!m);
|
|
4299
|
-
h.length > 0 && (o = new
|
|
4512
|
+
h.length > 0 && (o = new M({
|
|
4300
4513
|
href: h[0].href,
|
|
4301
4514
|
type: h[0].type,
|
|
4302
|
-
alternates: h.length > 1 ? new
|
|
4515
|
+
alternates: h.length > 1 ? new C(h.slice(1)) : void 0
|
|
4303
4516
|
}));
|
|
4304
4517
|
}
|
|
4305
4518
|
o && (r === "AUDIO" ? this.elementRecipes.push({
|
|
@@ -4321,24 +4534,24 @@ class js {
|
|
|
4321
4534
|
}
|
|
4322
4535
|
// Implements NodeTraversor
|
|
4323
4536
|
tail(t, e) {
|
|
4324
|
-
if (t.nodeType === Node.TEXT_NODE && !
|
|
4325
|
-
const i =
|
|
4326
|
-
this.currentLanguage !== i && (this.flushSegment(), this.currentLanguage = i), this.rawTextAcc += t.textContent, this.textAcc =
|
|
4327
|
-
} else if (t.nodeType === Node.ELEMENT_NODE && !
|
|
4537
|
+
if (t.nodeType === Node.TEXT_NODE && !ct(t.textContent)) {
|
|
4538
|
+
const i = Ji(t.parentElement);
|
|
4539
|
+
this.currentLanguage !== i && (this.flushSegment(), this.currentLanguage = i), this.rawTextAcc += t.textContent, this.textAcc = qi(this.textAcc, t.textContent);
|
|
4540
|
+
} else if (t.nodeType === Node.ELEMENT_NODE && !le(t)) {
|
|
4328
4541
|
if (!this.breadcrumbs.length || this.breadcrumbs.at(-1) !== t) throw new Error("HTMLContentIterator: breadcrumbs mismatch");
|
|
4329
4542
|
this.flushText(), this.breadcrumbs.pop();
|
|
4330
4543
|
}
|
|
4331
4544
|
}
|
|
4332
4545
|
flushText() {
|
|
4333
4546
|
if (this.flushSegment(), this.startIndex === 0 && this.startElement && this.breadcrumbs.length && this.breadcrumbs.at(-1) === this.startElement && (this.startIndex = this.elementRecipes.length), !this.segmentRecipesAcc.length) return;
|
|
4334
|
-
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text =
|
|
4547
|
+
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text = Zi(
|
|
4335
4548
|
this.segmentRecipesAcc[this.segmentRecipesAcc.length - 1].text
|
|
4336
4549
|
);
|
|
4337
|
-
let t =
|
|
4550
|
+
let t = Hi;
|
|
4338
4551
|
if (this.breadcrumbs.length > 0) {
|
|
4339
4552
|
const e = this.breadcrumbs.at(-1);
|
|
4340
4553
|
if (e.getAttributeNS("http://www.idpf.org/2007/ops", "type") === "footnote")
|
|
4341
|
-
t =
|
|
4554
|
+
t = Fi;
|
|
4342
4555
|
else
|
|
4343
4556
|
switch (e.nodeName.toUpperCase()) {
|
|
4344
4557
|
case "H1":
|
|
@@ -4347,11 +4560,11 @@ class js {
|
|
|
4347
4560
|
case "H4":
|
|
4348
4561
|
case "H5":
|
|
4349
4562
|
case "H6":
|
|
4350
|
-
t = new
|
|
4563
|
+
t = new Wi(parseInt(e.nodeName[1]));
|
|
4351
4564
|
break;
|
|
4352
4565
|
case "BLOCKQUOTE":
|
|
4353
4566
|
case "Q":
|
|
4354
|
-
t = new
|
|
4567
|
+
t = new _i(
|
|
4355
4568
|
e.getAttribute("cite")?.length ? new URL(e.getAttribute("cite")) : void 0,
|
|
4356
4569
|
e.getAttribute("title") || void 0
|
|
4357
4570
|
);
|
|
@@ -4370,17 +4583,17 @@ class js {
|
|
|
4370
4583
|
}
|
|
4371
4584
|
flushSegment() {
|
|
4372
4585
|
let t = this.textAcc;
|
|
4373
|
-
const e =
|
|
4374
|
-
if (!
|
|
4586
|
+
const e = ye(t);
|
|
4587
|
+
if (!ct(e)) {
|
|
4375
4588
|
if (!this.segmentRecipesAcc.length) {
|
|
4376
|
-
t =
|
|
4377
|
-
const i = t.length &&
|
|
4589
|
+
t = Ki(t);
|
|
4590
|
+
const i = t.length && ct(t[t.length - 1]) ? t[t.length - 1] : "";
|
|
4378
4591
|
t = e + i;
|
|
4379
4592
|
}
|
|
4380
4593
|
this.segmentRecipesAcc.push({
|
|
4381
4594
|
text: t,
|
|
4382
|
-
attributes: this.currentLanguage ? [new
|
|
4383
|
-
|
|
4595
|
+
attributes: this.currentLanguage ? [new oe(
|
|
4596
|
+
zt.LANGUAGE,
|
|
4384
4597
|
this.currentLanguage
|
|
4385
4598
|
)] : [],
|
|
4386
4599
|
beforeRange: this.wholeRawTextAcc ? [this.wholeRawTextAcc.length - this.beforeMaxLength, this.wholeRawTextAcc.length] : [0, 0],
|
|
@@ -4390,7 +4603,7 @@ class js {
|
|
|
4390
4603
|
this.rawTextAcc.length && (this.wholeRawTextAcc = (this.wholeRawTextAcc || "") + this.rawTextAcc, this.elementRawTextAcc += this.rawTextAcc), this.rawTextAcc = "", this.textAcc = "";
|
|
4391
4604
|
}
|
|
4392
4605
|
}
|
|
4393
|
-
class
|
|
4606
|
+
class At {
|
|
4394
4607
|
/**
|
|
4395
4608
|
* Creates a [LocatorMetadata].
|
|
4396
4609
|
*/
|
|
@@ -4405,9 +4618,9 @@ class vt {
|
|
|
4405
4618
|
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(["title", "numberOfItems"]);
|
|
4406
4619
|
return Object.entries(t).forEach(([r, n]) => {
|
|
4407
4620
|
i.has(r) || e.set(r, n);
|
|
4408
|
-
}), new
|
|
4409
|
-
title:
|
|
4410
|
-
numberOfItems:
|
|
4621
|
+
}), new At({
|
|
4622
|
+
title: B.deserialize(t.title),
|
|
4623
|
+
numberOfItems: Z(t.numberOfItems),
|
|
4411
4624
|
otherMetadata: e.size === 0 ? void 0 : e
|
|
4412
4625
|
});
|
|
4413
4626
|
}
|
|
@@ -4419,12 +4632,12 @@ class vt {
|
|
|
4419
4632
|
return this.title && (t.title = this.title.serialize()), this.numberOfItems !== void 0 && (t.numberOfItems = this.numberOfItems), this.otherMetadata && this.otherMetadata.forEach((e, i) => t[i] = e), t;
|
|
4420
4633
|
}
|
|
4421
4634
|
}
|
|
4422
|
-
class
|
|
4635
|
+
class Ue {
|
|
4423
4636
|
/**
|
|
4424
4637
|
* Creates a [LocatorCollection].
|
|
4425
4638
|
*/
|
|
4426
4639
|
constructor(t) {
|
|
4427
|
-
this.metadata = t.metadata ?? new
|
|
4640
|
+
this.metadata = t.metadata ?? new At({}), this.links = t.links ?? new C([]), this.locators = t.locators ?? [];
|
|
4428
4641
|
}
|
|
4429
4642
|
/**
|
|
4430
4643
|
* Parses a [LocatorCollection] from its RWPM JSON representation.
|
|
@@ -4432,9 +4645,9 @@ class De {
|
|
|
4432
4645
|
static deserialize(t) {
|
|
4433
4646
|
if (!t) return;
|
|
4434
4647
|
let e, i = t.locators;
|
|
4435
|
-
return i && Array.isArray(i) && (e = i.map((r) =>
|
|
4436
|
-
metadata:
|
|
4437
|
-
links:
|
|
4648
|
+
return i && Array.isArray(i) && (e = i.map((r) => D.deserialize(r)).filter((r) => r !== void 0)), new Ue({
|
|
4649
|
+
metadata: At.deserialize(t.metadata),
|
|
4650
|
+
links: C.deserialize(t.links),
|
|
4438
4651
|
locators: e
|
|
4439
4652
|
});
|
|
4440
4653
|
}
|
|
@@ -4450,7 +4663,7 @@ class De {
|
|
|
4450
4663
|
return this.links && this.links.items.length > 0 && (t.links = this.links.serialize()), this.locators && (t.locators = this.locators.map((e) => e.serialize())), t;
|
|
4451
4664
|
}
|
|
4452
4665
|
}
|
|
4453
|
-
class
|
|
4666
|
+
class H {
|
|
4454
4667
|
/**
|
|
4455
4668
|
* Creates a [PublicationCollection].
|
|
4456
4669
|
*/
|
|
@@ -4464,15 +4677,15 @@ class W {
|
|
|
4464
4677
|
if (!t) return;
|
|
4465
4678
|
let e, i, r;
|
|
4466
4679
|
if (Array.isArray(t))
|
|
4467
|
-
e =
|
|
4680
|
+
e = C.deserialize(t);
|
|
4468
4681
|
else if (typeof t == "object")
|
|
4469
|
-
e =
|
|
4682
|
+
e = C.deserialize(t.links), i = /* @__PURE__ */ new Map(), t.metadata && Object.entries(t.metadata).forEach(([n, a]) => {
|
|
4470
4683
|
i?.set(n, a);
|
|
4471
|
-
}), r =
|
|
4684
|
+
}), r = H.deserializeCollections(t);
|
|
4472
4685
|
else
|
|
4473
4686
|
return;
|
|
4474
4687
|
if (!(!e || e.items.length === 0))
|
|
4475
|
-
return new
|
|
4688
|
+
return new H({
|
|
4476
4689
|
metadata: i?.size ? i : void 0,
|
|
4477
4690
|
links: e,
|
|
4478
4691
|
subcollections: r?.size ? r : void 0
|
|
@@ -4487,13 +4700,13 @@ class W {
|
|
|
4487
4700
|
const e = /* @__PURE__ */ new Map();
|
|
4488
4701
|
return Object.entries(t).forEach(([i, r]) => {
|
|
4489
4702
|
if (i !== "links" && i !== "metadata") {
|
|
4490
|
-
const n =
|
|
4703
|
+
const n = H.deserialize(r);
|
|
4491
4704
|
if (n) {
|
|
4492
4705
|
const a = new Array();
|
|
4493
4706
|
a.push(n), e.set(i, a);
|
|
4494
4707
|
} else if (Array.isArray(r)) {
|
|
4495
4708
|
const a = r.map(
|
|
4496
|
-
(o) =>
|
|
4709
|
+
(o) => H.deserialize(o)
|
|
4497
4710
|
).filter((o) => o !== void 0);
|
|
4498
4711
|
e.set(i, a);
|
|
4499
4712
|
}
|
|
@@ -4507,7 +4720,7 @@ class W {
|
|
|
4507
4720
|
const t = {};
|
|
4508
4721
|
return this.metadata && (t.metadata = {}, this.metadata.forEach(
|
|
4509
4722
|
(e, i) => t.metadata[i] = e
|
|
4510
|
-
)), this.links.items.length && (t.links = this.links.serialize()),
|
|
4723
|
+
)), this.links.items.length && (t.links = this.links.serialize()), H.serializeCollection(t, this.subcollections), t;
|
|
4511
4724
|
}
|
|
4512
4725
|
static serializeCollection(t, e) {
|
|
4513
4726
|
e && e.size > 0 && e.forEach(
|
|
@@ -4517,7 +4730,7 @@ class W {
|
|
|
4517
4730
|
);
|
|
4518
4731
|
}
|
|
4519
4732
|
}
|
|
4520
|
-
class
|
|
4733
|
+
class Me {
|
|
4521
4734
|
constructor(t) {
|
|
4522
4735
|
this.context = t.context, this.metadata = t.metadata, this.links = t.links, this.readingOrder = t.readingOrder, this.resources = t.resources, this.toc = t.toc, this.subcollections = t.subcollections;
|
|
4523
4736
|
}
|
|
@@ -4529,22 +4742,22 @@ class Ue {
|
|
|
4529
4742
|
*/
|
|
4530
4743
|
static deserialize(t) {
|
|
4531
4744
|
if (!t) return;
|
|
4532
|
-
const e =
|
|
4745
|
+
const e = pt.deserialize(t.metadata);
|
|
4533
4746
|
if (!e) return;
|
|
4534
|
-
const i =
|
|
4747
|
+
const i = C.deserialize(t.links);
|
|
4535
4748
|
if (!i) return;
|
|
4536
|
-
const r =
|
|
4749
|
+
const r = C.deserialize(
|
|
4537
4750
|
t.readingOrder ? t.readingOrder : t.spine
|
|
4538
4751
|
);
|
|
4539
4752
|
if (r)
|
|
4540
|
-
return new
|
|
4541
|
-
context:
|
|
4753
|
+
return new Me({
|
|
4754
|
+
context: _(t["@context"]),
|
|
4542
4755
|
metadata: e,
|
|
4543
4756
|
links: i,
|
|
4544
4757
|
readingOrder: r,
|
|
4545
|
-
resources:
|
|
4546
|
-
toc:
|
|
4547
|
-
subcollections:
|
|
4758
|
+
resources: C.deserialize(t.resources),
|
|
4759
|
+
toc: C.deserialize(t.toc),
|
|
4760
|
+
subcollections: H.deserializeCollections({
|
|
4548
4761
|
sub: t.sub
|
|
4549
4762
|
})
|
|
4550
4763
|
});
|
|
@@ -4554,7 +4767,7 @@ class Ue {
|
|
|
4554
4767
|
*/
|
|
4555
4768
|
serialize() {
|
|
4556
4769
|
const t = {};
|
|
4557
|
-
return this.context !== void 0 && (t["@context"] = this.context), t.metadata = this.metadata.serialize(), t.links = this.links.serialize(), t.readingOrder = this.readingOrder.serialize(), this.resources && (t.resources = this.resources.serialize()), this.toc && (t.toc = this.toc.serialize()),
|
|
4770
|
+
return this.context !== void 0 && (t["@context"] = this.context), t.metadata = this.metadata.serialize(), t.links = this.links.serialize(), t.readingOrder = this.readingOrder.serialize(), this.resources && (t.resources = this.resources.serialize()), this.toc && (t.toc = this.toc.serialize()), H.serializeCollection(t, this.subcollections), t;
|
|
4558
4771
|
}
|
|
4559
4772
|
/** Finds the first link with the given relation in the manifest's links. */
|
|
4560
4773
|
linkWithRel(t) {
|
|
@@ -4581,7 +4794,7 @@ class Ue {
|
|
|
4581
4794
|
const n = r.type;
|
|
4582
4795
|
if (!n) return;
|
|
4583
4796
|
const a = e.length == 2 ? e[1] : void 0;
|
|
4584
|
-
return new
|
|
4797
|
+
return new D({
|
|
4585
4798
|
href: i,
|
|
4586
4799
|
type: n,
|
|
4587
4800
|
title: r.title ?? t.title,
|
|
@@ -4638,7 +4851,7 @@ class Ue {
|
|
|
4638
4851
|
this.links.items = this.links.items.filter(
|
|
4639
4852
|
(e) => e.rels === void 0 || !e.rels?.has("self")
|
|
4640
4853
|
), this.links.items.push(
|
|
4641
|
-
new
|
|
4854
|
+
new M({
|
|
4642
4855
|
href: t,
|
|
4643
4856
|
type: c.READIUM_WEBPUB_MANIFEST.string,
|
|
4644
4857
|
rels: /* @__PURE__ */ new Set(["self"])
|
|
@@ -4647,106 +4860,107 @@ class Ue {
|
|
|
4647
4860
|
}
|
|
4648
4861
|
}
|
|
4649
4862
|
export {
|
|
4650
|
-
|
|
4863
|
+
k as AccessMode,
|
|
4651
4864
|
V as Accessibility,
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4865
|
+
rr as AccessibilityMetadataDisplayGuide,
|
|
4866
|
+
It as AccessibilityProfile,
|
|
4867
|
+
Ft as AccessibilitySummary,
|
|
4868
|
+
tt as Acquisition,
|
|
4869
|
+
Bt as AdditionalInformation,
|
|
4870
|
+
J as AltIdentifier,
|
|
4871
|
+
oe as Attribute,
|
|
4872
|
+
zt as AttributeKeys,
|
|
4873
|
+
me as AttributesHolder,
|
|
4874
|
+
Mi as AudioElement,
|
|
4875
|
+
Qt as Availability,
|
|
4876
|
+
Ui as AvailabilityStatus,
|
|
4877
|
+
Q as BelongsTo,
|
|
4878
|
+
Hi as Body,
|
|
4666
4879
|
Pt as Certification,
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4880
|
+
Wt as Conformance,
|
|
4881
|
+
ar as Content,
|
|
4882
|
+
ge as ContentElement,
|
|
4883
|
+
dt as Contributor,
|
|
4884
|
+
O as Contributors,
|
|
4885
|
+
qt as Copies,
|
|
4673
4886
|
Ri as DefaultTextContentTokenizer,
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4887
|
+
Kt as DomRange,
|
|
4888
|
+
gt as DomRangePoint,
|
|
4889
|
+
ei as EmptyFetcher,
|
|
4890
|
+
_t as Encryption,
|
|
4891
|
+
Nt as Exemption,
|
|
4679
4892
|
v as Feature,
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4893
|
+
Fi as Footnote,
|
|
4894
|
+
Xt as GuidedNavigationDocument,
|
|
4895
|
+
K as GuidedNavigationObject,
|
|
4896
|
+
mt as GuidedNavigationText,
|
|
4897
|
+
ur as HTMLResourceContentIterator,
|
|
4685
4898
|
P as Hazard,
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4899
|
+
li as HazardType,
|
|
4900
|
+
Gt as Hazards,
|
|
4901
|
+
Wi as Heading,
|
|
4902
|
+
Jt as Holds,
|
|
4903
|
+
er as HttpFetcher,
|
|
4904
|
+
ii as HttpResource,
|
|
4905
|
+
it as IllegalStateError,
|
|
4906
|
+
Gi as ImageElement,
|
|
4907
|
+
ki as IntlTextTokenizer,
|
|
4908
|
+
jt as Iterator,
|
|
4909
|
+
X as Layout,
|
|
4910
|
+
Ht as Legal,
|
|
4911
|
+
M as Link,
|
|
4912
|
+
C as Links,
|
|
4700
4913
|
f as Localization,
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4914
|
+
B as LocalizedString,
|
|
4915
|
+
D as Locator,
|
|
4916
|
+
Ue as LocatorCollection,
|
|
4917
|
+
At as LocatorCollectionMetadata,
|
|
4705
4918
|
T as LocatorLocations,
|
|
4706
|
-
|
|
4707
|
-
|
|
4919
|
+
nt as LocatorText,
|
|
4920
|
+
Me as Manifest,
|
|
4708
4921
|
Vt as MediaOverlay,
|
|
4709
4922
|
c as MediaType,
|
|
4710
|
-
|
|
4923
|
+
pt as Metadata,
|
|
4711
4924
|
Pi as NaiveTextTokenizer,
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4925
|
+
Ut as Navigation,
|
|
4926
|
+
ai as NonvisualReading,
|
|
4927
|
+
ir as NumberRange,
|
|
4928
|
+
St as PDFContentElement,
|
|
4929
|
+
Lt as Page,
|
|
4930
|
+
hr as PageContentIteratorPDF,
|
|
4931
|
+
oi as PrerecordedAudio,
|
|
4932
|
+
Zt as Price,
|
|
4933
|
+
xt as PrimaryAccessMode,
|
|
4934
|
+
q as Profile,
|
|
4935
|
+
U as Properties,
|
|
4936
|
+
Y as Publication,
|
|
4937
|
+
H as PublicationCollection,
|
|
4938
|
+
lr as PublicationContentIterator,
|
|
4939
|
+
F as ReadingProgression,
|
|
4940
|
+
sr as Resource,
|
|
4941
|
+
Mt as RichContent,
|
|
4942
|
+
ci as RichContentType,
|
|
4943
|
+
ft as Subject,
|
|
4944
|
+
Yt as Subjects,
|
|
4945
|
+
$t as TDM,
|
|
4946
|
+
ui as TDMReservation,
|
|
4947
|
+
or as TextContentTokenizer,
|
|
4948
|
+
Ct as TextElement,
|
|
4949
|
+
_i as TextQuote,
|
|
4950
|
+
be as TextSegment,
|
|
4951
|
+
Ci as TextUnit,
|
|
4952
|
+
yt as TextualElement,
|
|
4953
|
+
I as Timeline,
|
|
4954
|
+
ut as URITemplate,
|
|
4955
|
+
Bi as VideoElement,
|
|
4956
|
+
ni as VisualAdjustments,
|
|
4957
|
+
Dt as WaysOfReading,
|
|
4958
|
+
hi as arrayfromJSON,
|
|
4959
|
+
_ as arrayfromJSONorString,
|
|
4960
|
+
lt as datefromJSON,
|
|
4961
|
+
nr as leadingPage,
|
|
4962
|
+
Z as numberfromJSON,
|
|
4963
|
+
z as positiveNumberfromJSON,
|
|
4964
|
+
ht as setToArray,
|
|
4965
|
+
pe as speakableToken
|
|
4752
4966
|
};
|