@readium/navigator 2.5.2-beta.2 → 2.5.2-beta.4
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 +317 -276
- package/dist/index.umd.cjs +30 -30
- package/package.json +1 -1
- package/src/epub/frame/FrameManager.ts +13 -2
- package/src/peripherals/KeyboardConditionBridge.ts +47 -0
- package/src/webpub/WebPubFrameManager.ts +13 -2
- package/types/src/epub/frame/FrameManager.d.ts +1 -0
- package/types/src/peripherals/KeyboardConditionBridge.d.ts +11 -0
- package/types/src/webpub/WebPubFrameManager.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -152,8 +152,8 @@ const k = class k {
|
|
|
152
152
|
};
|
|
153
153
|
k.NONE = new k("none"), k.DOCUMENTED = new k("documented"), k.LEGAL = new k("legal"), k.TEMPORARY = new k("temporary"), k.TECHNICAL = new k("technical"), k.EAA_DISPROPORTIONATE_BURDEN = new k("eaa-disproportionate-burden"), k.EAA_FUNDAMENTAL_ALTERATION = new k("eaa-fundamental-alteration"), k.EAA_MICROENTERPRISE = new k("eaa-microenterprise"), k.EAA_TECHNICAL_IMPOSSIBILITY = new k("eaa-technical-impossibility"), k.EAA_TEMPORARY = new k("eaa-temporary");
|
|
154
154
|
let ii = k;
|
|
155
|
-
const ni = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], xn = /* @__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"}}`), kn = {
|
|
156
|
-
publication:
|
|
155
|
+
const ni = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], kn = /* @__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"}}`), On = {
|
|
156
|
+
publication: kn
|
|
157
157
|
}, si = {
|
|
158
158
|
fr: () => import("./fr-C5HEel98.js"),
|
|
159
159
|
ar: () => import("./ar-DyHX_uy2.js"),
|
|
@@ -165,7 +165,7 @@ const ni = ["en", "ar", "da", "fr", "it", "pt_PT", "sv"], xn = /* @__PURE__ */ J
|
|
|
165
165
|
sv: () => import("./sv-BfzAFsVN.js")
|
|
166
166
|
// 'tr': () => import('@edrlab/thorium-locales/publication-metadata/tr.json'),
|
|
167
167
|
// 'uk': () => import('@edrlab/thorium-locales/publication-metadata/uk.json')
|
|
168
|
-
}, ri =
|
|
168
|
+
}, ri = On?.publication?.metadata?.accessibility?.["display-guide"] || {};
|
|
169
169
|
class gt {
|
|
170
170
|
constructor() {
|
|
171
171
|
this.currentLocaleCode = "en", this.locale = ri, this.loadedLocales = {}, this.loadedLocales.en = ri;
|
|
@@ -308,11 +308,11 @@ Object.defineProperty(G.prototype, "encryption", {
|
|
|
308
308
|
return ze.deserialize(this.otherProperties.encrypted);
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
|
-
function
|
|
311
|
+
function Rn(r) {
|
|
312
312
|
return r && Array.isArray(r) ? r : void 0;
|
|
313
313
|
}
|
|
314
314
|
function Gi(r) {
|
|
315
|
-
return r && typeof r == "string" ? [r] :
|
|
315
|
+
return r && typeof r == "string" ? [r] : Rn(r);
|
|
316
316
|
}
|
|
317
317
|
function oi(r) {
|
|
318
318
|
return typeof r == "string" ? new Date(r) : void 0;
|
|
@@ -323,7 +323,7 @@ function Ut(r) {
|
|
|
323
323
|
function V(r) {
|
|
324
324
|
return Ut(r) !== void 0 && Math.sign(r) >= 0 ? r : void 0;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function An(r) {
|
|
327
327
|
const t = new Array();
|
|
328
328
|
return r.forEach((e) => t.push(e)), t;
|
|
329
329
|
}
|
|
@@ -951,7 +951,7 @@ class $ {
|
|
|
951
951
|
*/
|
|
952
952
|
serialize() {
|
|
953
953
|
const t = { href: this.href };
|
|
954
|
-
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 =
|
|
954
|
+
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 = An(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;
|
|
955
955
|
}
|
|
956
956
|
/** MediaType of the linked resource. */
|
|
957
957
|
get mediaType() {
|
|
@@ -1343,19 +1343,19 @@ G.prototype.getAvailability = function() {
|
|
|
1343
1343
|
G.prototype.getAuthenticate = function() {
|
|
1344
1344
|
return $.deserialize(this.otherProperties.authenticate);
|
|
1345
1345
|
};
|
|
1346
|
-
const
|
|
1346
|
+
const Tn = "CssSelectorGenerator";
|
|
1347
1347
|
function li(r = "unknown problem", ...t) {
|
|
1348
|
-
console.warn(`${
|
|
1348
|
+
console.warn(`${Tn}: ${r}`, ...t);
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function Mn(r) {
|
|
1351
1351
|
return r instanceof RegExp;
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function Nn(r) {
|
|
1354
1354
|
return r.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1356
|
+
function zn(r) {
|
|
1357
1357
|
const t = r.map((e) => {
|
|
1358
|
-
if (
|
|
1358
|
+
if (Mn(e))
|
|
1359
1359
|
return (i) => e.test(i);
|
|
1360
1360
|
if (typeof e == "function")
|
|
1361
1361
|
return (i) => {
|
|
@@ -1363,21 +1363,21 @@ function Nn(r) {
|
|
|
1363
1363
|
return typeof n != "boolean" ? (li("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
|
|
1364
1364
|
};
|
|
1365
1365
|
if (typeof e == "string") {
|
|
1366
|
-
const i = new RegExp("^" +
|
|
1366
|
+
const i = new RegExp("^" + Nn(e) + "$");
|
|
1367
1367
|
return (n) => i.test(n);
|
|
1368
1368
|
}
|
|
1369
1369
|
return li("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
1370
1370
|
});
|
|
1371
1371
|
return (e) => t.some((i) => i(e));
|
|
1372
1372
|
}
|
|
1373
|
-
|
|
1373
|
+
zn([
|
|
1374
1374
|
"class",
|
|
1375
1375
|
"id",
|
|
1376
1376
|
// Angular attributes
|
|
1377
1377
|
"ng-*"
|
|
1378
1378
|
]);
|
|
1379
|
-
const
|
|
1380
|
-
class
|
|
1379
|
+
const In = Math.pow(2, 32), hi = () => Math.round(Math.random() * In).toString(36), we = () => `${Math.round(performance.now())}-${hi()}-${hi()}`, ft = 1;
|
|
1380
|
+
class Dn {
|
|
1381
1381
|
constructor(t) {
|
|
1382
1382
|
this.destination = null, this.registrar = /* @__PURE__ */ new Map(), this.origin = "", this.channelId = "", this.receiver = this.receive.bind(this), this.preLog = [], this.wnd = t, t.addEventListener("message", this.receiver);
|
|
1383
1383
|
}
|
|
@@ -1472,7 +1472,7 @@ class Et {
|
|
|
1472
1472
|
function ci(r) {
|
|
1473
1473
|
return r.split("").reverse().join("");
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function Fn(r, t, e) {
|
|
1476
1476
|
const i = ci(t);
|
|
1477
1477
|
return e.map((n) => {
|
|
1478
1478
|
const s = Math.max(0, n.end - t.length - n.errors), o = ci(r.slice(s, n.end));
|
|
@@ -1556,9 +1556,9 @@ function qi(r, t, e) {
|
|
|
1556
1556
|
}
|
|
1557
1557
|
return i;
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function Wn(r, t, e) {
|
|
1560
1560
|
const i = qi(r, t, e);
|
|
1561
|
-
return
|
|
1561
|
+
return Fn(r, t, i);
|
|
1562
1562
|
}
|
|
1563
1563
|
function Ki(r, t, e) {
|
|
1564
1564
|
let i = 0;
|
|
@@ -1569,12 +1569,12 @@ function Ki(r, t, e) {
|
|
|
1569
1569
|
end: i + t.length,
|
|
1570
1570
|
errors: 0
|
|
1571
1571
|
}), i += 1);
|
|
1572
|
-
return n.length > 0 ? n :
|
|
1572
|
+
return n.length > 0 ? n : Wn(r, t, e);
|
|
1573
1573
|
}
|
|
1574
1574
|
function ui(r, t) {
|
|
1575
1575
|
return t.length === 0 || r.length === 0 ? 0 : 1 - Ki(r, t, t.length)[0].errors / t.length;
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function Un(r, t, e = {}) {
|
|
1578
1578
|
if (t.length === 0)
|
|
1579
1579
|
return null;
|
|
1580
1580
|
const i = Math.min(256, t.length / 2), n = Ki(r, t, i);
|
|
@@ -1632,7 +1632,7 @@ function pi(r, t) {
|
|
|
1632
1632
|
return { node: s, offset: o };
|
|
1633
1633
|
throw new RangeError("No text nodes with non-whitespace text found in range");
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Bn(r) {
|
|
1636
1636
|
if (!r.toString().trim().length)
|
|
1637
1637
|
throw new RangeError("Range contains no non-whitespace text");
|
|
1638
1638
|
if (r.startContainer.nodeType !== Node.TEXT_NODE)
|
|
@@ -1868,7 +1868,7 @@ class et {
|
|
|
1868
1868
|
* whitespace
|
|
1869
1869
|
*/
|
|
1870
1870
|
static trimmedRange(t) {
|
|
1871
|
-
return
|
|
1871
|
+
return Bn(et.fromRange(t).toRange());
|
|
1872
1872
|
}
|
|
1873
1873
|
}
|
|
1874
1874
|
class jt {
|
|
@@ -1932,7 +1932,7 @@ class $t {
|
|
|
1932
1932
|
return this.toPositionAnchor(t).toRange();
|
|
1933
1933
|
}
|
|
1934
1934
|
toPositionAnchor(t = {}) {
|
|
1935
|
-
const e = this.root.textContent, i =
|
|
1935
|
+
const e = this.root.textContent, i = Un(e, this.exact, {
|
|
1936
1936
|
...this.context,
|
|
1937
1937
|
hint: t.hint
|
|
1938
1938
|
});
|
|
@@ -1941,7 +1941,7 @@ class $t {
|
|
|
1941
1941
|
return new jt(this.root, i.start, i.end);
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
1944
|
-
function
|
|
1944
|
+
function Hn(r) {
|
|
1945
1945
|
const t = r.tagName.toUpperCase();
|
|
1946
1946
|
return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
|
|
1947
1947
|
}
|
|
@@ -1970,7 +1970,7 @@ function It(r, t) {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
if (n) {
|
|
1972
1972
|
const s = r.createRange();
|
|
1973
|
-
return n.childNodes.length === 0 ||
|
|
1973
|
+
return n.childNodes.length === 0 || Hn(n) ? (s.selectNode(n), s) : (s.setStartBefore(n), s.setEndAfter(n), s);
|
|
1974
1974
|
}
|
|
1975
1975
|
}
|
|
1976
1976
|
} catch (e) {
|
|
@@ -1978,7 +1978,7 @@ function It(r, t) {
|
|
|
1978
1978
|
}
|
|
1979
1979
|
return null;
|
|
1980
1980
|
}
|
|
1981
|
-
function
|
|
1981
|
+
function Vn(r, t) {
|
|
1982
1982
|
let e = r.getClientRects();
|
|
1983
1983
|
e.length || r.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = r.commonAncestorContainer.getClientRects());
|
|
1984
1984
|
const i = 1, n = [];
|
|
@@ -1994,7 +1994,7 @@ function Hn(r, t) {
|
|
|
1994
1994
|
const s = Qi(
|
|
1995
1995
|
n,
|
|
1996
1996
|
i
|
|
1997
|
-
), o =
|
|
1997
|
+
), o = $n(s, i), a = tn(o), l = 4;
|
|
1998
1998
|
for (let h = a.length - 1; h >= 0; h--) {
|
|
1999
1999
|
const c = a[h];
|
|
2000
2000
|
if (!(c.width * c.height > l))
|
|
@@ -2013,7 +2013,7 @@ function Qi(r, t, e) {
|
|
|
2013
2013
|
continue;
|
|
2014
2014
|
const a = j(s.top, o.top, t) && j(s.bottom, o.bottom, t), l = j(s.left, o.left, t) && j(s.right, o.right, t);
|
|
2015
2015
|
if (a && !l && en(s, o, t)) {
|
|
2016
|
-
const u = r.filter((g) => g !== s && g !== o), p =
|
|
2016
|
+
const u = r.filter((g) => g !== s && g !== o), p = jn(s, o);
|
|
2017
2017
|
return u.push(p), Qi(
|
|
2018
2018
|
u,
|
|
2019
2019
|
t
|
|
@@ -2022,7 +2022,7 @@ function Qi(r, t, e) {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
return r;
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2025
|
+
function jn(r, t) {
|
|
2026
2026
|
const e = Math.min(r.left, t.left), i = Math.max(r.right, t.right), n = Math.min(r.top, t.top), s = Math.max(r.bottom, t.bottom);
|
|
2027
2027
|
return {
|
|
2028
2028
|
bottom: s,
|
|
@@ -2033,7 +2033,7 @@ function Vn(r, t) {
|
|
|
2033
2033
|
width: i - e
|
|
2034
2034
|
};
|
|
2035
2035
|
}
|
|
2036
|
-
function
|
|
2036
|
+
function $n(r, t) {
|
|
2037
2037
|
const e = new Set(r);
|
|
2038
2038
|
for (const i of r) {
|
|
2039
2039
|
if (!(i.width > 1 && i.height > 1)) {
|
|
@@ -2041,14 +2041,14 @@ function jn(r, t) {
|
|
|
2041
2041
|
continue;
|
|
2042
2042
|
}
|
|
2043
2043
|
for (const s of r)
|
|
2044
|
-
if (i !== s && e.has(s) &&
|
|
2044
|
+
if (i !== s && e.has(s) && Xn(s, i, t)) {
|
|
2045
2045
|
e.delete(i);
|
|
2046
2046
|
break;
|
|
2047
2047
|
}
|
|
2048
2048
|
}
|
|
2049
2049
|
return Array.from(e);
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2051
|
+
function Xn(r, t, e) {
|
|
2052
2052
|
return Dt(r, t.left, t.top, e) && Dt(r, t.right, t.top, e) && Dt(r, t.left, t.bottom, e) && Dt(r, t.right, t.bottom, e);
|
|
2053
2053
|
}
|
|
2054
2054
|
function Dt(r, t, e, i) {
|
|
@@ -2074,7 +2074,7 @@ function tn(r) {
|
|
|
2074
2074
|
return r;
|
|
2075
2075
|
}
|
|
2076
2076
|
function mi(r, t) {
|
|
2077
|
-
const e =
|
|
2077
|
+
const e = Gn(t, r);
|
|
2078
2078
|
if (e.height === 0 || e.width === 0)
|
|
2079
2079
|
return [r];
|
|
2080
2080
|
const i = [];
|
|
@@ -2124,7 +2124,7 @@ function mi(r, t) {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
return i;
|
|
2126
2126
|
}
|
|
2127
|
-
function
|
|
2127
|
+
function Gn(r, t) {
|
|
2128
2128
|
const e = Math.max(r.left, t.left), i = Math.min(r.right, t.right), n = Math.max(r.top, t.top), s = Math.min(r.bottom, t.bottom);
|
|
2129
2129
|
return {
|
|
2130
2130
|
bottom: s,
|
|
@@ -2165,7 +2165,7 @@ function re(r, t) {
|
|
|
2165
2165
|
r.document.documentElement.style.removeProperty(t);
|
|
2166
2166
|
}
|
|
2167
2167
|
let Ft = null, pe = null, _t = 0;
|
|
2168
|
-
const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(),
|
|
2168
|
+
const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Yn = () => {
|
|
2169
2169
|
if (!Ft)
|
|
2170
2170
|
if (typeof OffscreenCanvas < "u")
|
|
2171
2171
|
Ft = new OffscreenCanvas(5, 5), pe = Ft.getContext("2d", {
|
|
@@ -2180,7 +2180,7 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Gn
|
|
|
2180
2180
|
});
|
|
2181
2181
|
}
|
|
2182
2182
|
return pe;
|
|
2183
|
-
},
|
|
2183
|
+
}, qn = (r) => {
|
|
2184
2184
|
if (!r) return !0;
|
|
2185
2185
|
const t = r.trim().toLowerCase();
|
|
2186
2186
|
return t.startsWith("var(") || [
|
|
@@ -2207,9 +2207,9 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Gn
|
|
|
2207
2207
|
const e = t ? `${r}|${t}` : r, i = ct.get(e);
|
|
2208
2208
|
if (i !== void 0)
|
|
2209
2209
|
return i ?? mt;
|
|
2210
|
-
if (
|
|
2210
|
+
if (qn(r))
|
|
2211
2211
|
return Wt(r, "Unsupported color format or special value."), ct.set(e, null), mt;
|
|
2212
|
-
const n =
|
|
2212
|
+
const n = Yn();
|
|
2213
2213
|
if (!n)
|
|
2214
2214
|
return Wt(r, "Could not get canvas context."), ct.set(e, null), mt;
|
|
2215
2215
|
try {
|
|
@@ -2238,15 +2238,15 @@ const mt = { r: 255, g: 255, b: 255, a: 1 }, ct = /* @__PURE__ */ new Map(), Gn
|
|
|
2238
2238
|
}, Pe = (r, t = null) => {
|
|
2239
2239
|
const e = Se(r, t), i = yi(e, { r: 255, g: 255, b: 255, a: 1 }), n = yi(e, { r: 0, g: 0, b: 0, a: 1 });
|
|
2240
2240
|
return i > n;
|
|
2241
|
-
},
|
|
2242
|
-
class
|
|
2241
|
+
}, Kn = (r, t = null) => Pe(r, t) ? "white" : "black", bi = "#FFFF00", Jn = () => "Highlight" in window, wi = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
2242
|
+
class Zn {
|
|
2243
2243
|
/**
|
|
2244
2244
|
* Creates a DecorationGroup object
|
|
2245
2245
|
* @param id Unique HTML ID-adhering name of the group
|
|
2246
2246
|
* @param name Human-readable name of the group
|
|
2247
2247
|
*/
|
|
2248
2248
|
constructor(t, e, i, n) {
|
|
2249
|
-
this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0,
|
|
2249
|
+
this.wnd = t, this.comms = e, this.id = i, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Jn() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
|
|
2250
2250
|
}
|
|
2251
2251
|
get activeable() {
|
|
2252
2252
|
return this.activateable;
|
|
@@ -2309,7 +2309,7 @@ class Jn {
|
|
|
2309
2309
|
const n = ue(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color"), s = t.decoration?.style?.tint ?? bi;
|
|
2310
2310
|
e.innerHTML = `
|
|
2311
2311
|
::highlight(${this.id}) {
|
|
2312
|
-
color: ${
|
|
2312
|
+
color: ${Kn(s, n)};
|
|
2313
2313
|
background-color: ${s};
|
|
2314
2314
|
}`;
|
|
2315
2315
|
}
|
|
@@ -2361,7 +2361,7 @@ class Jn {
|
|
|
2361
2361
|
const d = g.cloneNode(!0);
|
|
2362
2362
|
d.style.setProperty("pointer-events", "none"), h(d, c, c), e.append(d);
|
|
2363
2363
|
} else {
|
|
2364
|
-
let d =
|
|
2364
|
+
let d = Vn(
|
|
2365
2365
|
t.range
|
|
2366
2366
|
);
|
|
2367
2367
|
d = d.sort((f, w) => f.top < w.top ? -1 : f.top > w.top ? 1 : 0);
|
|
@@ -2430,7 +2430,7 @@ const Ot = class Ot extends Et {
|
|
|
2430
2430
|
mount(t, e) {
|
|
2431
2431
|
return this.wnd = t, e.register("decorate", Ot.moduleName, (i, n) => {
|
|
2432
2432
|
const s = i;
|
|
2433
|
-
s.decoration && s.decoration.locator && (s.decoration.locator = I.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new
|
|
2433
|
+
s.decoration && s.decoration.locator && (s.decoration.locator = I.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new Zn(
|
|
2434
2434
|
t,
|
|
2435
2435
|
e,
|
|
2436
2436
|
`readium-decoration-${this.lastGroupId++}`,
|
|
@@ -2498,10 +2498,10 @@ const vi = "readium-snapper-style", Rt = class Rt extends Et {
|
|
|
2498
2498
|
};
|
|
2499
2499
|
Rt.moduleName = "snapper";
|
|
2500
2500
|
let St = Rt;
|
|
2501
|
-
function
|
|
2501
|
+
function Qn(r) {
|
|
2502
2502
|
return (r.document.documentElement.dir || r.document.body.dir).toLowerCase() === "rtl";
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2504
|
+
function ts(r) {
|
|
2505
2505
|
return (r.getComputedStyle(r.document.documentElement).writingMode || r.getComputedStyle(r.document.body).writingMode) === "vertical-lr";
|
|
2506
2506
|
}
|
|
2507
2507
|
function sn(r) {
|
|
@@ -2534,14 +2534,14 @@ function He(r) {
|
|
|
2534
2534
|
const t = r.document.createElement("style");
|
|
2535
2535
|
t.appendChild(r.document.createTextNode("*{}")), r.document.body.appendChild(t), r.document.body.removeChild(t);
|
|
2536
2536
|
}
|
|
2537
|
-
function
|
|
2537
|
+
function es(r) {
|
|
2538
2538
|
return r < 0.5 ? 2 * r * r : -1 + (4 - 2 * r) * r;
|
|
2539
2539
|
}
|
|
2540
2540
|
function O(r) {
|
|
2541
2541
|
const t = r.getSelection();
|
|
2542
2542
|
t && t.removeAllRanges();
|
|
2543
2543
|
}
|
|
2544
|
-
const
|
|
2544
|
+
const is = [
|
|
2545
2545
|
"a",
|
|
2546
2546
|
"area",
|
|
2547
2547
|
"audio",
|
|
@@ -2555,15 +2555,15 @@ const es = [
|
|
|
2555
2555
|
"submit",
|
|
2556
2556
|
"textarea",
|
|
2557
2557
|
"video"
|
|
2558
|
-
],
|
|
2558
|
+
], ns = ["dialog", "radiogroup", "radio", "menu", "menuitem"];
|
|
2559
2559
|
function Ve(r) {
|
|
2560
|
-
return
|
|
2560
|
+
return ss(r) ? null : rn(r) ? r : r.parentElement ? Ve(r.parentElement) : null;
|
|
2561
2561
|
}
|
|
2562
|
-
function
|
|
2562
|
+
function ss(r) {
|
|
2563
2563
|
return r ? r.closest("[inert]") !== null || r.hasAttribute("disabled") : !0;
|
|
2564
2564
|
}
|
|
2565
2565
|
function rn(r) {
|
|
2566
|
-
return r ? r.role &&
|
|
2566
|
+
return r ? r.role && ns.includes(r.role) || r.tabIndex >= 0 ? !0 : is.includes(r.nodeName.toLowerCase()) || r.hasAttribute("contenteditable") && r.getAttribute("contenteditable")?.toLowerCase() !== "false" : !1;
|
|
2567
2567
|
}
|
|
2568
2568
|
function oe(r, t) {
|
|
2569
2569
|
const e = on(r, r.document.body, t), i = r._readium_cssSelectorGenerator.getCssSelector(e, {
|
|
@@ -2585,12 +2585,12 @@ function oe(r, t) {
|
|
|
2585
2585
|
function on(r, t, e) {
|
|
2586
2586
|
for (var i = 0; i < t.children.length; i++) {
|
|
2587
2587
|
const n = t.children[i];
|
|
2588
|
-
if (!
|
|
2589
|
-
return
|
|
2588
|
+
if (!as(n) && rs(r, n, e))
|
|
2589
|
+
return os(r, n) ? n : on(r, n, e);
|
|
2590
2590
|
}
|
|
2591
2591
|
return t;
|
|
2592
2592
|
}
|
|
2593
|
-
function
|
|
2593
|
+
function rs(r, t, e) {
|
|
2594
2594
|
if (t === document.body || t === document.documentElement)
|
|
2595
2595
|
return !0;
|
|
2596
2596
|
if (!document || !document.documentElement || !document.body)
|
|
@@ -2598,11 +2598,11 @@ function ss(r, t, e) {
|
|
|
2598
2598
|
const i = t.getBoundingClientRect();
|
|
2599
2599
|
return e ? i.bottom > 0 && i.top < r.innerHeight : i.right > 0 && i.left < r.innerWidth;
|
|
2600
2600
|
}
|
|
2601
|
-
function
|
|
2601
|
+
function os(r, t) {
|
|
2602
2602
|
const e = t.getBoundingClientRect();
|
|
2603
2603
|
return e.top >= 0 && e.left >= 0 && e.bottom <= r.innerHeight && e.right <= r.innerWidth;
|
|
2604
2604
|
}
|
|
2605
|
-
function
|
|
2605
|
+
function as(r) {
|
|
2606
2606
|
const t = getComputedStyle(r);
|
|
2607
2607
|
if (t) {
|
|
2608
2608
|
const e = t.getPropertyValue("display");
|
|
@@ -2611,7 +2611,7 @@ function os(r) {
|
|
|
2611
2611
|
}
|
|
2612
2612
|
return !1;
|
|
2613
2613
|
}
|
|
2614
|
-
const
|
|
2614
|
+
const ls = {
|
|
2615
2615
|
maxVelocity: 200,
|
|
2616
2616
|
// Reasonable default for human-like scrolling (pixels/ms)
|
|
2617
2617
|
minVariance: 0.01,
|
|
@@ -2637,7 +2637,7 @@ const as = {
|
|
|
2637
2637
|
maxSelectionsPerSecond: 500,
|
|
2638
2638
|
minVariance: 50,
|
|
2639
2639
|
historySize: 20
|
|
2640
|
-
},
|
|
2640
|
+
}, hs = {
|
|
2641
2641
|
enabled: !0,
|
|
2642
2642
|
maxSelectionPercent: 0.1,
|
|
2643
2643
|
minThreshold: 100,
|
|
@@ -2646,7 +2646,7 @@ const as = {
|
|
|
2646
2646
|
};
|
|
2647
2647
|
class ae {
|
|
2648
2648
|
constructor(t = {}) {
|
|
2649
|
-
this.history = [], this.consistentScrollCount = 0, this.options = { ...
|
|
2649
|
+
this.history = [], this.consistentScrollCount = 0, this.options = { ...ls, ...t };
|
|
2650
2650
|
}
|
|
2651
2651
|
analyze(t, e, i) {
|
|
2652
2652
|
if (i <= 0) return !1;
|
|
@@ -2677,7 +2677,7 @@ class ae {
|
|
|
2677
2677
|
this.history = [], this.consistentScrollCount = 0;
|
|
2678
2678
|
}
|
|
2679
2679
|
}
|
|
2680
|
-
const Ei = "readium-column-snapper-style",
|
|
2680
|
+
const Ei = "readium-column-snapper-style", cs = 200, F = class F extends St {
|
|
2681
2681
|
constructor() {
|
|
2682
2682
|
super(...arguments), this.isSnapProtectionEnabled = !1, this.patternAnalyzer = null, this.lastTurnTime = 0, this.rtl = !1, this.shakeTimeout = 0, this.snappingCancelled = !1, this.alreadyScrollLeft = 0, this.overscroll = 0, this.cachedScrollWidth = 0, this.touchState = 0, this.startingX = void 0, this.endingX = void 0, this.onTouchStarter = this.onTouchStart.bind(this), this.onTouchEnder = this.onTouchEnd.bind(this), this.onWidthChanger = this.onWidthChange.bind(this), this.onTouchMover = this.onTouchMove.bind(this);
|
|
2683
2683
|
}
|
|
@@ -2736,7 +2736,7 @@ const Ei = "readium-column-snapper-style", hs = 200, F = class F extends St {
|
|
|
2736
2736
|
const i = this.doc(), n = sn(this.wnd), s = this.cachedScrollWidth - this.wnd.innerWidth, o = Math.min(Math.max(0, this.normScroll()), s), a = this.dragOffset(), l = this.rtl ? -a : a, h = this.wnd.innerWidth / 3 * (l > 0 ? 2 : 1), c = Math.min(s, Math.max(0, this.snapNormOffset(o + h))), u = this.rtl ? -c : c, p = this.rtl ? -o : o, g = u > p ? "right" : "left";
|
|
2737
2737
|
if (this.checkSuspiciousSnap(g, Math.abs(u - p)), t && u !== p) {
|
|
2738
2738
|
this.snappingCancelled = !1;
|
|
2739
|
-
const d = (R, Y, lt, ht) => lt > ht ? Y : R + (Y - R) *
|
|
2739
|
+
const d = (R, Y, lt, ht) => lt > ht ? Y : R + (Y - R) * es(lt / ht), f = cs * n;
|
|
2740
2740
|
let w;
|
|
2741
2741
|
const P = (R) => {
|
|
2742
2742
|
if (this.snappingCancelled) return;
|
|
@@ -2810,7 +2810,7 @@ const Ei = "readium-column-snapper-style", hs = 200, F = class F extends St {
|
|
|
2810
2810
|
});
|
|
2811
2811
|
}
|
|
2812
2812
|
mount(t, e) {
|
|
2813
|
-
if (this.wnd = t, this.comms = e, this.rtl =
|
|
2813
|
+
if (this.wnd = t, this.comms = e, this.rtl = Qn(t), !super.mount(t, e)) return !1;
|
|
2814
2814
|
t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "paginated");
|
|
2815
2815
|
const i = t.document.createElement("style");
|
|
2816
2816
|
i.dataset.readium = "true", i.id = Ei, i.textContent = `
|
|
@@ -3212,7 +3212,7 @@ const B = class B extends St {
|
|
|
3212
3212
|
};
|
|
3213
3213
|
B.moduleName = "webpub_snapper";
|
|
3214
3214
|
let Le = B;
|
|
3215
|
-
class
|
|
3215
|
+
class ds {
|
|
3216
3216
|
constructor(t, e) {
|
|
3217
3217
|
this.window = t, this.copyHistory = [], this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.options = e;
|
|
3218
3218
|
}
|
|
@@ -3252,7 +3252,7 @@ class cs {
|
|
|
3252
3252
|
this.lastSelectionLength = 0, this.lastSelectionTime = 0, this.copyHistory = [], this.options.enabled = !1;
|
|
3253
3253
|
}
|
|
3254
3254
|
}
|
|
3255
|
-
class
|
|
3255
|
+
class us {
|
|
3256
3256
|
constructor(t = an) {
|
|
3257
3257
|
this.options = t, this.events = [], this.selectionStartTime = 0, this.lastSelectionTime = 0, this.lastSelectionPosition = 0, this.selectionPatterns = [], this.lastSelectedText = "";
|
|
3258
3258
|
}
|
|
@@ -3299,13 +3299,17 @@ class ln {
|
|
|
3299
3299
|
* Checks if the given keyboard event matches any of the provided key combinations
|
|
3300
3300
|
*/
|
|
3301
3301
|
match(t, e) {
|
|
3302
|
-
for (const i of e)
|
|
3303
|
-
|
|
3304
|
-
if (n && s && o && a && l)
|
|
3302
|
+
for (const i of e)
|
|
3303
|
+
if (this.matchesCombo(t, i))
|
|
3305
3304
|
return !0;
|
|
3306
|
-
}
|
|
3307
3305
|
return !1;
|
|
3308
3306
|
}
|
|
3307
|
+
matchesCombo(t, e) {
|
|
3308
|
+
return t.keyCode === e.keyCode && this.matchesModifier(t.ctrlKey, e.ctrl) && this.matchesModifier(t.shiftKey, e.shift) && this.matchesModifier(t.altKey, e.alt) && this.matchesModifier(t.metaKey, e.meta);
|
|
3309
|
+
}
|
|
3310
|
+
matchesModifier(t, e) {
|
|
3311
|
+
return e === void 0 ? !t : t === e;
|
|
3312
|
+
}
|
|
3309
3313
|
/**
|
|
3310
3314
|
* Creates an event handler that will call the provided handler when any of the key combinations match
|
|
3311
3315
|
*/
|
|
@@ -3505,8 +3509,8 @@ const yt = class yt extends Et {
|
|
|
3505
3509
|
}
|
|
3506
3510
|
addBulkCopyProtection(t = {}) {
|
|
3507
3511
|
if (this.isBulkCopyProtectionEnabled || !this.wnd) return;
|
|
3508
|
-
const e =
|
|
3509
|
-
this.bulkCopyProtector = new
|
|
3512
|
+
const e = hs, i = t ? { ...e, ...t } : e;
|
|
3513
|
+
this.bulkCopyProtector = new ds(this.wnd, i), this.wnd.document.addEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.addEventListener("cut", this.preventBulkCopy, !0), this.isBulkCopyProtectionEnabled = !0;
|
|
3510
3514
|
}
|
|
3511
3515
|
removeBulkCopyProtection() {
|
|
3512
3516
|
!this.isBulkCopyProtectionEnabled || !this.wnd || (this.wnd.document.removeEventListener("copy", this.preventBulkCopy, !0), this.wnd.document.removeEventListener("cut", this.preventBulkCopy, !0), this.bulkCopyProtector?.destroy(), this.bulkCopyProtector = null, this.isBulkCopyProtectionEnabled = !1);
|
|
@@ -3514,7 +3518,7 @@ const yt = class yt extends Et {
|
|
|
3514
3518
|
addSelectionMonitoring(t) {
|
|
3515
3519
|
if (this.isSelectionMonitoringEnabled || !this.wnd) return;
|
|
3516
3520
|
const e = t || an;
|
|
3517
|
-
this.selectionAnalyzer = new
|
|
3521
|
+
this.selectionAnalyzer = new us(e), this.wnd.document.addEventListener("selectionchange", this.handleSelection), this.isSelectionMonitoringEnabled = !0;
|
|
3518
3522
|
}
|
|
3519
3523
|
removeSelectionMonitoring() {
|
|
3520
3524
|
!this.isSelectionMonitoringEnabled || !this.wnd || (this.wnd.document.removeEventListener("selectionchange", this.handleSelection), this.selectionAnalyzer?.clear(), this.selectionAnalyzer = null, this.isSelectionMonitoringEnabled = !1);
|
|
@@ -3656,7 +3660,7 @@ const At = class At extends Et {
|
|
|
3656
3660
|
), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
|
|
3657
3661
|
value: {
|
|
3658
3662
|
name: "readium-ts-toolkit",
|
|
3659
|
-
version: "2.5.2-beta.
|
|
3663
|
+
version: "2.5.2-beta.4",
|
|
3660
3664
|
hasFeature: (n, s = "") => {
|
|
3661
3665
|
switch (n) {
|
|
3662
3666
|
case "dom-manipulation":
|
|
@@ -3814,7 +3818,7 @@ const Q = class Q extends Et {
|
|
|
3814
3818
|
Q.moduleName = "webpub_setup";
|
|
3815
3819
|
let Re = Q;
|
|
3816
3820
|
var nt;
|
|
3817
|
-
let
|
|
3821
|
+
let ps = (nt = class extends Et {
|
|
3818
3822
|
constructor() {
|
|
3819
3823
|
super(...arguments), this.styleElement = null, this.beforePrintHandler = null, this.configApplied = !1;
|
|
3820
3824
|
}
|
|
@@ -3905,7 +3909,7 @@ const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3905
3909
|
this.patternAnalyzer || (this.patternAnalyzer = new ae(je), this.isScrollProtectionEnabled = !0, this.comms?.log("Scroll protection enabled"));
|
|
3906
3910
|
}
|
|
3907
3911
|
mount(t, e) {
|
|
3908
|
-
this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.verticalLR =
|
|
3912
|
+
this.wnd = t, this.comms = e, this.initialScrollHandled = !1, this.lastScrollLeft = 0, this.isResizing = !1, this.verticalLR = ts(t), this.resizeDebounce && (this.wnd.clearTimeout(this.resizeDebounce), this.resizeDebounce = null), t.navigator.epubReadingSystem && (t.navigator.epubReadingSystem.layoutStyle = "scrolling");
|
|
3909
3913
|
const i = t.document.createElement("style");
|
|
3910
3914
|
return i.dataset.readium = "true", i.id = xi, i.textContent = `
|
|
3911
3915
|
* {
|
|
@@ -3991,12 +3995,12 @@ const xi = "readium-cjk-vertical-snapper-style", H = class H extends St {
|
|
|
3991
3995
|
};
|
|
3992
3996
|
H.moduleName = "cjk_vertical_snapper";
|
|
3993
3997
|
let Ae = H;
|
|
3994
|
-
const
|
|
3998
|
+
const fs = [
|
|
3995
3999
|
"fixed_setup",
|
|
3996
4000
|
"decorator",
|
|
3997
4001
|
"peripherals",
|
|
3998
4002
|
"print_protection"
|
|
3999
|
-
],
|
|
4003
|
+
], ms = [
|
|
4000
4004
|
"reflowable_setup",
|
|
4001
4005
|
"decorator",
|
|
4002
4006
|
"peripherals",
|
|
@@ -4004,7 +4008,7 @@ const ps = [
|
|
|
4004
4008
|
"scroll_snapper",
|
|
4005
4009
|
"cjk_vertical_snapper",
|
|
4006
4010
|
"print_protection"
|
|
4007
|
-
],
|
|
4011
|
+
], gs = [
|
|
4008
4012
|
"webpub_setup",
|
|
4009
4013
|
"webpub_snapper",
|
|
4010
4014
|
"decorator",
|
|
@@ -4021,7 +4025,7 @@ const ps = [
|
|
|
4021
4025
|
_e,
|
|
4022
4026
|
Ce,
|
|
4023
4027
|
Ae,
|
|
4024
|
-
|
|
4028
|
+
ps
|
|
4025
4029
|
].map((r) => [r.moduleName, r]));
|
|
4026
4030
|
class Pt {
|
|
4027
4031
|
/**
|
|
@@ -4029,7 +4033,7 @@ class Pt {
|
|
|
4029
4033
|
* @param initialModules List of initial modules to load
|
|
4030
4034
|
*/
|
|
4031
4035
|
constructor(t = window, e = []) {
|
|
4032
|
-
this.loadedModules = [], this.wnd = t, this.comms = new
|
|
4036
|
+
this.loadedModules = [], this.wnd = t, this.comms = new Dn(t);
|
|
4033
4037
|
const i = [...new Set(e)];
|
|
4034
4038
|
if (i.length) {
|
|
4035
4039
|
if (typeof t > "u")
|
|
@@ -4073,7 +4077,7 @@ class Pt {
|
|
|
4073
4077
|
this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
|
|
4074
4078
|
}
|
|
4075
4079
|
}
|
|
4076
|
-
const
|
|
4080
|
+
const ys = {
|
|
4077
4081
|
type: "developer_tools",
|
|
4078
4082
|
keyCombos: [
|
|
4079
4083
|
{ keyCode: 73, meta: !0, alt: !0 },
|
|
@@ -4107,7 +4111,7 @@ const gs = {
|
|
|
4107
4111
|
{ keyCode: 123, meta: !0, alt: !0 }
|
|
4108
4112
|
// Cmd+Option+F12
|
|
4109
4113
|
]
|
|
4110
|
-
},
|
|
4114
|
+
}, bs = {
|
|
4111
4115
|
type: "select_all",
|
|
4112
4116
|
keyCombos: [
|
|
4113
4117
|
{ keyCode: 65, meta: !0 },
|
|
@@ -4115,7 +4119,7 @@ const gs = {
|
|
|
4115
4119
|
{ keyCode: 65, ctrl: !0 }
|
|
4116
4120
|
// Ctrl+A
|
|
4117
4121
|
]
|
|
4118
|
-
},
|
|
4122
|
+
}, ws = {
|
|
4119
4123
|
type: "print",
|
|
4120
4124
|
keyCombos: [
|
|
4121
4125
|
{ keyCode: 80, meta: !0 },
|
|
@@ -4131,7 +4135,7 @@ const gs = {
|
|
|
4131
4135
|
{ keyCode: 80, ctrl: !0, alt: !0 }
|
|
4132
4136
|
// Ctrl+Alt+P
|
|
4133
4137
|
]
|
|
4134
|
-
},
|
|
4138
|
+
}, vs = {
|
|
4135
4139
|
type: "save",
|
|
4136
4140
|
keyCombos: [
|
|
4137
4141
|
{ keyCode: 83, meta: !0 },
|
|
@@ -4149,7 +4153,7 @@ class hn {
|
|
|
4149
4153
|
const i = [], n = e.filter(
|
|
4150
4154
|
(s) => !["developer_tools", "select_all", "print", "save"].includes(s.type)
|
|
4151
4155
|
);
|
|
4152
|
-
t.disableSelectAll && i.push(
|
|
4156
|
+
t.disableSelectAll && i.push(bs), t.disableSave && i.push(vs), t.monitorDevTools && i.push(ys), t.protectPrinting?.disable && i.push(ws);
|
|
4153
4157
|
for (const s of n) {
|
|
4154
4158
|
const o = s.keyCombos.filter(
|
|
4155
4159
|
(a) => !i.some(
|
|
@@ -4180,9 +4184,9 @@ class cn extends hn {
|
|
|
4180
4184
|
this.readingProgression === N.ltr ? this.goForward(t, e) : this.readingProgression === N.rtl && this.goBackward(t, e);
|
|
4181
4185
|
}
|
|
4182
4186
|
}
|
|
4183
|
-
class
|
|
4187
|
+
class Ss extends hn {
|
|
4184
4188
|
}
|
|
4185
|
-
class
|
|
4189
|
+
class Ps {
|
|
4186
4190
|
constructor(t, e, i, n) {
|
|
4187
4191
|
this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
|
|
4188
4192
|
}
|
|
@@ -4232,7 +4236,7 @@ class Ss {
|
|
|
4232
4236
|
return n + o;
|
|
4233
4237
|
}
|
|
4234
4238
|
}
|
|
4235
|
-
const
|
|
4239
|
+
const Es = 1e4;
|
|
4236
4240
|
class Mt {
|
|
4237
4241
|
constructor(t, e) {
|
|
4238
4242
|
this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
|
|
@@ -4243,7 +4247,7 @@ class Mt {
|
|
|
4243
4247
|
}
|
|
4244
4248
|
this.gc = setInterval(() => {
|
|
4245
4249
|
this.registry.forEach((i, n) => {
|
|
4246
|
-
performance.now() - i.time >
|
|
4250
|
+
performance.now() - i.time > Es && (console.warn(n, "event for", i.key, "was never handled!"), this.registry.delete(n));
|
|
4247
4251
|
});
|
|
4248
4252
|
}, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
|
|
4249
4253
|
}
|
|
@@ -4312,12 +4316,12 @@ class Mt {
|
|
|
4312
4316
|
), o;
|
|
4313
4317
|
}
|
|
4314
4318
|
}
|
|
4315
|
-
const
|
|
4316
|
-
RS__oldStyleTf:
|
|
4317
|
-
},
|
|
4319
|
+
const _s = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Cs = {
|
|
4320
|
+
RS__oldStyleTf: _s
|
|
4321
|
+
}, Ls = 16, ki = Cs.RS__oldStyleTf;
|
|
4318
4322
|
class kt {
|
|
4319
4323
|
constructor(t) {
|
|
4320
|
-
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize ||
|
|
4324
|
+
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || Ls, this._fontFace = t.fontFace || ki, this._sample = t.sample || null, this._padding = t.padding ?? 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = kt.approximateWordSpaces(this._optimalChars, this._sample);
|
|
4321
4325
|
}
|
|
4322
4326
|
updateMultipliers() {
|
|
4323
4327
|
this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1;
|
|
@@ -4423,7 +4427,7 @@ class pn {
|
|
|
4423
4427
|
}, []) };
|
|
4424
4428
|
}
|
|
4425
4429
|
}
|
|
4426
|
-
class
|
|
4430
|
+
class xs extends pn {
|
|
4427
4431
|
get iOSRequest() {
|
|
4428
4432
|
const t = un(), e = dn();
|
|
4429
4433
|
if (this.OS.iOS && !this.OS.iPadOS)
|
|
@@ -4432,7 +4436,7 @@ class Ls extends pn {
|
|
|
4432
4436
|
return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
|
|
4433
4437
|
}
|
|
4434
4438
|
}
|
|
4435
|
-
const J = new pn(), T = new
|
|
4439
|
+
const J = new pn(), T = new xs();
|
|
4436
4440
|
function bt(r) {
|
|
4437
4441
|
const t = r.languages?.[0]?.toLowerCase(), e = r.readingProgression;
|
|
4438
4442
|
if (t) {
|
|
@@ -4443,7 +4447,34 @@ function bt(r) {
|
|
|
4443
4447
|
}
|
|
4444
4448
|
return "ltr";
|
|
4445
4449
|
}
|
|
4446
|
-
class
|
|
4450
|
+
class fn {
|
|
4451
|
+
constructor(t, e) {
|
|
4452
|
+
this.config = t, this.onUpdate = e, this.unsubs = [], this.conditionValues = /* @__PURE__ */ new Map();
|
|
4453
|
+
}
|
|
4454
|
+
setup() {
|
|
4455
|
+
let t = !0;
|
|
4456
|
+
this.config.forEach(
|
|
4457
|
+
(e) => e.keyCombos.forEach((i) => {
|
|
4458
|
+
if (i.condition) {
|
|
4459
|
+
const n = i.condition.subscribe((s) => {
|
|
4460
|
+
this.conditionValues.set(i, s), t || this.onUpdate(this.buildSerializable());
|
|
4461
|
+
});
|
|
4462
|
+
this.unsubs.push(n);
|
|
4463
|
+
}
|
|
4464
|
+
})
|
|
4465
|
+
), t = !1, this.onUpdate(this.buildSerializable());
|
|
4466
|
+
}
|
|
4467
|
+
buildSerializable() {
|
|
4468
|
+
return this.config.map((t) => ({
|
|
4469
|
+
...t,
|
|
4470
|
+
keyCombos: t.keyCombos.filter((e) => !e.condition || this.conditionValues.get(e) === !0).map(({ condition: e, ...i }) => i)
|
|
4471
|
+
})).filter((t) => t.keyCombos.length > 0);
|
|
4472
|
+
}
|
|
4473
|
+
destroy() {
|
|
4474
|
+
this.unsubs.forEach((t) => t()), this.unsubs = [], this.conditionValues.clear();
|
|
4475
|
+
}
|
|
4476
|
+
}
|
|
4477
|
+
class ks {
|
|
4447
4478
|
constructor(t, e = {}, i = []) {
|
|
4448
4479
|
this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.frame.style.backgroundColor = "#FFFFFF", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
|
|
4449
4480
|
}
|
|
@@ -4481,10 +4512,15 @@ class xs {
|
|
|
4481
4512
|
});
|
|
4482
4513
|
}
|
|
4483
4514
|
applyContentProtection() {
|
|
4484
|
-
this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && this.
|
|
4515
|
+
this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && (this.conditionBridge?.destroy(), this.conditionBridge = new fn(
|
|
4516
|
+
this.keyboardPeripheralsConfig,
|
|
4517
|
+
(t) => {
|
|
4518
|
+
t.length > 0 && this.comms.send("keyboard_peripherals", t);
|
|
4519
|
+
}
|
|
4520
|
+
), this.conditionBridge.setup()), this.contentProtectionConfig.monitorScrollingExperimental && this.comms.send("scroll_protection", {}), this.contentProtectionConfig.protectPrinting?.disable && this.comms.send("print_protection", this.contentProtectionConfig.protectPrinting);
|
|
4485
4521
|
}
|
|
4486
4522
|
async destroy() {
|
|
4487
|
-
await this.hide(), this.loader?.destroy(), this.frame.remove(), this.destroyed = !0;
|
|
4523
|
+
this.conditionBridge?.destroy(), await this.hide(), this.loader?.destroy(), this.frame.remove(), this.destroyed = !0;
|
|
4488
4524
|
}
|
|
4489
4525
|
async hide() {
|
|
4490
4526
|
if (!this.destroyed) {
|
|
@@ -4534,7 +4570,7 @@ class xs {
|
|
|
4534
4570
|
return this.loader;
|
|
4535
4571
|
}
|
|
4536
4572
|
}
|
|
4537
|
-
class
|
|
4573
|
+
class Os {
|
|
4538
4574
|
constructor(t, e, i, n = {}, s = []) {
|
|
4539
4575
|
this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.currentCssProperties = e, this.injector = i, this.contentProtectionConfig = n, this.keyboardPeripheralsConfig = [...s];
|
|
4540
4576
|
}
|
|
@@ -4585,7 +4621,7 @@ class ks {
|
|
|
4585
4621
|
const f = t.readingOrder.findWithHref(d);
|
|
4586
4622
|
if (!f) return;
|
|
4587
4623
|
if (!this.blobs.has(d)) {
|
|
4588
|
-
const R = await new
|
|
4624
|
+
const R = await new Ps(
|
|
4589
4625
|
t,
|
|
4590
4626
|
this.currentBaseURL || "",
|
|
4591
4627
|
f,
|
|
@@ -4596,7 +4632,7 @@ class ks {
|
|
|
4596
4632
|
).build();
|
|
4597
4633
|
this.blobs.set(d, R);
|
|
4598
4634
|
}
|
|
4599
|
-
const w = new
|
|
4635
|
+
const w = new ks(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
4600
4636
|
d !== o && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(d, w);
|
|
4601
4637
|
};
|
|
4602
4638
|
try {
|
|
@@ -4651,7 +4687,7 @@ class ks {
|
|
|
4651
4687
|
}
|
|
4652
4688
|
}
|
|
4653
4689
|
var me, Oi;
|
|
4654
|
-
function
|
|
4690
|
+
function Rs() {
|
|
4655
4691
|
if (Oi) return me;
|
|
4656
4692
|
Oi = 1;
|
|
4657
4693
|
function r(n) {
|
|
@@ -4838,11 +4874,11 @@ function Os() {
|
|
|
4838
4874
|
};
|
|
4839
4875
|
return i.posix = i, me = i, me;
|
|
4840
4876
|
}
|
|
4841
|
-
var Gt =
|
|
4842
|
-
const
|
|
4843
|
-
experimentalHeaderFiltering:
|
|
4844
|
-
experimentalZoom:
|
|
4845
|
-
}, $e =
|
|
4877
|
+
var Gt = Rs();
|
|
4878
|
+
const As = { description: "Attempts to filter out paragraphs that are implicitly headings or part of headers", scope: "RS", value: "readium-experimentalHeaderFiltering-on" }, Ts = { description: "Attemps to filter out elements that are sized using viewport units and should not be scaled directly e.g. tables, images, iframes, etc.", scope: "RS", value: "readium-experimentalZoom-on" }, Ms = {
|
|
4879
|
+
experimentalHeaderFiltering: As,
|
|
4880
|
+
experimentalZoom: Ts
|
|
4881
|
+
}, $e = Ms;
|
|
4846
4882
|
var tt = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(tt || {});
|
|
4847
4883
|
const dt = {
|
|
4848
4884
|
range: [0, 100],
|
|
@@ -4914,7 +4950,7 @@ class le {
|
|
|
4914
4950
|
return `${t}rem`;
|
|
4915
4951
|
}
|
|
4916
4952
|
}
|
|
4917
|
-
class
|
|
4953
|
+
class mn extends le {
|
|
4918
4954
|
constructor(t) {
|
|
4919
4955
|
super(), this.a11yNormalize = t.a11yNormalize ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.fontFamily = t.fontFamily ?? null, this.fontWeight = t.fontWeight ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.textAlign = t.textAlign ?? null, this.wordSpacing = t.wordSpacing ?? null, this.zoom = t.zoom ?? null;
|
|
4920
4956
|
}
|
|
@@ -4923,7 +4959,7 @@ class fn extends le {
|
|
|
4923
4959
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), this.zoom !== null && (t["--USER__zoom"] = this.toPercentage(this.zoom, !0)), t;
|
|
4924
4960
|
}
|
|
4925
4961
|
}
|
|
4926
|
-
class
|
|
4962
|
+
class Ns extends le {
|
|
4927
4963
|
constructor(t) {
|
|
4928
4964
|
super(), this.experiments = t.experiments ?? null;
|
|
4929
4965
|
}
|
|
@@ -4934,7 +4970,7 @@ class Ms extends le {
|
|
|
4934
4970
|
}), t;
|
|
4935
4971
|
}
|
|
4936
4972
|
}
|
|
4937
|
-
class
|
|
4973
|
+
class zs {
|
|
4938
4974
|
constructor(t) {
|
|
4939
4975
|
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
|
|
4940
4976
|
}
|
|
@@ -4957,13 +4993,13 @@ class Ns {
|
|
|
4957
4993
|
wordSpacing: t.wordSpacing,
|
|
4958
4994
|
zoom: t.zoom
|
|
4959
4995
|
};
|
|
4960
|
-
this.userProperties = new
|
|
4996
|
+
this.userProperties = new mn(e);
|
|
4961
4997
|
}
|
|
4962
4998
|
}
|
|
4963
|
-
function
|
|
4999
|
+
function Is(r, t) {
|
|
4964
5000
|
return r == null || t == null || r <= t ? r : void 0;
|
|
4965
5001
|
}
|
|
4966
|
-
function
|
|
5002
|
+
function Ds(r, t) {
|
|
4967
5003
|
return r == null || t == null || r >= t ? r : void 0;
|
|
4968
5004
|
}
|
|
4969
5005
|
function W(r) {
|
|
@@ -4994,7 +5030,7 @@ function z(r, t) {
|
|
|
4994
5030
|
function ge(r, t) {
|
|
4995
5031
|
return r === void 0 ? t : r;
|
|
4996
5032
|
}
|
|
4997
|
-
function
|
|
5033
|
+
function gn(r) {
|
|
4998
5034
|
if (r !== void 0)
|
|
4999
5035
|
return r === null ? null : r.filter((t) => t in $e);
|
|
5000
5036
|
}
|
|
@@ -5021,9 +5057,9 @@ class Nt {
|
|
|
5021
5057
|
return new Nt(e);
|
|
5022
5058
|
}
|
|
5023
5059
|
}
|
|
5024
|
-
class
|
|
5060
|
+
class Fs {
|
|
5025
5061
|
constructor(t) {
|
|
5026
|
-
this.fontFamily = W(t.fontFamily) || null, this.fontWeight = z(t.fontWeight, st.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = he(t.textAlign, tt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = z(t.zoom, ee.range) || 1, this.experiments =
|
|
5062
|
+
this.fontFamily = W(t.fontFamily) || null, this.fontWeight = z(t.fontWeight, st.range) || null, this.hyphens = E(t.hyphens) ?? null, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.textAlign = he(t.textAlign, tt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = v(t.wordSpacing) || null, this.zoom = z(t.zoom, ee.range) || 1, this.experiments = gn(t.experiments) ?? null;
|
|
5027
5063
|
}
|
|
5028
5064
|
}
|
|
5029
5065
|
class Ri {
|
|
@@ -5076,7 +5112,7 @@ class A extends M {
|
|
|
5076
5112
|
this._value = !this._value, this._onChange(this._value);
|
|
5077
5113
|
}
|
|
5078
5114
|
}
|
|
5079
|
-
class
|
|
5115
|
+
class yn extends M {
|
|
5080
5116
|
constructor({
|
|
5081
5117
|
initialValue: t = null,
|
|
5082
5118
|
effectiveValue: e,
|
|
@@ -5293,7 +5329,7 @@ class Ai {
|
|
|
5293
5329
|
});
|
|
5294
5330
|
}
|
|
5295
5331
|
get textAlign() {
|
|
5296
|
-
return new
|
|
5332
|
+
return new yn({
|
|
5297
5333
|
initialValue: this.preferences.textAlign,
|
|
5298
5334
|
effectiveValue: this.settings.textAlign || tt.start,
|
|
5299
5335
|
isEffective: this.isDisplayTransformable,
|
|
@@ -5338,7 +5374,7 @@ class Ai {
|
|
|
5338
5374
|
});
|
|
5339
5375
|
}
|
|
5340
5376
|
}
|
|
5341
|
-
const
|
|
5377
|
+
const bn = (r) => {
|
|
5342
5378
|
if ("blob" in r && r.blob.type)
|
|
5343
5379
|
return r.blob.type;
|
|
5344
5380
|
if (r.as === "script")
|
|
@@ -5348,22 +5384,22 @@ const yn = (r) => {
|
|
|
5348
5384
|
if (t.endsWith(".css")) return "text/css";
|
|
5349
5385
|
if ([".js", ".mjs", ".cjs"].some((e) => t.endsWith(e))) return "text/javascript";
|
|
5350
5386
|
}
|
|
5351
|
-
},
|
|
5387
|
+
}, wn = (r, t) => {
|
|
5352
5388
|
t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
|
|
5353
5389
|
e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && r.setAttribute(e, "") : r.setAttribute(e, i));
|
|
5354
5390
|
});
|
|
5355
|
-
},
|
|
5391
|
+
}, Ws = (r, t, e) => {
|
|
5356
5392
|
const i = r.createElement("script");
|
|
5357
5393
|
i.dataset.readium = "true", t.id && (i.id = t.id);
|
|
5358
|
-
const n = t.type ||
|
|
5359
|
-
return n && (i.type = n),
|
|
5394
|
+
const n = t.type || bn(t);
|
|
5395
|
+
return n && (i.type = n), wn(i, t), i.src = e, i;
|
|
5360
5396
|
}, Ti = (r, t, e) => {
|
|
5361
5397
|
const i = r.createElement("link");
|
|
5362
5398
|
i.dataset.readium = "true", t.id && (i.id = t.id), t.rel && (i.rel = t.rel);
|
|
5363
|
-
const n = t.type ||
|
|
5364
|
-
return n && (i.type = n),
|
|
5399
|
+
const n = t.type || bn(t);
|
|
5400
|
+
return n && (i.type = n), wn(i, t), i.href = e, i;
|
|
5365
5401
|
};
|
|
5366
|
-
class
|
|
5402
|
+
class vn {
|
|
5367
5403
|
constructor(t) {
|
|
5368
5404
|
this.blobStore = /* @__PURE__ */ new Map(), this.createdBlobUrls = /* @__PURE__ */ new Set(), this.allowedDomains = [], this.injectableIdCounter = 0, this.allowedDomains = (t.allowedDomains || []).map((e) => {
|
|
5369
5405
|
try {
|
|
@@ -5449,7 +5485,7 @@ class wn {
|
|
|
5449
5485
|
}
|
|
5450
5486
|
createElement(t, e, i) {
|
|
5451
5487
|
if (e.as === "script")
|
|
5452
|
-
return
|
|
5488
|
+
return Ws(t, e, i);
|
|
5453
5489
|
if (e.as === "link")
|
|
5454
5490
|
return Ti(t, e, i);
|
|
5455
5491
|
throw new Error(`Unsupported element type: ${e.as}`);
|
|
@@ -5508,7 +5544,7 @@ class wn {
|
|
|
5508
5544
|
}
|
|
5509
5545
|
}
|
|
5510
5546
|
}
|
|
5511
|
-
const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ct = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "),
|
|
5547
|
+
const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Ct = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), Us = `/*!
|
|
5512
5548
|
* Readium CSS v.2.0.0
|
|
5513
5549
|
* Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
|
|
5514
5550
|
* Use of this source code is governed by a BSD-style license which is detailed in the
|
|
@@ -5782,11 +5818,11 @@ const vt = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
|
|
|
5782
5818
|
|
|
5783
5819
|
:root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
|
|
5784
5820
|
-webkit-text-zoom:normal;
|
|
5785
|
-
}`,
|
|
5821
|
+
}`, Sn = '!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t){return"object"==typeof t&&null!==t&&t.nodeType===Node.ELEMENT_NODE}t.r(e),t.d(e,{_readium_cssSelectorGenerator:()=>Z,default:()=>tt,getCssSelector:()=>X});const o={NONE:"",DESCENDANT:" ",CHILD:" > "},r={id:"id",class:"class",tag:"tag",attribute:"attribute",nthchild:"nthchild",nthoftype:"nthoftype"},i="_readium_cssSelectorGenerator";function c(t="unknown problem",...e){console.warn(`${i}: ${t}`,...e)}const s={selectors:[r.id,r.class,r.tag,r.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY,useScope:!1};function u(t){return t instanceof RegExp}function l(t){return["string","function"].includes(typeof t)||u(t)}function a(t){return Array.isArray(t)?t.filter(l):[]}function f(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function d(t,e){if(f(t))return t.contains(e)||c("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."),t;const n=e.getRootNode({composed:!1});return f(n)?(n!==document&&c("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):S(e)}function m(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function p(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function g(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(c("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return c("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function h(t,e,n){const o=Array.from(d(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:S(t);const o=[];let r=t;for(;n(r)&&r!==e;)o.push(r),r=r.parentElement;return o}function b(t,e){return p(t.map((t=>y(t,e))))}function S(t){return t.ownerDocument.querySelector(":root")}const N=", ",v=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),x=[r.nthoftype,r.tag,r.id,r.class,r.attribute,r.nthchild],w=g(["class","id","ng-*"]);function I({name:t}){return`[${t}]`}function T({name:t,value:e}){return`[${t}=\'${e}\']`}function O({nodeName:t,nodeValue:e}){return{name:F(t),value:F(null!=e?e:void 0)}}function C(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t,nodeValue:e},n){const o=n.tagName.toLowerCase();return!(["input","option"].includes(o)&&"value"===t||"src"===t&&(null==e?void 0:e.startsWith("data:"))||w(t))}(e,t))).map(O);return[...e.map(I),...e.map(T)]}function j(t){var e;return(null!==(e=t.getAttribute("class"))&&void 0!==e?e:"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${F(t)}`))}function A(t){var e;const n=null!==(e=t.getAttribute("id"))&&void 0!==e?e:"",o=`#${F(n)}`,r=t.getRootNode({composed:!1});return!v.test(n)&&h([t],o,r)?[o]:[]}function R(t){var e;const n=null===(e=t.parentElement)||void 0===e?void 0:e.children;if(n)for(let e=0;e<n.length;e++)if(n[e]===t)return[`:nth-child(${String(e+1)})`];return[]}function $(t){return[F(t.tagName.toLowerCase())]}function D(t){const e=[...new Set((n=t.map($),[].concat(...n)))];var n;return 0===e.length||e.length>1?[]:[e[0]]}function k(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${String(r+1)})`]}return[]}function*P(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){let n=0,o=L(1);for(;o.length<=t.length&&n<e;){n+=1;const e=o.map((e=>t[e]));yield e,o=_(o,t.length-1)}}function _(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return L(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?L(n+1):o}function L(t=1){return Array.from(Array(t).keys())}const M=":".charCodeAt(0).toString(16).toUpperCase(),V=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function F(t=""){return CSS?CSS.escape(t):function(t=""){return t.split("").map((t=>":"===t?`\\\\${M} `:V.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const Y={tag:D,id:function(t){return 0===t.length||t.length>1?[]:A(t[0])},class:function(t){return p(t.map(j))},attribute:function(t){return p(t.map(C))},nthchild:function(t){return p(t.map(R))},nthoftype:function(t){return p(t.map(k))}},G={tag:$,id:A,class:j,attribute:C,nthchild:R,nthoftype:k};function W(t){return t.includes(r.tag)||t.includes(r.nthoftype)?[...t]:[...t,r.tag]}function*q(t,e){const n={};for(const o of t){const t=e[o];t&&t.length>0&&(n[o]=t)}for(const t of function*(t={}){const e=Object.entries(t);if(0===e.length)return;const n=[{index:e.length-1,partial:{}}];for(;n.length>0;){const t=n.pop();if(!t)break;const{index:o,partial:r}=t;if(o<0){yield r;continue}const[i,c]=e[o];for(let t=c.length-1;t>=0;t--)n.push({index:o-1,partial:Object.assign(Object.assign({},r),{[i]:c[t]})})}}(n))yield B(t)}function B(t={}){const e=[...x];return t[r.tag]&&t[r.nthoftype]&&e.splice(e.indexOf(r.tag),1),e.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function H(t,e){return[...t.map((t=>e+o.DESCENDANT+t)),...t.map((t=>e+o.CHILD+t))]}function*U(t,e,n="",o){const r=function*(t,e){const n=new Set,o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=g(n),s=g(o);return function(t){const{selectors:e,includeTag:n}=t,o=[...e];return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){return(0,Y[e])(t)}(t,n),u=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,s),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(u,s);return e[n]=r?Array.from(P(l,{maxResults:i})):l.map((t=>[t])),e}),{})}(t,e);for(const t of function*(t,e){for(const n of function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?function(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){return Array.from(P(t,{maxResults:e}))}(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(W):i}(e))yield*q(n,t)}(o,e))n.has(t)||(n.add(t),yield t)}(t,o);for(const o of function*(t,e){if(""===e)yield*t;else for(const n of t)yield*H([n],e)}(r,n))h(t,o,e)&&(yield o)}function*z(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r)for(const r of U(t,e,n,o))yield{foundElements:t,selector:r}}function J(t){return{value:t,include:!1}}function K({selectors:t,operator:e}){let n=[...x];t[r.tag]&&t[r.nthoftype]&&(n=n.filter((t=>t!==r.tag)));let o="";return n.forEach((e=>{var n;(null!==(n=t[e])&&void 0!==n?n:[]).forEach((({value:t,include:e})=>{e&&(o+=t)}))})),e+o}function Q(t,e){return t.map((t=>function(t,e){return[e?":scope":":root",...y(t,e).reverse().map((t=>{var e;const n=function(t,e,n=o.NONE){const r={};return e.forEach((e=>{Reflect.set(r,e,function(t,e){return G[e](t)}(t,e).map(J))})),{element:t,operator:n,selectors:r}}(t,[r.nthchild],o.CHILD);return(null!==(e=n.selectors.nthchild)&&void 0!==e?e:[]).forEach((t=>{t.include=!0})),n})).map(K)].join("")}(t,e))).join(N)}function X(t,e={}){return Z(t,Object.assign(Object.assign({},e),{maxResults:1})).next().value}function*Z(t,e={}){var o;const i=function(t){(t instanceof NodeList||t instanceof HTMLCollection)&&(t=Array.from(t));const e=(Array.isArray(t)?t:[t]).filter(n);return[...new Set(e)]}(t),c=function(t,e={}){const n=Object.assign(Object.assign({},s),e);return{selectors:(o=n.selectors,Array.isArray(o)?o.filter((t=>{return e=r,n=t,Object.values(e).includes(n);var e,n})):[]),whitelist:a(n.whitelist),blacklist:a(n.blacklist),root:d(n.root,t),combineWithinSelector:!!n.combineWithinSelector,combineBetweenSelectors:!!n.combineBetweenSelectors,includeTag:!!n.includeTag,maxCombinations:m(n.maxCombinations),maxCandidates:m(n.maxCandidates),useScope:!!n.useScope,maxResults:m(n.maxResults)};var o}(i[0],e),u=null!==(o=c.root)&&void 0!==o?o:S(i[0]);let l=0;for(const t of function*({elements:t,root:e,rootSelector:n="",options:o}){let r=e,i=n,c=!0;for(;c;){let n=!1;for(const c of z(t,r,i,o)){const{foundElements:o,selector:s}=c;if(n=!0,!h(t,s,e)){r=o[0],i=s;break}yield s}n||(c=!1)}}({elements:i,options:c,root:u,rootSelector:""}))if(yield t,l++,l>=c.maxResults)return;i.length>1&&(yield i.map((t=>X(t,c))).join(N),l++,l>=c.maxResults)||(yield Q(i,c.useScope?u:void 0))}const tt=X;return e})()));', Bs = `// WebPub-specific setup - no execution blocking needed
|
|
5786
5822
|
window._readium_blockedEvents = [];
|
|
5787
5823
|
window._readium_blockEvents = false; // WebPub doesn't need event blocking
|
|
5788
5824
|
window._readium_eventBlocker = null;
|
|
5789
|
-
`,
|
|
5825
|
+
`, Pn = `(function() {
|
|
5790
5826
|
if(window.onload) window.onload = new Proxy(window.onload, {
|
|
5791
5827
|
apply: function(target, receiver, args) {
|
|
5792
5828
|
if(!window._readium_blockEvents) {
|
|
@@ -5800,21 +5836,21 @@ window._readium_eventBlocker = null;
|
|
|
5800
5836
|
});
|
|
5801
5837
|
})();
|
|
5802
5838
|
`;
|
|
5803
|
-
function
|
|
5839
|
+
function Hs(r) {
|
|
5804
5840
|
const t = r.filter((s) => s.mediaType.isHTML).map((s) => s.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
|
|
5805
5841
|
// CSS Selector Generator - always injected
|
|
5806
5842
|
{
|
|
5807
5843
|
id: "css-selector-generator",
|
|
5808
5844
|
as: "script",
|
|
5809
5845
|
target: "head",
|
|
5810
|
-
blob: new Blob([vt(
|
|
5846
|
+
blob: new Blob([vt(Sn)], { type: "text/javascript" })
|
|
5811
5847
|
},
|
|
5812
5848
|
// WebPub Execution - always injected (sets up event blocking to false)
|
|
5813
5849
|
{
|
|
5814
5850
|
id: "webpub-execution",
|
|
5815
5851
|
as: "script",
|
|
5816
5852
|
target: "head",
|
|
5817
|
-
blob: new Blob([vt(
|
|
5853
|
+
blob: new Blob([vt(Bs)], { type: "text/javascript" })
|
|
5818
5854
|
}
|
|
5819
5855
|
], n = [
|
|
5820
5856
|
// Onload Proxy - conditional (has executable scripts)
|
|
@@ -5822,7 +5858,7 @@ function Bs(r) {
|
|
|
5822
5858
|
id: "onload-proxy",
|
|
5823
5859
|
as: "script",
|
|
5824
5860
|
target: "head",
|
|
5825
|
-
blob: new Blob([vt(
|
|
5861
|
+
blob: new Blob([vt(Pn)], { type: "text/javascript" }),
|
|
5826
5862
|
condition: (s) => !!(s.querySelector("script") || s.querySelector("body[onload]:not(body[onload=''])"))
|
|
5827
5863
|
},
|
|
5828
5864
|
// Readium CSS WebPub - always injected
|
|
@@ -5830,7 +5866,7 @@ function Bs(r) {
|
|
|
5830
5866
|
id: "readium-css-webpub",
|
|
5831
5867
|
as: "link",
|
|
5832
5868
|
target: "head",
|
|
5833
|
-
blob: new Blob([Ct(
|
|
5869
|
+
blob: new Blob([Ct(Us)], { type: "text/css" }),
|
|
5834
5870
|
rel: "stylesheet"
|
|
5835
5871
|
}
|
|
5836
5872
|
];
|
|
@@ -5842,7 +5878,7 @@ function Bs(r) {
|
|
|
5842
5878
|
}
|
|
5843
5879
|
];
|
|
5844
5880
|
}
|
|
5845
|
-
class
|
|
5881
|
+
class Vs {
|
|
5846
5882
|
constructor(t) {
|
|
5847
5883
|
if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
|
|
5848
5884
|
throw new Error("onDetected callback is required");
|
|
@@ -5874,11 +5910,11 @@ class Hs {
|
|
|
5874
5910
|
this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
|
|
5875
5911
|
}
|
|
5876
5912
|
}
|
|
5877
|
-
let
|
|
5878
|
-
function
|
|
5879
|
-
return ++
|
|
5913
|
+
let js = 0;
|
|
5914
|
+
function $s() {
|
|
5915
|
+
return ++js;
|
|
5880
5916
|
}
|
|
5881
|
-
const
|
|
5917
|
+
const Xs = `
|
|
5882
5918
|
onmessage = function(event) {
|
|
5883
5919
|
var action = event.data;
|
|
5884
5920
|
var startTime = performance.now()
|
|
@@ -5899,7 +5935,7 @@ onmessage = function(event) {
|
|
|
5899
5935
|
}, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
|
|
5900
5936
|
}
|
|
5901
5937
|
async send(t, ...e) {
|
|
5902
|
-
const i =
|
|
5938
|
+
const i = $s();
|
|
5903
5939
|
return new Promise((n, s) => {
|
|
5904
5940
|
this.callbacks.set(i, n), this.worker.postMessage({
|
|
5905
5941
|
id: i,
|
|
@@ -5914,13 +5950,13 @@ onmessage = function(event) {
|
|
|
5914
5950
|
this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
|
|
5915
5951
|
}
|
|
5916
5952
|
};
|
|
5917
|
-
Ke.workerScript =
|
|
5953
|
+
Ke.workerScript = Xs;
|
|
5918
5954
|
let se = Ke;
|
|
5919
5955
|
function Xe(r) {
|
|
5920
5956
|
return typeof window < "u" && console ? console[r] : (...t) => {
|
|
5921
5957
|
};
|
|
5922
5958
|
}
|
|
5923
|
-
const
|
|
5959
|
+
const Gs = Xe("log"), Mi = Xe("table"), Ys = Xe("clear");
|
|
5924
5960
|
async function Ni() {
|
|
5925
5961
|
if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
|
|
5926
5962
|
try {
|
|
@@ -5933,10 +5969,10 @@ async function Ni() {
|
|
|
5933
5969
|
}
|
|
5934
5970
|
return !1;
|
|
5935
5971
|
}
|
|
5936
|
-
function
|
|
5972
|
+
function qs(r) {
|
|
5937
5973
|
return r.excludes.some((t) => t()) ? !1 : r.includes.some((t) => t());
|
|
5938
5974
|
}
|
|
5939
|
-
class
|
|
5975
|
+
class Ks {
|
|
5940
5976
|
constructor(t = {}) {
|
|
5941
5977
|
if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
|
|
5942
5978
|
onDetected: t.onDetected || (() => {
|
|
@@ -5998,14 +6034,14 @@ class qs {
|
|
|
5998
6034
|
return (await this.workerConsole.log(t)).time;
|
|
5999
6035
|
{
|
|
6000
6036
|
const e = performance.now();
|
|
6001
|
-
return
|
|
6037
|
+
return Gs(t), performance.now() - e;
|
|
6002
6038
|
}
|
|
6003
6039
|
}
|
|
6004
6040
|
/**
|
|
6005
6041
|
* Check if performance-based detection is enabled for current browser
|
|
6006
6042
|
*/
|
|
6007
6043
|
isPerformanceDetectionEnabled() {
|
|
6008
|
-
return
|
|
6044
|
+
return qs({
|
|
6009
6045
|
includes: [
|
|
6010
6046
|
() => !!J.UA.Chrome,
|
|
6011
6047
|
() => !!J.UA.Chromium,
|
|
@@ -6028,7 +6064,7 @@ class qs {
|
|
|
6028
6064
|
if (!this.isPerformanceDetectionEnabled())
|
|
6029
6065
|
return !1;
|
|
6030
6066
|
const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
|
|
6031
|
-
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() :
|
|
6067
|
+
return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Ys(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Ni() : t > this.maxPrintTime * 10;
|
|
6032
6068
|
}
|
|
6033
6069
|
/**
|
|
6034
6070
|
* Debugger-based detection (fallback method)
|
|
@@ -6083,7 +6119,7 @@ class qs {
|
|
|
6083
6119
|
this.intervalId && (clearInterval(this.intervalId), this.intervalId = void 0), this.workerConsole && (this.workerConsole.destroy(), this.workerConsole = void 0), this.isOpen = !1, this.checkCount = 0;
|
|
6084
6120
|
}
|
|
6085
6121
|
}
|
|
6086
|
-
class
|
|
6122
|
+
class Js {
|
|
6087
6123
|
constructor(t) {
|
|
6088
6124
|
if (this.detected = !1, !t.onDetected)
|
|
6089
6125
|
throw new Error("onDetected callback is required");
|
|
@@ -6118,7 +6154,7 @@ class Ks {
|
|
|
6118
6154
|
this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
|
|
6119
6155
|
}
|
|
6120
6156
|
}
|
|
6121
|
-
class
|
|
6157
|
+
class Zs {
|
|
6122
6158
|
constructor(t = {}) {
|
|
6123
6159
|
this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
|
|
6124
6160
|
}
|
|
@@ -6144,7 +6180,7 @@ class Js {
|
|
|
6144
6180
|
this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
|
|
6145
6181
|
}
|
|
6146
6182
|
}
|
|
6147
|
-
class
|
|
6183
|
+
class Qs {
|
|
6148
6184
|
constructor(t = {}) {
|
|
6149
6185
|
this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
|
|
6150
6186
|
}
|
|
@@ -6176,7 +6212,7 @@ class Ge {
|
|
|
6176
6212
|
window.dispatchEvent(i);
|
|
6177
6213
|
}
|
|
6178
6214
|
constructor(t = {}) {
|
|
6179
|
-
t.monitorDevTools && (this.devToolsDetector = new
|
|
6215
|
+
t.monitorDevTools && (this.devToolsDetector = new Ks({
|
|
6180
6216
|
onDetected: () => {
|
|
6181
6217
|
this.dispatchSuspiciousActivity("developer_tools", {
|
|
6182
6218
|
targetFrameSrc: "",
|
|
@@ -6189,20 +6225,20 @@ class Ge {
|
|
|
6189
6225
|
metaKey: !1
|
|
6190
6226
|
});
|
|
6191
6227
|
}
|
|
6192
|
-
})), t.checkAutomation && (this.automationDetector = new
|
|
6228
|
+
})), t.checkAutomation && (this.automationDetector = new Vs({
|
|
6193
6229
|
onDetected: (e) => {
|
|
6194
6230
|
this.dispatchSuspiciousActivity("automation_detected", { tool: e });
|
|
6195
6231
|
}
|
|
6196
|
-
})), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new
|
|
6232
|
+
})), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Js({
|
|
6197
6233
|
onDetected: (e) => {
|
|
6198
6234
|
this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
|
|
6199
6235
|
}
|
|
6200
|
-
})), t.protectPrinting?.disable && (this.printProtector = new
|
|
6236
|
+
})), t.protectPrinting?.disable && (this.printProtector = new Zs({
|
|
6201
6237
|
...t.protectPrinting,
|
|
6202
6238
|
onPrintAttempt: () => {
|
|
6203
6239
|
this.dispatchSuspiciousActivity("print", {});
|
|
6204
6240
|
}
|
|
6205
|
-
})), t.disableContextMenu && (this.contextMenuProtector = new
|
|
6241
|
+
})), t.disableContextMenu && (this.contextMenuProtector = new Qs({
|
|
6206
6242
|
onContextMenuBlocked: (e) => {
|
|
6207
6243
|
this.dispatchSuspiciousActivity("context_menu", e);
|
|
6208
6244
|
}
|
|
@@ -6238,7 +6274,7 @@ class Ye {
|
|
|
6238
6274
|
this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = void 0);
|
|
6239
6275
|
}
|
|
6240
6276
|
}
|
|
6241
|
-
const
|
|
6277
|
+
const tr = (r) => ({
|
|
6242
6278
|
frameLoaded: r.frameLoaded || (() => {
|
|
6243
6279
|
}),
|
|
6244
6280
|
positionChanged: r.positionChanged || (() => {
|
|
@@ -6261,18 +6297,18 @@ const Qs = (r) => ({
|
|
|
6261
6297
|
peripheral: r.peripheral || (() => {
|
|
6262
6298
|
})
|
|
6263
6299
|
});
|
|
6264
|
-
class
|
|
6300
|
+
class er extends cn {
|
|
6265
6301
|
constructor(t, e, i, n = void 0, s = { preferences: {}, defaults: {} }) {
|
|
6266
6302
|
super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
|
|
6267
6303
|
readingOrder: [],
|
|
6268
6304
|
progressions: /* @__PURE__ */ new Map(),
|
|
6269
6305
|
positions: null
|
|
6270
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
6271
|
-
rsProperties: new
|
|
6272
|
-
userProperties: new
|
|
6306
|
+
}, this.pub = e, this.container = t, this.listeners = tr(i), this._preferences = new Nt(s.preferences), this._defaults = new Fs(s.defaults), this._settings = new Ri(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new zs({
|
|
6307
|
+
rsProperties: new Ns({ experiments: this._settings.experiments || null }),
|
|
6308
|
+
userProperties: new mn({ zoom: this._settings.zoom })
|
|
6273
6309
|
});
|
|
6274
|
-
const o =
|
|
6275
|
-
if (this._injector = new
|
|
6310
|
+
const o = Hs(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
|
|
6311
|
+
if (this._injector = new vn({
|
|
6276
6312
|
rules: [...o, ...a.rules],
|
|
6277
6313
|
allowedDomains: a.allowedDomains
|
|
6278
6314
|
}), this._contentProtection = s.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
@@ -6296,7 +6332,7 @@ class tr extends cn {
|
|
|
6296
6332
|
async load() {
|
|
6297
6333
|
await this.updateCSS(!1);
|
|
6298
6334
|
const t = this.compileCSSProperties(this._css);
|
|
6299
|
-
this.framePool = new
|
|
6335
|
+
this.framePool = new Os(
|
|
6300
6336
|
this.container,
|
|
6301
6337
|
t,
|
|
6302
6338
|
this._injector,
|
|
@@ -6437,7 +6473,7 @@ class tr extends cn {
|
|
|
6437
6473
|
}
|
|
6438
6474
|
}
|
|
6439
6475
|
determineModules() {
|
|
6440
|
-
const t =
|
|
6476
|
+
const t = gs.slice(), e = bt(this.pub.metadata);
|
|
6441
6477
|
return e === "cjk-vertical" || e === "mongolian-vertical" ? t.map((i) => i === "webpub_snapper" ? "cjk_vertical_snapper" : i) : t;
|
|
6442
6478
|
}
|
|
6443
6479
|
attachListener() {
|
|
@@ -6576,7 +6612,7 @@ class tr extends cn {
|
|
|
6576
6612
|
});
|
|
6577
6613
|
}
|
|
6578
6614
|
}
|
|
6579
|
-
const
|
|
6615
|
+
const Fr = er, ir = (r) => {
|
|
6580
6616
|
const t = r.join(" ");
|
|
6581
6617
|
return [
|
|
6582
6618
|
// 'self' is useless because the document is loaded from a blob: URL
|
|
@@ -6601,7 +6637,7 @@ const Dr = tr, er = (r) => {
|
|
|
6601
6637
|
//`report-uri ?`,
|
|
6602
6638
|
].join("; ");
|
|
6603
6639
|
};
|
|
6604
|
-
class
|
|
6640
|
+
class En {
|
|
6605
6641
|
constructor(t, e, i, n) {
|
|
6606
6642
|
this.injector = null, this.pub = t, this.item = i, this.burl = i.toURL(e) || "", this.cssProperties = n.cssProperties, this.injector = n.injector ?? null;
|
|
6607
6643
|
}
|
|
@@ -6655,7 +6691,7 @@ class Pn {
|
|
|
6655
6691
|
u.href = i, u.dataset.readium = "true", t.head.firstChild.before(u);
|
|
6656
6692
|
}
|
|
6657
6693
|
const c = t.createElement("meta");
|
|
6658
|
-
return c.httpEquiv = "Content-Security-Policy", c.content =
|
|
6694
|
+
return c.httpEquiv = "Content-Security-Policy", c.content = ir(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
|
|
6659
6695
|
new Blob([new XMLSerializer().serializeToString(t)], {
|
|
6660
6696
|
type: n.isHTML ? n.string : "application/xhtml+xml"
|
|
6661
6697
|
// Fallback to XHTML
|
|
@@ -6663,7 +6699,7 @@ class Pn {
|
|
|
6663
6699
|
);
|
|
6664
6700
|
}
|
|
6665
6701
|
}
|
|
6666
|
-
class
|
|
6702
|
+
class _n {
|
|
6667
6703
|
constructor(t, e = {}, i = []) {
|
|
6668
6704
|
this.hidden = !0, this.destroyed = !1, this.currModules = [], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.opacity = "0", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transition = "visibility 0s, opacity 0.1s linear", this.source = t, this.contentProtectionConfig = { ...e }, this.keyboardPeripheralsConfig = [...i];
|
|
6669
6705
|
}
|
|
@@ -6701,10 +6737,15 @@ class En {
|
|
|
6701
6737
|
});
|
|
6702
6738
|
}
|
|
6703
6739
|
applyContentProtection() {
|
|
6704
|
-
this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && this.
|
|
6740
|
+
this.comms || this.comms.resume(), this.comms.send("peripherals_protection", this.contentProtectionConfig), this.keyboardPeripheralsConfig && this.keyboardPeripheralsConfig.length > 0 && (this.conditionBridge?.destroy(), this.conditionBridge = new fn(
|
|
6741
|
+
this.keyboardPeripheralsConfig,
|
|
6742
|
+
(t) => {
|
|
6743
|
+
t.length > 0 && this.comms.send("keyboard_peripherals", t);
|
|
6744
|
+
}
|
|
6745
|
+
), this.conditionBridge.setup()), this.contentProtectionConfig.monitorScrollingExperimental && this.comms.send("scroll_protection", {}), this.contentProtectionConfig.protectPrinting?.disable && this.comms.send("print_protection", this.contentProtectionConfig.protectPrinting);
|
|
6705
6746
|
}
|
|
6706
6747
|
async destroy() {
|
|
6707
|
-
await this.hide(), this.loader?.destroy(), this.frame.remove(), this.destroyed = !0;
|
|
6748
|
+
this.conditionBridge?.destroy(), await this.hide(), this.loader?.destroy(), this.frame.remove(), this.destroyed = !0;
|
|
6708
6749
|
}
|
|
6709
6750
|
async hide() {
|
|
6710
6751
|
if (!this.destroyed) {
|
|
@@ -6764,7 +6805,7 @@ class En {
|
|
|
6764
6805
|
}
|
|
6765
6806
|
}
|
|
6766
6807
|
const zi = 5, Ii = 3;
|
|
6767
|
-
class
|
|
6808
|
+
class nr {
|
|
6768
6809
|
constructor(t, e, i, n, s, o) {
|
|
6769
6810
|
this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.injector = null, this.container = t, this.positions = e, this.currentCssProperties = i, this.injector = n ?? null, this.contentProtectionConfig = s || {}, this.keyboardPeripheralsConfig = o || [];
|
|
6770
6811
|
}
|
|
@@ -6816,7 +6857,7 @@ class ir {
|
|
|
6816
6857
|
const f = t.readingOrder.findWithHref(d);
|
|
6817
6858
|
if (!f) return;
|
|
6818
6859
|
if (!this.blobs.has(d)) {
|
|
6819
|
-
const R = await new
|
|
6860
|
+
const R = await new En(
|
|
6820
6861
|
t,
|
|
6821
6862
|
this.currentBaseURL || "",
|
|
6822
6863
|
f,
|
|
@@ -6827,7 +6868,7 @@ class ir {
|
|
|
6827
6868
|
).build();
|
|
6828
6869
|
this.blobs.set(d, R);
|
|
6829
6870
|
}
|
|
6830
|
-
const w = new
|
|
6871
|
+
const w = new _n(this.blobs.get(d), this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
6831
6872
|
d !== o && await w.hide(), this.container.appendChild(w.iframe), await w.load(i), this.pool.set(d, w);
|
|
6832
6873
|
};
|
|
6833
6874
|
try {
|
|
@@ -6881,7 +6922,7 @@ class ir {
|
|
|
6881
6922
|
}), t;
|
|
6882
6923
|
}
|
|
6883
6924
|
}
|
|
6884
|
-
class
|
|
6925
|
+
class sr {
|
|
6885
6926
|
constructor(t, e, i, n = {}, s = []) {
|
|
6886
6927
|
this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = i, this.contentProtectionConfig = { ...n }, this.keyboardPeripheralsConfig = [...s], this.frame = document.createElement("iframe"), this.frame.sandbox.value = "allow-same-origin allow-scripts", this.frame.classList.add("readium-navigator-iframe"), this.frame.classList.add("blank"), this.frame.scrolling = "no", this.frame.style.visibility = "hidden", this.frame.style.setProperty("aria-hidden", "true"), this.frame.style.display = "none", this.frame.style.position = "absolute", this.frame.style.pointerEvents = "none", this.frame.style.transformOrigin = "0 0", this.frame.style.transform = "scale(1)", this.frame.style.background = "#fff", this.frame.style.touchAction = "none", this.frame.dataset.originalHref = i, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === N.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
|
|
6887
6928
|
}
|
|
@@ -7047,8 +7088,8 @@ class nr {
|
|
|
7047
7088
|
return this.loader;
|
|
7048
7089
|
}
|
|
7049
7090
|
}
|
|
7050
|
-
var
|
|
7051
|
-
class
|
|
7091
|
+
var rr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(rr || {}), or = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(or || {});
|
|
7092
|
+
class ar {
|
|
7052
7093
|
constructor() {
|
|
7053
7094
|
this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
|
|
7054
7095
|
}
|
|
@@ -7096,7 +7137,7 @@ class or {
|
|
|
7096
7137
|
};
|
|
7097
7138
|
}
|
|
7098
7139
|
}
|
|
7099
|
-
class
|
|
7140
|
+
class lr {
|
|
7100
7141
|
constructor() {
|
|
7101
7142
|
this._DOM = {
|
|
7102
7143
|
show: !1,
|
|
@@ -7115,7 +7156,7 @@ class ar {
|
|
|
7115
7156
|
}
|
|
7116
7157
|
}
|
|
7117
7158
|
const Di = 6, ye = 1.02, Fi = 50;
|
|
7118
|
-
class
|
|
7159
|
+
class hr {
|
|
7119
7160
|
constructor(t, e = !1) {
|
|
7120
7161
|
this.dragState = 0, this.minimumMoved = !1, this.pan = {
|
|
7121
7162
|
startX: 0,
|
|
@@ -7134,7 +7175,7 @@ class lr {
|
|
|
7134
7175
|
target: { X: 0, Y: 0 },
|
|
7135
7176
|
touchN: 0,
|
|
7136
7177
|
startTranslate: { X: 0, Y: 0 }
|
|
7137
|
-
}, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new
|
|
7178
|
+
}, this._scale = 1, this.scaleDebouncer = 0, this.frameBounds = null, this.debugger = null, this.btouchstartHandler = this.touchstartHandler.bind(this), this.btouchendHandler = this.touchendHandler.bind(this), this.btouchmoveHandler = this.touchmoveHandler.bind(this), this.bdblclickHandler = this.dblclickHandler.bind(this), this.bmousedownHandler = this.mousedownHandler.bind(this), this.bmouseupHandler = this.mouseupHandler.bind(this), this.bmousemoveHandler = this.mousemoveHandler.bind(this), this.moveFrame = 0, this.manager = t, this.coordinator = new ar(), this.attachEvents(), e && (this.debugger = new lr());
|
|
7138
7179
|
}
|
|
7139
7180
|
get scale() {
|
|
7140
7181
|
return this._scale;
|
|
@@ -7336,7 +7377,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
|
|
|
7336
7377
|
}
|
|
7337
7378
|
}
|
|
7338
7379
|
var Me = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(Me || {}), Ne = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(Ne || {});
|
|
7339
|
-
class
|
|
7380
|
+
class cr {
|
|
7340
7381
|
// TODO getter
|
|
7341
7382
|
constructor(t) {
|
|
7342
7383
|
this.shift = !0, this.spreads = [], this.nLandscape = 0, this.index(t), this.testShift(t), console.log(`Indexed ${this.spreads.length} spreads for ${t.readingOrder.items.length} items`);
|
|
@@ -7381,13 +7422,13 @@ class hr {
|
|
|
7381
7422
|
return this.spreads.find((e) => e.includes(t)) || void 0;
|
|
7382
7423
|
}
|
|
7383
7424
|
}
|
|
7384
|
-
const Wi = 8, Ui = 5,
|
|
7385
|
-
class
|
|
7425
|
+
const Wi = 8, Ui = 5, dr = 300, ur = 15e3, pr = 250, fr = 150, mr = 500;
|
|
7426
|
+
class gr {
|
|
7386
7427
|
constructor(t, e, i, n, s, o) {
|
|
7387
7428
|
if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.injector = null, this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = i, this.injector = n ?? null, this.contentProtectionConfig = s || {}, this.keyboardPeripheralsConfig = o || [], this.spreadPresentation = i.metadata.otherMetadata?.spread || Ne.auto, this.pub.metadata.effectiveReadingProgression !== N.rtl && this.pub.metadata.effectiveReadingProgression !== N.ltr)
|
|
7388
7429
|
throw Error("Unsupported reading progression for EPUB");
|
|
7389
|
-
this.spreader = new
|
|
7390
|
-
const l = new
|
|
7430
|
+
this.spreader = new cr(this.pub), this.containerHeightCached = t.clientHeight, this.bookElement = document.createElement("div"), this.bookElement.ariaLabel = "Book", this.bookElement.tabIndex = -1, this.updateBookStyle(!0), this.spineElement = document.createElement("div"), this.spineElement.ariaLabel = "Spine", this.bookElement.appendChild(this.spineElement), this.container.appendChild(this.bookElement), this.updateSpineStyle(!0), this.peripherals = new hr(this), this.pub.readingOrder.items.forEach((a) => {
|
|
7431
|
+
const l = new sr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
|
|
7391
7432
|
this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === Me.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
|
|
7392
7433
|
});
|
|
7393
7434
|
}
|
|
@@ -7412,7 +7453,7 @@ class mr {
|
|
|
7412
7453
|
const a = this.spreader.findByLink(o);
|
|
7413
7454
|
i.update(this.spreadPosition(a, o));
|
|
7414
7455
|
});
|
|
7415
|
-
},
|
|
7456
|
+
}, pr);
|
|
7416
7457
|
}
|
|
7417
7458
|
/**
|
|
7418
7459
|
* It is important that these values be cached to avoid spamming them on redraws, they are expensive.
|
|
@@ -7439,7 +7480,7 @@ class mr {
|
|
|
7439
7480
|
let i = "0";
|
|
7440
7481
|
this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
|
|
7441
7482
|
const n = {
|
|
7442
|
-
transition: t ? `all ${e ?
|
|
7483
|
+
transition: t ? `all ${e ? fr : mr}ms ease-out` : "all 0ms ease-out",
|
|
7443
7484
|
marginRight: this.rtl ? i : "0",
|
|
7444
7485
|
marginLeft: this.rtl ? "0" : i,
|
|
7445
7486
|
width: `${this.width / this.perPage * this.length}px`,
|
|
@@ -7607,7 +7648,7 @@ class mr {
|
|
|
7607
7648
|
const f = t.readingOrder.findIndexWithHref(d), w = t.readingOrder.items[f];
|
|
7608
7649
|
if (w) {
|
|
7609
7650
|
if (!this.blobs.has(d)) {
|
|
7610
|
-
const R = await new
|
|
7651
|
+
const R = await new En(
|
|
7611
7652
|
t,
|
|
7612
7653
|
this.currentBaseURL || "",
|
|
7613
7654
|
w,
|
|
@@ -7621,12 +7662,12 @@ class mr {
|
|
|
7621
7662
|
let Y = !1;
|
|
7622
7663
|
const lt = window.setTimeout(async () => {
|
|
7623
7664
|
this.delayedTimeout.set(d, 0);
|
|
7624
|
-
const ht = this.makeSpread(this.reAlign(f)),
|
|
7625
|
-
await Je.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Je.show(
|
|
7626
|
-
},
|
|
7665
|
+
const ht = this.makeSpread(this.reAlign(f)), xn = this.spreadPosition(ht, w), Je = this.pool.get(d);
|
|
7666
|
+
await Je.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Je.show(xn), this.delayedShow.delete(d), Y = !0, P();
|
|
7667
|
+
}, dr);
|
|
7627
7668
|
setTimeout(() => {
|
|
7628
7669
|
!Y && this.delayedShow.has(d) && R(`Offscreen load timeout: ${d}`);
|
|
7629
|
-
},
|
|
7670
|
+
}, ur), this.delayedTimeout.set(d, lt);
|
|
7630
7671
|
}));
|
|
7631
7672
|
}
|
|
7632
7673
|
};
|
|
@@ -7725,18 +7766,18 @@ class zt {
|
|
|
7725
7766
|
return new zt(e);
|
|
7726
7767
|
}
|
|
7727
7768
|
}
|
|
7728
|
-
class
|
|
7769
|
+
class yr {
|
|
7729
7770
|
constructor(t) {
|
|
7730
|
-
this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = wt(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = z(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = z(t.fontWeight, st.range) || null, this.fontWidth = z(t.fontWidth, qt.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = wt(t.invertFilter) ?? !1, this.invertGaijiFilter = wt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = ge(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = he(t.textAlign, tt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = ge(
|
|
7771
|
+
this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = v(t.constraint) || 0, this.columnCount = v(t.columnCount) || null, this.darkenFilter = wt(t.darkenFilter) ?? !1, this.deprecatedFontSize = E(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = W(t.fontFamily) || null, this.fontSize = z(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = z(t.fontWeight, st.range) || null, this.fontWidth = z(t.fontWidth, qt.range) || null, this.hyphens = E(t.hyphens) ?? null, this.invertFilter = wt(t.invertFilter) ?? !1, this.invertGaijiFilter = wt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (T.OS.iOS || T.OS.iPadOS) && T.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : T.OS.iPadOS && T.iOSRequest === "desktop", this.letterSpacing = v(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = v(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = ge(v(t.pageGutter), 20), this.paragraphIndent = v(t.paragraphIndent) ?? null, this.paragraphSpacing = v(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = v(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = v(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = v(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = v(t.scrollPaddingRight) ?? null, this.selectionBackgroundColor = W(t.selectionBackgroundColor) || null, this.selectionTextColor = W(t.selectionTextColor) || null, this.textAlign = he(t.textAlign, tt) || null, this.textColor = W(t.textColor) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.visitedColor = W(t.visitedColor) || null, this.wordSpacing = v(t.wordSpacing) || null, this.optimalLineLength = v(t.optimalLineLength) || 65, this.maximalLineLength = ge(Ds(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ge(Is(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = gn(t.experiments) || null;
|
|
7731
7772
|
}
|
|
7732
7773
|
}
|
|
7733
|
-
const
|
|
7734
|
-
RS__backgroundColor:
|
|
7735
|
-
RS__textColor:
|
|
7736
|
-
RS__linkColor:
|
|
7737
|
-
RS__visitedColor:
|
|
7738
|
-
RS__selectionBackgroundColor:
|
|
7739
|
-
RS__selectionTextColor:
|
|
7774
|
+
const br = "#FFFFFF", wr = "#121212", vr = "#0000EE", Sr = "#551A8B", Pr = "#b4d8fe", Er = "inherit", pt = {
|
|
7775
|
+
RS__backgroundColor: br,
|
|
7776
|
+
RS__textColor: wr,
|
|
7777
|
+
RS__linkColor: vr,
|
|
7778
|
+
RS__visitedColor: Sr,
|
|
7779
|
+
RS__selectionBackgroundColor: Pr,
|
|
7780
|
+
RS__selectionTextColor: Er
|
|
7740
7781
|
};
|
|
7741
7782
|
class Bi {
|
|
7742
7783
|
constructor(t, e, i) {
|
|
@@ -8130,7 +8171,7 @@ class Bi {
|
|
|
8130
8171
|
});
|
|
8131
8172
|
}
|
|
8132
8173
|
get textAlign() {
|
|
8133
|
-
return new
|
|
8174
|
+
return new yn({
|
|
8134
8175
|
initialValue: this.preferences.textAlign,
|
|
8135
8176
|
effectiveValue: this.settings.textAlign || tt.start,
|
|
8136
8177
|
isEffective: this.layout !== b.fixed && this.preferences.textAlign !== null,
|
|
@@ -8192,11 +8233,11 @@ function Lt(r) {
|
|
|
8192
8233
|
const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
|
|
8193
8234
|
return r.clientWidth - e - i;
|
|
8194
8235
|
}
|
|
8195
|
-
function
|
|
8236
|
+
function _r(r) {
|
|
8196
8237
|
const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
|
|
8197
8238
|
return r.clientHeight - e - i;
|
|
8198
8239
|
}
|
|
8199
|
-
class
|
|
8240
|
+
class Cn extends le {
|
|
8200
8241
|
constructor(t) {
|
|
8201
8242
|
super(), this.a11yNormalize = t.a11yNormalize ?? null, this.backgroundColor = t.backgroundColor ?? null, this.blendFilter = t.blendFilter ?? null, this.bodyHyphens = t.bodyHyphens ?? null, this.colCount = t.colCount ?? null, this.darkenFilter = t.darkenFilter ?? null, this.deprecatedFontSize = t.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily ?? null, this.fontOpticalSizing = t.fontOpticalSizing ?? null, this.fontSize = t.fontSize ?? null, this.fontSizeNormalize = t.fontSizeNormalize ?? null, this.fontWeight = t.fontWeight ?? null, this.fontWidth = t.fontWidth ?? null, this.invertFilter = t.invertFilter ?? null, this.invertGaijiFilter = t.invertGaijiFilter ?? null, this.iOSPatch = t.iOSPatch ?? null, this.iPadOSPatch = t.iPadOSPatch ?? null, this.letterSpacing = t.letterSpacing ?? null, this.ligatures = t.ligatures ?? null, this.lineHeight = t.lineHeight ?? null, this.lineLength = t.lineLength ?? null, this.linkColor = t.linkColor ?? null, this.noRuby = t.noRuby ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.textAlign = t.textAlign ?? null, this.textColor = t.textColor ?? null, this.view = t.view ?? null, this.visitedColor = t.visitedColor ?? null, this.wordSpacing = t.wordSpacing ?? null;
|
|
8202
8243
|
}
|
|
@@ -8205,7 +8246,7 @@ class _n extends le {
|
|
|
8205
8246
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.backgroundColor && (t["--USER__backgroundColor"] = this.backgroundColor), this.blendFilter && (t["--USER__blendFilter"] = this.toFlag("blend")), this.bodyHyphens && (t["--USER__bodyHyphens"] = this.bodyHyphens), this.colCount && (t["--USER__colCount"] = this.toUnitless(this.colCount)), this.darkenFilter === !0 ? t["--USER__darkenFilter"] = this.toFlag("darken") : typeof this.darkenFilter == "number" && (t["--USER__darkenFilter"] = this.toPercentage(this.darkenFilter)), this.deprecatedFontSize && (t["--USER__fontSizeImplementation"] = this.toFlag("deprecatedFontSize")), this.fontFamily && (t["--USER__fontFamily"] = this.fontFamily), this.fontOpticalSizing != null && (t["--USER__fontOpticalSizing"] = this.fontOpticalSizing), this.fontSize != null && (t["--USER__fontSize"] = this.toPercentage(this.fontSize, !0)), this.fontSizeNormalize && (t["--USER__fontSizeNormalize"] = this.toFlag("normalize")), this.fontWeight != null && (t["--USER__fontWeight"] = this.toUnitless(this.fontWeight)), this.fontWidth != null && (t["--USER__fontWidth"] = typeof this.fontWidth == "string" ? this.fontWidth : this.toUnitless(this.fontWidth)), this.invertFilter === !0 ? t["--USER__invertFilter"] = this.toFlag("invert") : typeof this.invertFilter == "number" && (t["--USER__invertFilter"] = this.toPercentage(this.invertFilter)), this.invertGaijiFilter === !0 ? t["--USER__invertGaiji"] = this.toFlag("invertGaiji") : typeof this.invertGaijiFilter == "number" && (t["--USER__invertGaiji"] = this.toPercentage(this.invertGaijiFilter)), this.iOSPatch && (t["--USER__iOSPatch"] = this.toFlag("iOSPatch")), this.iPadOSPatch && (t["--USER__iPadOSPatch"] = this.toFlag("iPadOSPatch")), this.letterSpacing != null && (t["--USER__letterSpacing"] = this.toRem(this.letterSpacing)), this.ligatures && (t["--USER__ligatures"] = this.ligatures), this.lineHeight != null && (t["--USER__lineHeight"] = this.toUnitless(this.lineHeight)), this.lineLength != null && (t["--USER__lineLength"] = this.toPx(this.lineLength)), this.linkColor && (t["--USER__linkColor"] = this.linkColor), this.noRuby && (t["--USER__noRuby"] = this.toFlag("noRuby")), this.paraIndent != null && (t["--USER__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--USER__paraSpacing"] = this.toRem(this.paraSpacing)), this.selectionBackgroundColor && (t["--USER__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--USER__selectionTextColor"] = this.selectionTextColor), this.textAlign && (t["--USER__textAlign"] = this.textAlign), this.textColor && (t["--USER__textColor"] = this.textColor), this.view && (t["--USER__view"] = this.toFlag(this.view)), this.visitedColor && (t["--USER__visitedColor"] = this.visitedColor), this.wordSpacing != null && (t["--USER__wordSpacing"] = this.toRem(this.wordSpacing)), t;
|
|
8206
8247
|
}
|
|
8207
8248
|
}
|
|
8208
|
-
class
|
|
8249
|
+
class Cr extends le {
|
|
8209
8250
|
constructor(t) {
|
|
8210
8251
|
super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingLeft = t.scrollPaddingLeft ?? null, this.scrollPaddingRight = t.scrollPaddingRight ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null, this.experiments = t.experiments ?? null;
|
|
8211
8252
|
}
|
|
@@ -8216,7 +8257,7 @@ class _r extends le {
|
|
|
8216
8257
|
}), t;
|
|
8217
8258
|
}
|
|
8218
8259
|
}
|
|
8219
|
-
class
|
|
8260
|
+
class Lr {
|
|
8220
8261
|
constructor(t) {
|
|
8221
8262
|
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.isCJKVertical = t.isCJKVertical ?? !1, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Lt(this.containerParent);
|
|
8222
8263
|
}
|
|
@@ -8266,7 +8307,7 @@ class Cr {
|
|
|
8266
8307
|
visitedColor: t.visitedColor,
|
|
8267
8308
|
wordSpacing: t.wordSpacing
|
|
8268
8309
|
};
|
|
8269
|
-
this.userProperties = new
|
|
8310
|
+
this.userProperties = new Cn(i);
|
|
8270
8311
|
}
|
|
8271
8312
|
updateLayout(t, e, i, n) {
|
|
8272
8313
|
return this.isCJKVertical ? this.computeCJKVerticalLength(t, e) : i ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, n);
|
|
@@ -8330,7 +8371,7 @@ class Cr {
|
|
|
8330
8371
|
};
|
|
8331
8372
|
}
|
|
8332
8373
|
computeCJKVerticalLength(t, e) {
|
|
8333
|
-
const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(
|
|
8374
|
+
const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(_r(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
|
|
8334
8375
|
return { colCount: void 0, effectiveContainerWidth: i, effectiveLineLength: o };
|
|
8335
8376
|
}
|
|
8336
8377
|
// This behaves as paginate where colCount = 1
|
|
@@ -8357,7 +8398,7 @@ class Cr {
|
|
|
8357
8398
|
this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
|
|
8358
8399
|
}
|
|
8359
8400
|
}
|
|
8360
|
-
const
|
|
8401
|
+
const xr = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
|
|
8361
8402
|
// For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
|
|
8362
8403
|
// The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
|
|
8363
8404
|
(function() {
|
|
@@ -8423,21 +8464,21 @@ const Lr = `// Note: we aren't blocking some of the events right now to try and
|
|
|
8423
8464
|
window.addEventListener("load", window._readium_eventBlocker, true);
|
|
8424
8465
|
})();
|
|
8425
8466
|
`;
|
|
8426
|
-
async function
|
|
8467
|
+
async function kr(r, t) {
|
|
8427
8468
|
const e = r.effectiveLayout === b.fixed, i = t.filter((a) => a.mediaType.isHTML).map((a) => a.href), n = i.length > 0 ? i : [/\.xhtml$/, /\.html$/], s = [
|
|
8428
8469
|
// CSS Selector Generator - always injected
|
|
8429
8470
|
{
|
|
8430
8471
|
id: "css-selector-generator",
|
|
8431
8472
|
as: "script",
|
|
8432
8473
|
target: "head",
|
|
8433
|
-
blob: new Blob([vt(
|
|
8474
|
+
blob: new Blob([vt(Sn)], { type: "text/javascript" })
|
|
8434
8475
|
},
|
|
8435
8476
|
// Execution Prevention - conditional (has executable scripts)
|
|
8436
8477
|
{
|
|
8437
8478
|
id: "execution-prevention",
|
|
8438
8479
|
as: "script",
|
|
8439
8480
|
target: "head",
|
|
8440
|
-
blob: new Blob([vt(
|
|
8481
|
+
blob: new Blob([vt(xr)], { type: "text/javascript" }),
|
|
8441
8482
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
8442
8483
|
}
|
|
8443
8484
|
], o = [
|
|
@@ -8446,7 +8487,7 @@ async function xr(r, t) {
|
|
|
8446
8487
|
id: "onload-proxy",
|
|
8447
8488
|
as: "script",
|
|
8448
8489
|
target: "head",
|
|
8449
|
-
blob: new Blob([vt(
|
|
8490
|
+
blob: new Blob([vt(Pn)], { type: "text/javascript" }),
|
|
8450
8491
|
condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
|
|
8451
8492
|
}
|
|
8452
8493
|
];
|
|
@@ -8538,7 +8579,7 @@ async function xr(r, t) {
|
|
|
8538
8579
|
}
|
|
8539
8580
|
];
|
|
8540
8581
|
}
|
|
8541
|
-
const
|
|
8582
|
+
const Or = (r) => ({
|
|
8542
8583
|
frameLoaded: r.frameLoaded || (() => {
|
|
8543
8584
|
}),
|
|
8544
8585
|
positionChanged: r.positionChanged || (() => {
|
|
@@ -8563,17 +8604,17 @@ const kr = (r) => ({
|
|
|
8563
8604
|
peripheral: r.peripheral || (() => {
|
|
8564
8605
|
})
|
|
8565
8606
|
});
|
|
8566
|
-
class
|
|
8607
|
+
class Ln extends cn {
|
|
8567
8608
|
constructor(t, e, i, n = [], s = void 0, o = { preferences: {}, defaults: {} }) {
|
|
8568
8609
|
super(), this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.reflowViewport = {
|
|
8569
8610
|
readingOrder: [],
|
|
8570
8611
|
progressions: /* @__PURE__ */ new Map(),
|
|
8571
8612
|
positions: null
|
|
8572
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
8613
|
+
}, this.pub = e, this.container = t, this.listeners = Or(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new zt(o.preferences), this._defaults = new yr(o.defaults), this._settings = new Hi(this._preferences, this._defaults);
|
|
8573
8614
|
const a = bt(e.metadata), l = a === "cjk-horizontal", h = a === "cjk-vertical", u = h || a === "mongolian-vertical", p = l || h;
|
|
8574
|
-
this._css = new
|
|
8575
|
-
rsProperties: new
|
|
8576
|
-
userProperties: new
|
|
8615
|
+
this._css = new Lr({
|
|
8616
|
+
rsProperties: new Cr({ noVerticalPagination: u || void 0 }),
|
|
8617
|
+
userProperties: new Cn({}),
|
|
8577
8618
|
lineLengths: new kt({
|
|
8578
8619
|
optimalChars: this._settings.optimalLineLength,
|
|
8579
8620
|
minChars: this._settings.minimalLineLength,
|
|
@@ -8588,7 +8629,7 @@ class Cn extends cn {
|
|
|
8588
8629
|
container: t,
|
|
8589
8630
|
constraint: this._settings.constraint,
|
|
8590
8631
|
isCJKVertical: u
|
|
8591
|
-
}), this._layout =
|
|
8632
|
+
}), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = kr(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
|
|
8592
8633
|
this._contentProtection,
|
|
8593
8634
|
o.keyboardPeripherals || []
|
|
8594
8635
|
), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ge(this._contentProtection), this._suspiciousActivityListener = (g) => {
|
|
@@ -8613,13 +8654,13 @@ class Cn extends cn {
|
|
|
8613
8654
|
async load() {
|
|
8614
8655
|
if (this.positions?.length || (this.positions = await this.pub.positionsFromManifest()), !this._injector) {
|
|
8615
8656
|
const t = await this._readiumRulesPromise;
|
|
8616
|
-
this._injector = new
|
|
8657
|
+
this._injector = new vn({
|
|
8617
8658
|
rules: [...t, ...this._injectablesConfig.rules],
|
|
8618
8659
|
allowedDomains: this._injectablesConfig.allowedDomains
|
|
8619
8660
|
});
|
|
8620
8661
|
}
|
|
8621
8662
|
if (this._layout === b.fixed)
|
|
8622
|
-
this.framePool = new
|
|
8663
|
+
this.framePool = new gr(
|
|
8623
8664
|
this.container,
|
|
8624
8665
|
this.positions,
|
|
8625
8666
|
this.pub,
|
|
@@ -8632,7 +8673,7 @@ class Cn extends cn {
|
|
|
8632
8673
|
else {
|
|
8633
8674
|
await this.updateCSS(!1);
|
|
8634
8675
|
const t = this.compileCSSProperties(this._css);
|
|
8635
|
-
this.framePool = new
|
|
8676
|
+
this.framePool = new nr(
|
|
8636
8677
|
this.container,
|
|
8637
8678
|
this.positions,
|
|
8638
8679
|
t,
|
|
@@ -8702,7 +8743,7 @@ class Cn extends cn {
|
|
|
8702
8743
|
* TODO remove when settings management is incorporated
|
|
8703
8744
|
*/
|
|
8704
8745
|
get _cframes() {
|
|
8705
|
-
return (this.framePool?.currentFrames ?? []).filter((t) => !(t instanceof
|
|
8746
|
+
return (this.framePool?.currentFrames ?? []).filter((t) => !(t instanceof _n && t.isDestroyed));
|
|
8706
8747
|
}
|
|
8707
8748
|
/**
|
|
8708
8749
|
* Exposed to the public to compensate for lack of implemented readium conveniences
|
|
@@ -8823,8 +8864,8 @@ class Cn extends cn {
|
|
|
8823
8864
|
determineModules() {
|
|
8824
8865
|
let t = Array.from(Te.keys());
|
|
8825
8866
|
if (this._layout === b.fixed)
|
|
8826
|
-
return t.filter((n) =>
|
|
8827
|
-
t = t.filter((n) =>
|
|
8867
|
+
return t.filter((n) => fs.includes(n));
|
|
8868
|
+
t = t.filter((n) => ms.includes(n));
|
|
8828
8869
|
const e = bt(this.pub.metadata);
|
|
8829
8870
|
if (e === "cjk-vertical" || e === "mongolian-vertical")
|
|
8830
8871
|
return t.filter((n) => n !== "column_snapper" && n !== "scroll_snapper");
|
|
@@ -9022,7 +9063,7 @@ class Cn extends cn {
|
|
|
9022
9063
|
return this.go(t.locator, e, i);
|
|
9023
9064
|
}
|
|
9024
9065
|
}
|
|
9025
|
-
const
|
|
9066
|
+
const Rr = `// PreservePitchProcessor.js
|
|
9026
9067
|
// AudioWorklet processor for pitch preservation via pitch shifting.
|
|
9027
9068
|
//
|
|
9028
9069
|
// Architecture:
|
|
@@ -9247,7 +9288,7 @@ class qe {
|
|
|
9247
9288
|
if (n)
|
|
9248
9289
|
await e.audioWorklet.addModule(n);
|
|
9249
9290
|
else {
|
|
9250
|
-
const o = new Blob([
|
|
9291
|
+
const o = new Blob([Rr], { type: "text/javascript" });
|
|
9251
9292
|
s.url = URL.createObjectURL(o), await e.audioWorklet.addModule(s.url);
|
|
9252
9293
|
}
|
|
9253
9294
|
} catch (o) {
|
|
@@ -9267,7 +9308,7 @@ class qe {
|
|
|
9267
9308
|
this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
|
|
9268
9309
|
}
|
|
9269
9310
|
}
|
|
9270
|
-
class
|
|
9311
|
+
class Ar {
|
|
9271
9312
|
constructor(t) {
|
|
9272
9313
|
this.audioContext = null, this.sourceNode = null, this.gainNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.isStoppedValue = !1, this.worklet = null, this.webAudioActive = !1, this.boundOnCanPlayThrough = this.onCanPlayThrough.bind(this), this.boundOnTimeUpdate = this.onTimeUpdate.bind(this), this.boundOnError = this.onError.bind(this), this.boundOnEnded = this.onEnded.bind(this), this.boundOnStalled = this.onStalled.bind(this), this.boundOnEmptied = this.onEmptied.bind(this), this.boundOnSuspend = this.onSuspend.bind(this), this.boundOnWaiting = this.onWaiting.bind(this), this.boundOnLoadedMetadata = this.onLoadedMetadata.bind(this), this.boundOnSeeking = this.onSeeking.bind(this), this.boundOnSeeked = this.onSeeked.bind(this), this.boundOnPlay = this.onPlay.bind(this), this.boundOnPlaying = this.onPlaying.bind(this), this.boundOnPause = this.onPause.bind(this), this.boundOnProgress = this.onProgress.bind(this), this.playback = t.playback, this.mediaElement = document.createElement("audio"), this.mediaElement.addEventListener("canplaythrough", this.boundOnCanPlayThrough), this.mediaElement.addEventListener("timeupdate", this.boundOnTimeUpdate), this.mediaElement.addEventListener("error", this.boundOnError), this.mediaElement.addEventListener("ended", this.boundOnEnded), this.mediaElement.addEventListener("stalled", this.boundOnStalled), this.mediaElement.addEventListener("emptied", this.boundOnEmptied), this.mediaElement.addEventListener("suspend", this.boundOnSuspend), this.mediaElement.addEventListener("waiting", this.boundOnWaiting), this.mediaElement.addEventListener("loadedmetadata", this.boundOnLoadedMetadata), this.mediaElement.addEventListener("seeking", this.boundOnSeeking), this.mediaElement.addEventListener("seeked", this.boundOnSeeked), this.mediaElement.addEventListener("play", this.boundOnPlay), this.mediaElement.addEventListener("playing", this.boundOnPlaying), this.mediaElement.addEventListener("pause", this.boundOnPause), this.mediaElement.addEventListener("progress", this.boundOnProgress), this.mediaElement.currentTime = this.playback.state.currentTime;
|
|
9273
9314
|
}
|
|
@@ -9544,7 +9585,7 @@ class ce {
|
|
|
9544
9585
|
return new ce(e);
|
|
9545
9586
|
}
|
|
9546
9587
|
}
|
|
9547
|
-
class
|
|
9588
|
+
class Tr {
|
|
9548
9589
|
constructor(t = {}) {
|
|
9549
9590
|
this.volume = z(t.volume, ie.range) ?? 1, this.playbackRate = z(t.playbackRate, ne.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = z(t.skipBackwardInterval, it.range) ?? 10, this.skipForwardInterval = z(t.skipForwardInterval, it.range) ?? 10, this.pollInterval = v(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
|
|
9550
9591
|
}
|
|
@@ -9654,7 +9695,7 @@ class ji {
|
|
|
9654
9695
|
}
|
|
9655
9696
|
}
|
|
9656
9697
|
const $i = 1, Xi = 1;
|
|
9657
|
-
class
|
|
9698
|
+
class Mr {
|
|
9658
9699
|
constructor(t, e, i = {}) {
|
|
9659
9700
|
this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes(), i.disableRemotePlayback && (this._audioEngine.getMediaElement().disableRemotePlayback = !0);
|
|
9660
9701
|
}
|
|
@@ -9731,7 +9772,7 @@ class Tr {
|
|
|
9731
9772
|
this.pool.clear();
|
|
9732
9773
|
}
|
|
9733
9774
|
}
|
|
9734
|
-
class
|
|
9775
|
+
class Nr {
|
|
9735
9776
|
constructor(t = {}) {
|
|
9736
9777
|
this.dragstartHandler = (e) => {
|
|
9737
9778
|
e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
|
|
@@ -9747,7 +9788,7 @@ class Mr {
|
|
|
9747
9788
|
document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("dragover", this.dragoverHandler, !0), document.removeEventListener("drop", this.dropHandler, !0), window.removeEventListener("unload", this.unloadHandler);
|
|
9748
9789
|
}
|
|
9749
9790
|
}
|
|
9750
|
-
class
|
|
9791
|
+
class zr {
|
|
9751
9792
|
constructor(t = {}) {
|
|
9752
9793
|
this.copyHandler = (e) => {
|
|
9753
9794
|
e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
|
|
@@ -9757,16 +9798,16 @@ class Nr {
|
|
|
9757
9798
|
document.removeEventListener("copy", this.copyHandler, !0), window.removeEventListener("unload", this.unloadHandler);
|
|
9758
9799
|
}
|
|
9759
9800
|
}
|
|
9760
|
-
class
|
|
9801
|
+
class Ir extends Ge {
|
|
9761
9802
|
constructor(t = {}) {
|
|
9762
|
-
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new
|
|
9803
|
+
super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new Nr({
|
|
9763
9804
|
onDragDetected: (e) => {
|
|
9764
9805
|
this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
|
|
9765
9806
|
},
|
|
9766
9807
|
onDropDetected: (e, i) => {
|
|
9767
9808
|
this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
|
|
9768
9809
|
}
|
|
9769
|
-
})), t.protectCopy && (this.copyProtector = new
|
|
9810
|
+
})), t.protectCopy && (this.copyProtector = new zr({
|
|
9770
9811
|
onCopyBlocked: () => {
|
|
9771
9812
|
this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
|
|
9772
9813
|
}
|
|
@@ -9776,7 +9817,7 @@ class zr extends Ge {
|
|
|
9776
9817
|
super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
|
|
9777
9818
|
}
|
|
9778
9819
|
}
|
|
9779
|
-
const
|
|
9820
|
+
const Dr = (r) => ({
|
|
9780
9821
|
trackLoaded: r.trackLoaded ?? (() => {
|
|
9781
9822
|
}),
|
|
9782
9823
|
positionChanged: r.positionChanged ?? (() => {
|
|
@@ -9808,12 +9849,12 @@ const Ir = (r) => ({
|
|
|
9808
9849
|
remotePlaybackStateChanged: r.remotePlaybackStateChanged ?? (() => {
|
|
9809
9850
|
})
|
|
9810
9851
|
});
|
|
9811
|
-
class
|
|
9852
|
+
class Wr extends Ss {
|
|
9812
9853
|
constructor(t, e, i, n = {
|
|
9813
9854
|
preferences: {},
|
|
9814
9855
|
defaults: {}
|
|
9815
9856
|
}) {
|
|
9816
|
-
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners =
|
|
9857
|
+
if (super(), this.positionPollInterval = null, this.navigationId = 0, this._playIntent = !1, this._preferencesEditor = null, this._mediaSessionEnabled = !1, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this._isNavigating = !1, this._isStalled = !1, this._stalledWatchdog = null, this._stalledCheckTime = 0, this.pub = t, this.listeners = Dr(e), this._preferences = new ce(n.preferences), this._defaults = new Tr(n.defaults), this._settings = new Vi(this._preferences, this._defaults), t.readingOrder.items.length === 0)
|
|
9817
9858
|
throw new Error("AudioNavigator: publication has an empty reading order");
|
|
9818
9859
|
if (i)
|
|
9819
9860
|
this.currentLocation = this.ensureLocatorLocations(i);
|
|
@@ -9834,7 +9875,7 @@ class Fr extends vs {
|
|
|
9834
9875
|
const s = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(s);
|
|
9835
9876
|
if (o === -1)
|
|
9836
9877
|
throw new Error(`AudioNavigator: initial href "${s}" not found in reading order`);
|
|
9837
|
-
const a = this.currentLocation.locations?.time() || 0, l = new
|
|
9878
|
+
const a = this.currentLocation.locations?.time() || 0, l = new Ar({
|
|
9838
9879
|
playback: {
|
|
9839
9880
|
state: {
|
|
9840
9881
|
currentTime: a,
|
|
@@ -9844,14 +9885,14 @@ class Fr extends vs {
|
|
|
9844
9885
|
index: o
|
|
9845
9886
|
}
|
|
9846
9887
|
});
|
|
9847
|
-
this.pool = new
|
|
9888
|
+
this.pool = new Mr(l, t, n.contentProtection);
|
|
9848
9889
|
const h = n.contentProtection || {};
|
|
9849
9890
|
this._contentProtection = h;
|
|
9850
9891
|
const c = this.mergeKeyboardPeripherals(
|
|
9851
9892
|
h,
|
|
9852
9893
|
n.keyboardPeripherals || []
|
|
9853
9894
|
);
|
|
9854
|
-
(h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new
|
|
9895
|
+
(h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new Ir(h), this._suspiciousActivityListener = (u) => {
|
|
9855
9896
|
const { type: p, ...g } = u.detail;
|
|
9856
9897
|
p === "context_menu" ? this.listeners.contextMenu(g) : this.listeners.contentProtection(p, g);
|
|
9857
9898
|
}, window.addEventListener(ot, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new Ye({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
|
|
@@ -10168,61 +10209,61 @@ class Fr extends vs {
|
|
|
10168
10209
|
}
|
|
10169
10210
|
}
|
|
10170
10211
|
export {
|
|
10171
|
-
|
|
10172
|
-
|
|
10212
|
+
Tr as AudioDefaults,
|
|
10213
|
+
Wr as AudioNavigator,
|
|
10173
10214
|
ce as AudioPreferences,
|
|
10174
10215
|
ji as AudioPreferencesEditor,
|
|
10175
10216
|
Vi as AudioSettings,
|
|
10176
10217
|
A as BooleanPreference,
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10218
|
+
yn as EnumPreference,
|
|
10219
|
+
yr as EpubDefaults,
|
|
10220
|
+
Ln as EpubNavigator,
|
|
10180
10221
|
zt as EpubPreferences,
|
|
10181
10222
|
Bi as EpubPreferencesEditor,
|
|
10182
10223
|
Hi as EpubSettings,
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10224
|
+
Fr as ExperimentalWebPubNavigator,
|
|
10225
|
+
ar as FXLCoordinator,
|
|
10226
|
+
sr as FXLFrameManager,
|
|
10227
|
+
gr as FXLFramePoolManager,
|
|
10228
|
+
hr as FXLPeripherals,
|
|
10229
|
+
cr as FXLSpreader,
|
|
10189
10230
|
Mt as FrameComms,
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10231
|
+
_n as FrameManager,
|
|
10232
|
+
nr as FramePoolManager,
|
|
10233
|
+
rr as HorizontalThird,
|
|
10234
|
+
vn as Injector,
|
|
10194
10235
|
kt as LineLengths,
|
|
10195
|
-
|
|
10236
|
+
Ss as MediaNavigator,
|
|
10196
10237
|
hn as Navigator,
|
|
10197
10238
|
Me as Orientation,
|
|
10198
10239
|
M as Preference,
|
|
10199
10240
|
le as Properties,
|
|
10200
|
-
|
|
10241
|
+
Cr as RSProperties,
|
|
10201
10242
|
x as RangePreference,
|
|
10202
|
-
|
|
10243
|
+
Lr as ReadiumCSS,
|
|
10203
10244
|
Ne as Spread,
|
|
10204
10245
|
tt as TextAlignment,
|
|
10205
|
-
|
|
10206
|
-
|
|
10246
|
+
Cn as UserProperties,
|
|
10247
|
+
or as VerticalThird,
|
|
10207
10248
|
cn as VisualNavigator,
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10249
|
+
Ar as WebAudioEngine,
|
|
10250
|
+
Ps as WebPubBlobBuilder,
|
|
10251
|
+
zs as WebPubCSS,
|
|
10252
|
+
Fs as WebPubDefaults,
|
|
10253
|
+
ks as WebPubFrameManager,
|
|
10254
|
+
Os as WebPubFramePoolManager,
|
|
10255
|
+
er as WebPubNavigator,
|
|
10215
10256
|
Nt as WebPubPreferences,
|
|
10216
10257
|
Ai as WebPubPreferencesEditor,
|
|
10217
10258
|
Ri as WebPubSettings,
|
|
10218
|
-
|
|
10219
|
-
|
|
10259
|
+
Ns as WebRSProperties,
|
|
10260
|
+
mn as WebUserProperties,
|
|
10220
10261
|
E as ensureBoolean,
|
|
10221
10262
|
he as ensureEnumValue,
|
|
10222
|
-
|
|
10263
|
+
gn as ensureExperiment,
|
|
10223
10264
|
wt as ensureFilter,
|
|
10224
|
-
|
|
10225
|
-
|
|
10265
|
+
Is as ensureLessThanOrEqual,
|
|
10266
|
+
Ds as ensureMoreThanOrEqual,
|
|
10226
10267
|
v as ensureNonNegative,
|
|
10227
10268
|
W as ensureString,
|
|
10228
10269
|
z as ensureValueInRange,
|