@readium/navigator 2.5.3 → 2.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3660,7 +3660,7 @@ const At = class At extends Et {
3660
3660
  ), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
3661
3661
  value: {
3662
3662
  name: "readium-ts-toolkit",
3663
- version: "2.5.3",
3663
+ version: "2.5.5",
3664
3664
  hasFeature: (n, s = "") => {
3665
3665
  switch (n) {
3666
3666
  case "dom-manipulation":
@@ -4878,41 +4878,41 @@ var Xt = Rs();
4878
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: "Attempts 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" }, Ns = {
4879
4879
  experimentalHeaderFiltering: As,
4880
4880
  experimentalZoom: Ts
4881
- }, Ms = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, Fs = {
4882
- default: { disabled: [], added: [] },
4883
- rtl: Ms,
4881
+ }, Ms = { disabled: [], added: [] }, Fs = { disabled: ["bodyHyphens", "a11yNormalize", "letterSpacing"], added: [] }, Is = {
4882
+ ltr: Ms,
4883
+ rtl: Fs,
4884
4884
  "cjk-horizontal": { disabled: ["textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] },
4885
4885
  "cjk-vertical": { disabled: ["colCount", "textAlign", "bodyHyphens", "a11yNormalize", "ligatures", "paraIndent", "wordSpacing"], added: ["noRuby"] }
4886
- }, Is = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, zs = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Ds = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, Ws = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, Us = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, Hs = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Bs = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, Vs = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, js = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, $s = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, Gs = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, Xs = { baseFontFamily: "YuGothic, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif", lineHeightCompensation: 1.167 }, Ys = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, qs = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, Ks = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, Js = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, Zs = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, Qs = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, tr = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, er = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, ir = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, nr = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, sr = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, rr = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, or = {
4887
- default: { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 },
4888
- am: Is,
4889
- ar: zs,
4890
- bn: Ds,
4891
- bo: Ws,
4892
- chr: Us,
4893
- fa: Hs,
4894
- gu: Bs,
4895
- he: Vs,
4896
- hi: js,
4897
- hy: $s,
4898
- iu: Gs,
4899
- ja: Xs,
4900
- km: Ys,
4901
- kn: qs,
4902
- ko: Ks,
4903
- lo: Js,
4904
- ml: Zs,
4905
- or: Qs,
4906
- pa: tr,
4907
- si: er,
4908
- ta: ir,
4909
- te: nr,
4910
- th: sr,
4911
- zh: rr,
4886
+ }, zs = { baseFontFamily: "var(--RS__oldStyleTf)", lineHeightCompensation: 1 }, Ds = { baseFontFamily: "Kefa, Nyala, Roboto, Noto, 'Noto Sans Ethiopic', serif", lineHeightCompensation: 1.167 }, Ws = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, Us = { baseFontFamily: "'Kohinoor Bangla', 'Bangla Sangam MN', Vrinda, Roboto, Noto, 'Noto Sans Bengali', sans-serif", lineHeightCompensation: 1.067 }, Hs = { baseFontFamily: "Kailasa, 'Microsoft Himalaya', Roboto, Noto, 'Noto Sans Tibetan', sans-serif" }, Bs = { baseFontFamily: "'Plantagenet Cherokee', Roboto, Noto, 'Noto Sans Cherokee'", lineHeightCompensation: 1.167 }, Vs = { baseFontFamily: "'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', 'Times New Roman', serif" }, js = { baseFontFamily: "'Gujarati Sangam MN', 'Nirmala UI', Shruti, Roboto, Noto, 'Noto Sans Gujarati', sans-serif", lineHeightCompensation: 1.167 }, $s = { baseFontFamily: "'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, 'Noto Sans Hebrew', sans-serif", lineHeightCompensation: 1.1 }, Gs = { baseFontFamily: "'Kohinoor Devanagari', 'Devanagari Sangam MN', Kokila, 'Nirmala UI', Roboto, Noto, 'Noto Sans Devanagari', sans-serif", lineHeightCompensation: 1.1 }, Xs = { baseFontFamily: "Mshtakan, Sylfaen, Roboto, Noto, 'Noto Serif Armenian', serif" }, Ys = { baseFontFamily: "'Euphemia UCAS', Euphemia, Roboto, Noto, 'Noto Sans Canadian Aboriginal', sans-serif" }, qs = { baseFontFamily: "YuGothic, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif", lineHeightCompensation: 1.167 }, Ks = { baseFontFamily: "'Khmer Sangam MN', 'Leelawadee UI', 'Khmer UI', Roboto, Noto, 'Noto Sans Khmer', sans-serif", lineHeightCompensation: 1.067 }, Js = { baseFontFamily: "'Kannada Sangam MN', 'Nirmala UI', Tunga, Roboto, Noto, 'Noto Sans Kannada', sans-serif", lineHeightCompensation: 1.1 }, Zs = { baseFontFamily: "'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, 'Noto Sans CJK KR', sans-serif", lineHeightCompensation: 1.167 }, Qs = { baseFontFamily: "'Lao Sangam MN', 'Leelawadee UI', 'Lao UI', Roboto, Noto, 'Noto Sans Lao', sans-serif" }, tr = { baseFontFamily: "'Malayalam Sangam MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Malayalam', sans-serif", lineHeightCompensation: 1.067 }, er = { baseFontFamily: "'Oriya Sangam MN', 'Nirmala UI', Kalinga, Roboto, Noto, 'Noto Sans Oriya', sans-serif", lineHeightCompensation: 1.167 }, ir = { baseFontFamily: "'Gurmukhi MN', 'Nirmala UI', Kartika, Roboto, Noto, 'Noto Sans Gurmukhi', sans-serif", lineHeightCompensation: 1.1 }, nr = { baseFontFamily: "'Sinhala Sangam MN', 'Nirmala UI', 'Iskoola Pota', Roboto, Noto, 'Noto Sans Sinhala', sans-serif", lineHeightCompensation: 1.167 }, sr = { baseFontFamily: "'Tamil Sangam MN', 'Nirmala UI', Latha, Roboto, Noto, 'Noto Sans Tamil', sans-serif", lineHeightCompensation: 1.067 }, rr = { baseFontFamily: "'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', Gautami, Roboto, Noto, 'Noto Sans Telugu', sans-serif" }, or = { baseFontFamily: "Thonburi, 'Leelawadee UI', 'Cordia New', Roboto, Noto, 'Noto Sans Thai', sans-serif", lineHeightCompensation: 1.067 }, ar = { baseFontFamily: "'方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif", lineHeightCompensation: 1.167 }, lr = {
4887
+ latin: zs,
4888
+ am: Ds,
4889
+ ar: Ws,
4890
+ bn: Us,
4891
+ bo: Hs,
4892
+ chr: Bs,
4893
+ fa: Vs,
4894
+ gu: js,
4895
+ he: $s,
4896
+ hi: Gs,
4897
+ hy: Xs,
4898
+ iu: Ys,
4899
+ ja: qs,
4900
+ km: Ks,
4901
+ kn: Js,
4902
+ ko: Zs,
4903
+ lo: Qs,
4904
+ ml: tr,
4905
+ or: er,
4906
+ pa: ir,
4907
+ si: nr,
4908
+ ta: sr,
4909
+ te: rr,
4910
+ th: or,
4911
+ zh: ar,
4912
4912
  "zh-Hant": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
4913
4913
  "zh-TW": { baseFontFamily: "'方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 },
4914
4914
  "zh-HK": { baseFontFamily: "'方體', 'PingFang HK', '方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif", lineHeightCompensation: 1.167 }
4915
- }, Ge = Ns, uo = Fs, po = or;
4915
+ }, Ge = Ns, fo = Is, mo = lr;
4916
4916
  var tt = /* @__PURE__ */ ((r) => (r.start = "start", r.left = "left", r.right = "right", r.justify = "justify", r))(tt || {});
4917
4917
  const dt = {
4918
4918
  range: [0, 100],
@@ -4993,7 +4993,7 @@ class mn extends le {
4993
4993
  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;
4994
4994
  }
4995
4995
  }
4996
- class ar extends le {
4996
+ class hr extends le {
4997
4997
  constructor(t) {
4998
4998
  super(), this.experiments = t.experiments ?? null;
4999
4999
  }
@@ -5004,7 +5004,7 @@ class ar extends le {
5004
5004
  }), t;
5005
5005
  }
5006
5006
  }
5007
- class lr {
5007
+ class cr {
5008
5008
  constructor(t) {
5009
5009
  this.rsProperties = t.rsProperties, this.userProperties = t.userProperties;
5010
5010
  }
@@ -5030,10 +5030,10 @@ class lr {
5030
5030
  this.userProperties = new mn(e);
5031
5031
  }
5032
5032
  }
5033
- function hr(r, t) {
5033
+ function dr(r, t) {
5034
5034
  return r == null || t == null || r <= t ? r : void 0;
5035
5035
  }
5036
- function cr(r, t) {
5036
+ function ur(r, t) {
5037
5037
  return r == null || t == null || r >= t ? r : void 0;
5038
5038
  }
5039
5039
  function W(r) {
@@ -5091,7 +5091,7 @@ class Mt {
5091
5091
  return new Mt(e);
5092
5092
  }
5093
5093
  }
5094
- class dr {
5094
+ class pr {
5095
5095
  constructor(t) {
5096
5096
  this.fontFamily = W(t.fontFamily) || null, this.fontWeight = F(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 = S(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = S(t.lineHeight) || null, this.noRuby = E(t.noRuby) ?? !1, this.paragraphIndent = S(t.paragraphIndent) ?? null, this.paragraphSpacing = S(t.paragraphSpacing) ?? null, this.textAlign = he(t.textAlign, tt) || null, this.textNormalization = E(t.textNormalization) ?? !1, this.wordSpacing = S(t.wordSpacing) || null, this.zoom = F(t.zoom, ee.range) || 1, this.experiments = gn(t.experiments) ?? null;
5097
5097
  }
@@ -5422,7 +5422,7 @@ const bn = (r) => {
5422
5422
  t.attributes && Object.entries(t.attributes).forEach(([e, i]) => {
5423
5423
  e === "type" || e === "rel" || e === "href" || e === "src" || i != null && (typeof i == "boolean" ? i && r.setAttribute(e, "") : r.setAttribute(e, i));
5424
5424
  });
5425
- }, ur = (r, t, e) => {
5425
+ }, fr = (r, t, e) => {
5426
5426
  const i = r.createElement("script");
5427
5427
  i.dataset.readium = "true", t.id && (i.id = t.id);
5428
5428
  const n = t.type || bn(t);
@@ -5519,7 +5519,7 @@ class Sn {
5519
5519
  }
5520
5520
  createElement(t, e, i) {
5521
5521
  if (e.as === "script")
5522
- return ur(t, e, i);
5522
+ return fr(t, e, i);
5523
5523
  if (e.as === "link")
5524
5524
  return Ni(t, e, i);
5525
5525
  throw new Error(`Unsupported element type: ${e.as}`);
@@ -5578,8 +5578,8 @@ class Sn {
5578
5578
  }
5579
5579
  }
5580
5580
  }
5581
- const St = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), _t = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), pr = `/*!
5582
- * Readium CSS v.2.0.4
5581
+ const St = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), _t = (r) => r.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " "), mr = `/*!
5582
+ * Readium CSS v.2.0.5
5583
5583
  * Copyright (c) 2017–2026. Readium Foundation. All rights reserved.
5584
5584
  * Use of this source code is governed by a BSD-style license which is detailed in the
5585
5585
  * LICENSE file present in the project repository where this source code is maintained.
@@ -5851,7 +5851,7 @@ const St = (r) => r.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").repl
5851
5851
 
5852
5852
  :root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{
5853
5853
  -webkit-text-zoom:normal;
5854
- }`, vn = '!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})()));', fr = `// WebPub-specific setup - no execution blocking needed
5854
+ }`, vn = '!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})()));', gr = `// WebPub-specific setup - no execution blocking needed
5855
5855
  window._readium_blockedEvents = [];
5856
5856
  window._readium_blockEvents = false; // WebPub doesn't need event blocking
5857
5857
  window._readium_eventBlocker = null;
@@ -5869,7 +5869,7 @@ window._readium_eventBlocker = null;
5869
5869
  });
5870
5870
  })();
5871
5871
  `;
5872
- function mr(r) {
5872
+ function yr(r) {
5873
5873
  const t = r.filter((s) => s.mediaType.isHTML).map((s) => s.href), e = t.length > 0 ? t : [/\.html$/, /\.xhtml$/, /\/$/], i = [
5874
5874
  // CSS Selector Generator - always injected
5875
5875
  {
@@ -5883,7 +5883,7 @@ function mr(r) {
5883
5883
  id: "webpub-execution",
5884
5884
  as: "script",
5885
5885
  target: "head",
5886
- blob: new Blob([St(fr)], { type: "text/javascript" })
5886
+ blob: new Blob([St(gr)], { type: "text/javascript" })
5887
5887
  }
5888
5888
  ], n = [
5889
5889
  // Onload Proxy - conditional (has executable scripts)
@@ -5899,7 +5899,7 @@ function mr(r) {
5899
5899
  id: "readium-css-webpub",
5900
5900
  as: "link",
5901
5901
  target: "head",
5902
- blob: new Blob([_t(pr)], { type: "text/css" }),
5902
+ blob: new Blob([_t(mr)], { type: "text/css" }),
5903
5903
  rel: "stylesheet"
5904
5904
  }
5905
5905
  ];
@@ -5911,7 +5911,7 @@ function mr(r) {
5911
5911
  }
5912
5912
  ];
5913
5913
  }
5914
- class gr {
5914
+ class br {
5915
5915
  constructor(t) {
5916
5916
  if (this.detectedTools = /* @__PURE__ */ new Set(), !t.onDetected)
5917
5917
  throw new Error("onDetected callback is required");
@@ -5943,11 +5943,11 @@ class gr {
5943
5943
  this.observer?.disconnect(), this.observer = void 0, this.detectedTools.clear();
5944
5944
  }
5945
5945
  }
5946
- let yr = 0;
5947
- function br() {
5948
- return ++yr;
5946
+ let wr = 0;
5947
+ function Sr() {
5948
+ return ++wr;
5949
5949
  }
5950
- const wr = `
5950
+ const vr = `
5951
5951
  onmessage = function(event) {
5952
5952
  var action = event.data;
5953
5953
  var startTime = performance.now()
@@ -5968,7 +5968,7 @@ onmessage = function(event) {
5968
5968
  }, this.log = (...i) => this.send("log", ...i), this.table = (...i) => this.send("table", ...i), this.clear = (...i) => this.send("clear", ...i);
5969
5969
  }
5970
5970
  async send(t, ...e) {
5971
- const i = br();
5971
+ const i = Sr();
5972
5972
  return new Promise((n, s) => {
5973
5973
  this.callbacks.set(i, n), this.worker.postMessage({
5974
5974
  id: i,
@@ -5983,13 +5983,13 @@ onmessage = function(event) {
5983
5983
  this.worker.terminate(), URL.revokeObjectURL(this.blobUrl);
5984
5984
  }
5985
5985
  };
5986
- Je.workerScript = wr;
5986
+ Je.workerScript = vr;
5987
5987
  let se = Je;
5988
5988
  function Xe(r) {
5989
5989
  return typeof window < "u" && console ? console[r] : (...t) => {
5990
5990
  };
5991
5991
  }
5992
- const Sr = Xe("log"), Mi = Xe("table"), vr = Xe("clear");
5992
+ const Pr = Xe("log"), Mi = Xe("table"), Er = Xe("clear");
5993
5993
  async function Fi() {
5994
5994
  if (typeof navigator < "u" && navigator.brave && navigator.brave.isBrave)
5995
5995
  try {
@@ -6002,10 +6002,10 @@ async function Fi() {
6002
6002
  }
6003
6003
  return !1;
6004
6004
  }
6005
- function Pr(r) {
6005
+ function Cr(r) {
6006
6006
  return r.excludes.some((t) => t()) ? !1 : r.includes.some((t) => t());
6007
6007
  }
6008
- class Er {
6008
+ class _r {
6009
6009
  constructor(t = {}) {
6010
6010
  if (this.isOpen = !1, this.checkCount = 0, this.maxChecks = 10, this.maxPrintTime = 0, this.largeObjectArray = null, this.options = {
6011
6011
  onDetected: t.onDetected || (() => {
@@ -6067,14 +6067,14 @@ class Er {
6067
6067
  return (await this.workerConsole.log(t)).time;
6068
6068
  {
6069
6069
  const e = performance.now();
6070
- return Sr(t), performance.now() - e;
6070
+ return Pr(t), performance.now() - e;
6071
6071
  }
6072
6072
  }
6073
6073
  /**
6074
6074
  * Check if performance-based detection is enabled for current browser
6075
6075
  */
6076
6076
  isPerformanceDetectionEnabled() {
6077
- return Pr({
6077
+ return Cr({
6078
6078
  includes: [
6079
6079
  () => !!J.UA.Chrome,
6080
6080
  () => !!J.UA.Chromium,
@@ -6097,7 +6097,7 @@ class Er {
6097
6097
  if (!this.isPerformanceDetectionEnabled())
6098
6098
  return !1;
6099
6099
  const t = await this.calcTablePrintTime(), e = Math.max(await this.calcLogPrintTime(), await this.calcLogPrintTime());
6100
- return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : vr(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Fi() : t > this.maxPrintTime * 10;
6100
+ return this.maxPrintTime = Math.max(this.maxPrintTime, e), this.workerConsole ? await this.workerConsole.clear() : Er(), t === 0 ? !1 : this.maxPrintTime === 0 ? !!await Fi() : t > this.maxPrintTime * 10;
6101
6101
  }
6102
6102
  /**
6103
6103
  * Debugger-based detection (fallback method)
@@ -6152,7 +6152,7 @@ class Er {
6152
6152
  this.intervalId && (clearInterval(this.intervalId), this.intervalId = void 0), this.workerConsole && (this.workerConsole.destroy(), this.workerConsole = void 0), this.isOpen = !1, this.checkCount = 0;
6153
6153
  }
6154
6154
  }
6155
- class Cr {
6155
+ class Lr {
6156
6156
  constructor(t) {
6157
6157
  if (this.detected = !1, !t.onDetected)
6158
6158
  throw new Error("onDetected callback is required");
@@ -6187,7 +6187,7 @@ class Cr {
6187
6187
  this.observer?.disconnect(), this.observer = void 0, this.detected = !1;
6188
6188
  }
6189
6189
  }
6190
- class _r {
6190
+ class xr {
6191
6191
  constructor(t = {}) {
6192
6192
  this.styleElement = null, this.beforePrintHandler = null, this.onPrintAttempt = t.onPrintAttempt, t.disable && this.setupPrintProtection(t.watermark);
6193
6193
  }
@@ -6213,7 +6213,7 @@ class _r {
6213
6213
  this.beforePrintHandler && (window.removeEventListener("beforeprint", this.beforePrintHandler), this.beforePrintHandler = null), this.styleElement?.parentNode && (this.styleElement.parentNode.removeChild(this.styleElement), this.styleElement = null);
6214
6214
  }
6215
6215
  }
6216
- class Lr {
6216
+ class kr {
6217
6217
  constructor(t = {}) {
6218
6218
  this.onContextMenuBlocked = t.onContextMenuBlocked, this.contextMenuHandler = this.handleContextMenu.bind(this), document.addEventListener("contextmenu", this.contextMenuHandler, !0), window.addEventListener("unload", () => this.destroy());
6219
6219
  }
@@ -6245,7 +6245,7 @@ class Ye {
6245
6245
  window.dispatchEvent(i);
6246
6246
  }
6247
6247
  constructor(t = {}) {
6248
- t.monitorDevTools && (this.devToolsDetector = new Er({
6248
+ t.monitorDevTools && (this.devToolsDetector = new _r({
6249
6249
  onDetected: () => {
6250
6250
  this.dispatchSuspiciousActivity("developer_tools", {
6251
6251
  targetFrameSrc: "",
@@ -6258,20 +6258,20 @@ class Ye {
6258
6258
  metaKey: !1
6259
6259
  });
6260
6260
  }
6261
- })), t.checkAutomation && (this.automationDetector = new gr({
6261
+ })), t.checkAutomation && (this.automationDetector = new br({
6262
6262
  onDetected: (e) => {
6263
6263
  this.dispatchSuspiciousActivity("automation_detected", { tool: e });
6264
6264
  }
6265
- })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Cr({
6265
+ })), t.checkIFrameEmbedding && (this.iframeEmbeddingDetector = new Lr({
6266
6266
  onDetected: (e) => {
6267
6267
  this.dispatchSuspiciousActivity("iframe_embedding_detected", { isCrossOrigin: e });
6268
6268
  }
6269
- })), t.protectPrinting?.disable && (this.printProtector = new _r({
6269
+ })), t.protectPrinting?.disable && (this.printProtector = new xr({
6270
6270
  ...t.protectPrinting,
6271
6271
  onPrintAttempt: () => {
6272
6272
  this.dispatchSuspiciousActivity("print", {});
6273
6273
  }
6274
- })), t.disableContextMenu && (this.contextMenuProtector = new Lr({
6274
+ })), t.disableContextMenu && (this.contextMenuProtector = new kr({
6275
6275
  onContextMenuBlocked: (e) => {
6276
6276
  this.dispatchSuspiciousActivity("context_menu", e);
6277
6277
  }
@@ -6307,7 +6307,7 @@ class qe {
6307
6307
  this.keydownHandler && (document.removeEventListener("keydown", this.keydownHandler, !0), this.keydownHandler = void 0);
6308
6308
  }
6309
6309
  }
6310
- const xr = (r) => ({
6310
+ const Or = (r) => ({
6311
6311
  frameLoaded: r.frameLoaded || (() => {
6312
6312
  }),
6313
6313
  positionChanged: r.positionChanged || (() => {
@@ -6330,17 +6330,17 @@ const xr = (r) => ({
6330
6330
  peripheral: r.peripheral || (() => {
6331
6331
  })
6332
6332
  });
6333
- class kr extends dn {
6333
+ class Rr extends dn {
6334
6334
  constructor(t, e, i, n = void 0, s = { preferences: {}, defaults: {} }) {
6335
6335
  super(), this.currentIndex = 0, this._preferencesEditor = null, this._injector = null, this._navigatorProtector = null, this._keyboardPeripheralsManager = null, this._suspiciousActivityListener = null, this._keyboardPeripheralListener = null, this.webViewport = {
6336
6336
  readingOrder: [],
6337
6337
  progressions: /* @__PURE__ */ new Map(),
6338
6338
  positions: null
6339
- }, this.pub = e, this.container = t, this.listeners = xr(i), this._preferences = new Mt(s.preferences), this._defaults = new dr(s.defaults), this._settings = new Ai(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new lr({
6340
- rsProperties: new ar({ experiments: this._settings.experiments || null }),
6339
+ }, this.pub = e, this.container = t, this.listeners = Or(i), this._preferences = new Mt(s.preferences), this._defaults = new pr(s.defaults), this._settings = new Ai(this._preferences, this._defaults, this.hasDisplayTransformability), this._css = new cr({
6340
+ rsProperties: new hr({ experiments: this._settings.experiments || null }),
6341
6341
  userProperties: new mn({ zoom: this._settings.zoom })
6342
6342
  });
6343
- const o = mr(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
6343
+ const o = yr(e.readingOrder.items), a = s.injectables || { rules: [], allowedDomains: [] };
6344
6344
  if (this._injector = new Sn({
6345
6345
  rules: [...o, ...a.rules],
6346
6346
  allowedDomains: a.allowedDomains
@@ -6645,7 +6645,7 @@ class kr extends dn {
6645
6645
  });
6646
6646
  }
6647
6647
  }
6648
- const fo = kr, Or = (r) => {
6648
+ const go = Rr, Ar = (r) => {
6649
6649
  const t = r.join(" ");
6650
6650
  return [
6651
6651
  // 'self' is useless because the document is loaded from a blob: URL
@@ -6724,7 +6724,7 @@ class En {
6724
6724
  u.href = i, u.dataset.readium = "true", t.head.firstChild.before(u);
6725
6725
  }
6726
6726
  const c = t.createElement("meta");
6727
- return c.httpEquiv = "Content-Security-Policy", c.content = Or(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
6727
+ return c.httpEquiv = "Content-Security-Policy", c.content = Ar(l), c.dataset.readium = "true", t.head.firstChild.before(c), URL.createObjectURL(
6728
6728
  new Blob([new XMLSerializer().serializeToString(t)], {
6729
6729
  type: n.isHTML ? n.string : "application/xhtml+xml"
6730
6730
  // Fallback to XHTML
@@ -6838,7 +6838,7 @@ class Cn {
6838
6838
  }
6839
6839
  }
6840
6840
  const Ii = 5, zi = 3;
6841
- class Rr {
6841
+ class Tr {
6842
6842
  constructor(t, e, i, n, s, o) {
6843
6843
  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 || [];
6844
6844
  }
@@ -6955,7 +6955,7 @@ class Rr {
6955
6955
  }), t;
6956
6956
  }
6957
6957
  }
6958
- class Ar {
6958
+ class Nr {
6959
6959
  constructor(t, e, i, n = {}, s = []) {
6960
6960
  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 === M.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
6961
6961
  }
@@ -7126,8 +7126,8 @@ class Ar {
7126
7126
  return this.loader;
7127
7127
  }
7128
7128
  }
7129
- var Tr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(Tr || {}), Nr = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(Nr || {});
7130
- class Mr {
7129
+ var Mr = /* @__PURE__ */ ((r) => (r[r.Left = 0] = "Left", r[r.Center = 1] = "Center", r[r.Right = 2] = "Right", r))(Mr || {}), Fr = /* @__PURE__ */ ((r) => (r[r.Top = 0] = "Top", r[r.Middle = 1] = "Middle", r[r.Bottom = 2] = "Bottom", r))(Fr || {});
7130
+ class Ir {
7131
7131
  constructor() {
7132
7132
  this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
7133
7133
  }
@@ -7175,7 +7175,7 @@ class Mr {
7175
7175
  };
7176
7176
  }
7177
7177
  }
7178
- class Fr {
7178
+ class zr {
7179
7179
  constructor() {
7180
7180
  this._DOM = {
7181
7181
  show: !1,
@@ -7194,7 +7194,7 @@ class Fr {
7194
7194
  }
7195
7195
  }
7196
7196
  const Di = 6, ye = 1.02, Wi = 50;
7197
- class Ir {
7197
+ class Dr {
7198
7198
  constructor(t, e = !1) {
7199
7199
  this.dragState = 0, this.minimumMoved = !1, this.pan = {
7200
7200
  startX: 0,
@@ -7213,7 +7213,7 @@ class Ir {
7213
7213
  target: { X: 0, Y: 0 },
7214
7214
  touchN: 0,
7215
7215
  startTranslate: { X: 0, Y: 0 }
7216
- }, 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 Mr(), this.attachEvents(), e && (this.debugger = new Fr());
7216
+ }, 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 Ir(), this.attachEvents(), e && (this.debugger = new zr());
7217
7217
  }
7218
7218
  get scale() {
7219
7219
  return this._scale;
@@ -7415,7 +7415,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
7415
7415
  }
7416
7416
  }
7417
7417
  var Ne = /* @__PURE__ */ ((r) => (r.auto = "auto", r.landscape = "landscape", r.portrait = "portrait", r))(Ne || {}), Me = /* @__PURE__ */ ((r) => (r.auto = "auto", r.both = "both", r.none = "none", r.landscape = "landscape", r))(Me || {});
7418
- class zr {
7418
+ class Wr {
7419
7419
  // TODO getter
7420
7420
  constructor(t) {
7421
7421
  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`);
@@ -7460,13 +7460,13 @@ class zr {
7460
7460
  return this.spreads.find((e) => e.includes(t)) || void 0;
7461
7461
  }
7462
7462
  }
7463
- const Ui = 8, Hi = 5, Dr = 300, Wr = 15e3, Ur = 250, Hr = 150, Br = 500;
7464
- class Vr {
7463
+ const Ui = 8, Hi = 5, Ur = 300, Hr = 15e3, Br = 250, Vr = 150, jr = 500;
7464
+ class $r {
7465
7465
  constructor(t, e, i, n, s, o) {
7466
7466
  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 || Me.auto, this.pub.metadata.effectiveReadingProgression !== M.rtl && this.pub.metadata.effectiveReadingProgression !== M.ltr)
7467
7467
  throw Error("Unsupported reading progression for EPUB");
7468
- this.spreader = new zr(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 Ir(this), this.pub.readingOrder.items.forEach((a) => {
7469
- const l = new Ar(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7468
+ this.spreader = new Wr(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 Dr(this), this.pub.readingOrder.items.forEach((a) => {
7469
+ const l = new Nr(this.peripherals, this.pub.metadata.effectiveReadingProgression, a.href, this.contentProtectionConfig, this.keyboardPeripheralsConfig);
7470
7470
  this.spineElement.appendChild(l.element), this.pool.set(a.href, l), l.width = 100 / this.length * (a.properties?.otherProperties.orientation === Ne.landscape || a.properties?.otherProperties.addBlank ? this.perPage : 1), l.height = this.height;
7471
7471
  });
7472
7472
  }
@@ -7491,7 +7491,7 @@ class Vr {
7491
7491
  const a = this.spreader.findByLink(o);
7492
7492
  i.update(this.spreadPosition(a, o));
7493
7493
  });
7494
- }, Ur);
7494
+ }, Br);
7495
7495
  }
7496
7496
  /**
7497
7497
  * It is important that these values be cached to avoid spamming them on redraws, they are expensive.
@@ -7518,7 +7518,7 @@ class Vr {
7518
7518
  let i = "0";
7519
7519
  this.updateDimensions(), this.perPage > 1 && (i = `${this.width / 2}px`);
7520
7520
  const n = {
7521
- transition: t ? `all ${e ? Hr : Br}ms ease-out` : "all 0ms ease-out",
7521
+ transition: t ? `all ${e ? Vr : jr}ms ease-out` : "all 0ms ease-out",
7522
7522
  marginRight: this.rtl ? i : "0",
7523
7523
  marginLeft: this.rtl ? "0" : i,
7524
7524
  width: `${this.width / this.perPage * this.length}px`,
@@ -7702,10 +7702,10 @@ class Vr {
7702
7702
  this.delayedTimeout.set(d, 0);
7703
7703
  const ht = this.makeSpread(this.reAlign(f)), xn = this.spreadPosition(ht, w), Ze = this.pool.get(d);
7704
7704
  await Ze.load(i, this.blobs.get(d)), this.peripherals.isScaled || await Ze.show(xn), this.delayedShow.delete(d), Y = !0, P();
7705
- }, Dr);
7705
+ }, Ur);
7706
7706
  setTimeout(() => {
7707
7707
  !Y && this.delayedShow.has(d) && R(`Offscreen load timeout: ${d}`);
7708
- }, Wr), this.delayedTimeout.set(d, lt);
7708
+ }, Hr), this.delayedTimeout.set(d, lt);
7709
7709
  }));
7710
7710
  }
7711
7711
  };
@@ -7804,18 +7804,18 @@ class Ft {
7804
7804
  return new Ft(e);
7805
7805
  }
7806
7806
  }
7807
- class jr {
7807
+ class Gr {
7808
7808
  constructor(t) {
7809
- this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = S(t.constraint) || 0, this.columnCount = S(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 = F(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = F(t.fontWeight, st.range) || null, this.fontWidth = F(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 = S(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = S(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = ge(S(t.pageGutter), 20), this.paragraphIndent = S(t.paragraphIndent) ?? null, this.paragraphSpacing = S(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = S(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = S(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = S(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = S(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 = S(t.wordSpacing) || null, this.optimalLineLength = S(t.optimalLineLength) || 65, this.maximalLineLength = ge(cr(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ge(hr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = gn(t.experiments) || null;
7809
+ this.backgroundColor = W(t.backgroundColor) || null, this.blendFilter = E(t.blendFilter) ?? !1, this.constraint = S(t.constraint) || 0, this.columnCount = S(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 = F(t.fontSize, Yt.range) || 1, this.fontSizeNormalize = E(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = E(t.fontOpticalSizing) ?? null, this.fontWeight = F(t.fontWeight, st.range) || null, this.fontWidth = F(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 = S(t.letterSpacing) || null, this.ligatures = E(t.ligatures) ?? null, this.lineHeight = S(t.lineHeight) || null, this.linkColor = W(t.linkColor) || null, this.noRuby = E(t.noRuby) ?? !1, this.pageGutter = ge(S(t.pageGutter), 20), this.paragraphIndent = S(t.paragraphIndent) ?? null, this.paragraphSpacing = S(t.paragraphSpacing) ?? null, this.scroll = E(t.scroll) ?? !1, this.scrollPaddingTop = S(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = S(t.scrollPaddingBottom) ?? null, this.scrollPaddingLeft = S(t.scrollPaddingLeft) ?? null, this.scrollPaddingRight = S(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 = S(t.wordSpacing) || null, this.optimalLineLength = S(t.optimalLineLength) || 65, this.maximalLineLength = ge(ur(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = ge(dr(t.minimalLineLength, this.optimalLineLength), 40), this.experiments = gn(t.experiments) || null;
7810
7810
  }
7811
7811
  }
7812
- const $r = "#FFFFFF", Gr = "#121212", Xr = "#0000EE", Yr = "#551A8B", qr = "#b4d8fe", Kr = "inherit", pt = {
7813
- backgroundColor: $r,
7814
- textColor: Gr,
7815
- linkColor: Xr,
7816
- visitedColor: Yr,
7817
- selectionBackgroundColor: qr,
7818
- selectionTextColor: Kr
7812
+ const Xr = "#FFFFFF", Yr = "#121212", qr = "#0000EE", Kr = "#551A8B", Jr = "#b4d8fe", Zr = "inherit", pt = {
7813
+ backgroundColor: Xr,
7814
+ textColor: Yr,
7815
+ linkColor: qr,
7816
+ visitedColor: Kr,
7817
+ selectionBackgroundColor: Jr,
7818
+ selectionTextColor: Zr
7819
7819
  };
7820
7820
  class Bi {
7821
7821
  constructor(t, e, i) {
@@ -8271,7 +8271,7 @@ function Lt(r) {
8271
8271
  const t = getComputedStyle(r), e = parseFloat(t.paddingLeft || "0"), i = parseFloat(t.paddingRight || "0");
8272
8272
  return r.clientWidth - e - i;
8273
8273
  }
8274
- function Jr(r) {
8274
+ function Qr(r) {
8275
8275
  const t = getComputedStyle(r), e = parseFloat(t.paddingTop || "0"), i = parseFloat(t.paddingBottom || "0");
8276
8276
  return r.clientHeight - e - i;
8277
8277
  }
@@ -8284,7 +8284,7 @@ class _n extends le {
8284
8284
  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;
8285
8285
  }
8286
8286
  }
8287
- class Zr extends le {
8287
+ class to extends le {
8288
8288
  constructor(t) {
8289
8289
  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;
8290
8290
  }
@@ -8295,7 +8295,7 @@ class Zr extends le {
8295
8295
  }), t;
8296
8296
  }
8297
8297
  }
8298
- class Qr {
8298
+ class eo {
8299
8299
  constructor(t) {
8300
8300
  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);
8301
8301
  }
@@ -8409,7 +8409,7 @@ class Qr {
8409
8409
  };
8410
8410
  }
8411
8411
  computeCJKVerticalLength(t, e) {
8412
- const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(Jr(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
8412
+ const i = Math.round(Lt(this.containerParent) - this.constraint), n = Math.round(Qr(this.containerParent)), s = this.getCompensatedMetrics(t, e), o = s.maximal !== null ? Math.min(Math.round(s.maximal * s.zoomCompensation), n) : n;
8413
8413
  return { colCount: void 0, effectiveContainerWidth: i, effectiveLineLength: o };
8414
8414
  }
8415
8415
  // This behaves as paginate where colCount = 1
@@ -8436,7 +8436,7 @@ class Qr {
8436
8436
  this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
8437
8437
  }
8438
8438
  }
8439
- const to = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
8439
+ const io = `// Note: we aren't blocking some of the events right now to try and be as nonintrusive as possible.
8440
8440
  // For a more comprehensive implementation, see https://github.com/hackademix/noscript/blob/3a83c0e4a506f175e38b0342dad50cdca3eae836/src/content/syncFetchPolicy.js#L142
8441
8441
  // The snippet of code at the beginning of this source is an attempt at defence against JS using persistent storage
8442
8442
  (function() {
@@ -8502,7 +8502,7 @@ const to = `// Note: we aren't blocking some of the events right now to try and
8502
8502
  window.addEventListener("load", window._readium_eventBlocker, true);
8503
8503
  })();
8504
8504
  `;
8505
- async function eo(r, t) {
8505
+ async function no(r, t) {
8506
8506
  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 = [
8507
8507
  // CSS Selector Generator - always injected
8508
8508
  {
@@ -8516,7 +8516,7 @@ async function eo(r, t) {
8516
8516
  id: "execution-prevention",
8517
8517
  as: "script",
8518
8518
  target: "head",
8519
- blob: new Blob([St(to)], { type: "text/javascript" }),
8519
+ blob: new Blob([St(io)], { type: "text/javascript" }),
8520
8520
  condition: (a) => !!(a.querySelector("script") || a.querySelector("body[onload]:not(body[onload=''])"))
8521
8521
  }
8522
8522
  ], o = [
@@ -8535,18 +8535,18 @@ async function eo(r, t) {
8535
8535
  switch (a) {
8536
8536
  case "rtl": {
8537
8537
  const [u, p, g] = await Promise.all([
8538
- import("./ReadiumCSS-before-CvMFpmud.js"),
8539
- import("./ReadiumCSS-default-CL_hP__L.js"),
8540
- import("./ReadiumCSS-after-Dzd22Ssm.js")
8538
+ import("./ReadiumCSS-before-DwBLxUVH.js"),
8539
+ import("./ReadiumCSS-default-BhdLiyWp.js"),
8540
+ import("./ReadiumCSS-after-d5mC4cme.js")
8541
8541
  ]);
8542
8542
  l = u.default, h = p.default, c = g.default;
8543
8543
  break;
8544
8544
  }
8545
8545
  case "cjk-horizontal": {
8546
8546
  const [u, p, g] = await Promise.all([
8547
- import("./ReadiumCSS-before-6kD9Qj82.js"),
8548
- import("./ReadiumCSS-default-nJgSC4Z_.js"),
8549
- import("./ReadiumCSS-after-C8SjJ_Rf.js")
8547
+ import("./ReadiumCSS-before-CG-KmDa3.js"),
8548
+ import("./ReadiumCSS-default-N65xNiIp.js"),
8549
+ import("./ReadiumCSS-after-XUKPAxfT.js")
8550
8550
  ]);
8551
8551
  l = u.default, h = p.default, c = g.default;
8552
8552
  break;
@@ -8557,18 +8557,18 @@ async function eo(r, t) {
8557
8557
  // same stylesheet set per the Readium CSS spec.
8558
8558
  case "mongolian-vertical": {
8559
8559
  const [u, p, g] = await Promise.all([
8560
- import("./ReadiumCSS-before-usMdEglk.js"),
8561
- import("./ReadiumCSS-default-BVp3Ygi2.js"),
8562
- import("./ReadiumCSS-after-BYNAMW5u.js")
8560
+ import("./ReadiumCSS-before-BNTwR8Qm.js"),
8561
+ import("./ReadiumCSS-default-BesyZHRU.js"),
8562
+ import("./ReadiumCSS-after-ClF4TBzj.js")
8563
8563
  ]);
8564
8564
  l = u.default, h = p.default, c = g.default;
8565
8565
  break;
8566
8566
  }
8567
8567
  default: {
8568
8568
  const [u, p, g] = await Promise.all([
8569
- import("./ReadiumCSS-before-crwPhKrV.js"),
8570
- import("./ReadiumCSS-default-vv7hNCaM.js"),
8571
- import("./ReadiumCSS-after-b-ykC0_O.js")
8569
+ import("./ReadiumCSS-before-8FMq19-x.js"),
8570
+ import("./ReadiumCSS-default-AIAk8uwU.js"),
8571
+ import("./ReadiumCSS-after-D7unrNI9.js")
8572
8572
  ]);
8573
8573
  l = u.default, h = p.default, c = g.default;
8574
8574
  break;
@@ -8617,7 +8617,7 @@ async function eo(r, t) {
8617
8617
  }
8618
8618
  ];
8619
8619
  }
8620
- const io = (r) => ({
8620
+ const so = (r) => ({
8621
8621
  frameLoaded: r.frameLoaded || (() => {
8622
8622
  }),
8623
8623
  positionChanged: r.positionChanged || (() => {
@@ -8648,10 +8648,10 @@ class Ln extends dn {
8648
8648
  readingOrder: [],
8649
8649
  progressions: /* @__PURE__ */ new Map(),
8650
8650
  positions: null
8651
- }, this.pub = e, this.container = t, this.listeners = io(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new Ft(o.preferences), this._defaults = new jr(o.defaults), this._settings = new Vi(this._preferences, this._defaults);
8651
+ }, this.pub = e, this.container = t, this.listeners = so(i), this.currentLocation = s, n.length && (this.positions = n), this._preferences = new Ft(o.preferences), this._defaults = new Gr(o.defaults), this._settings = new Vi(this._preferences, this._defaults);
8652
8652
  const a = bt(e.metadata), l = a === "cjk-horizontal", h = a === "cjk-vertical", u = h || a === "mongolian-vertical", p = l || h;
8653
- this._css = new Qr({
8654
- rsProperties: new Zr({ noVerticalPagination: u || void 0 }),
8653
+ this._css = new eo({
8654
+ rsProperties: new to({ noVerticalPagination: u || void 0 }),
8655
8655
  userProperties: new _n({}),
8656
8656
  lineLengths: new kt({
8657
8657
  optimalChars: this._settings.optimalLineLength,
@@ -8667,7 +8667,7 @@ class Ln extends dn {
8667
8667
  container: t,
8668
8668
  constraint: this._settings.constraint,
8669
8669
  isCJKVertical: u
8670
- }), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = eo(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
8670
+ }), this._layout = Ln.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this._injectablesConfig = o.injectables || { rules: [], allowedDomains: [] }, this._readiumRulesPromise = no(e.metadata, e.readingOrder.items), this._contentProtection = o.contentProtection || {}, this._keyboardPeripherals = this.mergeKeyboardPeripherals(
8671
8671
  this._contentProtection,
8672
8672
  o.keyboardPeripherals || []
8673
8673
  ), (this._contentProtection.disableContextMenu || this._contentProtection.checkAutomation || this._contentProtection.checkIFrameEmbedding || this._contentProtection.monitorDevTools || this._contentProtection.protectPrinting?.disable) && (this._navigatorProtector = new Ye(this._contentProtection), this._suspiciousActivityListener = (g) => {
@@ -8698,7 +8698,7 @@ class Ln extends dn {
8698
8698
  });
8699
8699
  }
8700
8700
  if (this._layout === b.fixed)
8701
- this.framePool = new Vr(
8701
+ this.framePool = new $r(
8702
8702
  this.container,
8703
8703
  this.positions,
8704
8704
  this.pub,
@@ -8711,7 +8711,7 @@ class Ln extends dn {
8711
8711
  else {
8712
8712
  await this.updateCSS(!1);
8713
8713
  const t = this.compileCSSProperties(this._css);
8714
- this.framePool = new Rr(
8714
+ this.framePool = new Tr(
8715
8715
  this.container,
8716
8716
  this.positions,
8717
8717
  t,
@@ -8953,7 +8953,7 @@ class Ln extends dn {
8953
8953
  break;
8954
8954
  }
8955
8955
  }
8956
- return await this.apply(), !0;
8956
+ return await this.apply(), this.listeners.positionChanged(this.currentLocation), !0;
8957
8957
  }
8958
8958
  const e = this.pub.readingOrder.findIndexWithHref(this.currentLocation.href), i = Math.max(
8959
8959
  0,
@@ -9101,7 +9101,7 @@ class Ln extends dn {
9101
9101
  return this.go(t.locator, e, i);
9102
9102
  }
9103
9103
  }
9104
- const no = `// PreservePitchProcessor.js
9104
+ const ro = `// PreservePitchProcessor.js
9105
9105
  // AudioWorklet processor for pitch preservation via pitch shifting.
9106
9106
  //
9107
9107
  // Architecture:
@@ -9326,7 +9326,7 @@ class Ke {
9326
9326
  if (n)
9327
9327
  await e.audioWorklet.addModule(n);
9328
9328
  else {
9329
- const o = new Blob([no], { type: "text/javascript" });
9329
+ const o = new Blob([ro], { type: "text/javascript" });
9330
9330
  s.url = URL.createObjectURL(o), await e.audioWorklet.addModule(s.url);
9331
9331
  }
9332
9332
  } catch (o) {
@@ -9346,7 +9346,7 @@ class Ke {
9346
9346
  this.workletNode && (this.workletNode.disconnect(), this.workletNode = null), this.url && (URL.revokeObjectURL(this.url), this.url = null);
9347
9347
  }
9348
9348
  }
9349
- class so {
9349
+ class oo {
9350
9350
  constructor(t) {
9351
9351
  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;
9352
9352
  }
@@ -9623,7 +9623,7 @@ class ce {
9623
9623
  return new ce(e);
9624
9624
  }
9625
9625
  }
9626
- class ro {
9626
+ class ao {
9627
9627
  constructor(t = {}) {
9628
9628
  this.volume = F(t.volume, ie.range) ?? 1, this.playbackRate = F(t.playbackRate, ne.range) ?? 1, this.preservePitch = E(t.preservePitch) ?? !0, this.skipBackwardInterval = F(t.skipBackwardInterval, it.range) ?? 10, this.skipForwardInterval = F(t.skipForwardInterval, it.range) ?? 10, this.pollInterval = S(t.pollInterval) ?? 1e3, this.autoPlay = E(t.autoPlay) ?? !0, this.enableMediaSession = E(t.enableMediaSession) ?? !0;
9629
9629
  }
@@ -9733,7 +9733,7 @@ class $i {
9733
9733
  }
9734
9734
  }
9735
9735
  const Gi = 1, Xi = 1;
9736
- class oo {
9736
+ class lo {
9737
9737
  constructor(t, e, i = {}) {
9738
9738
  this.pool = /* @__PURE__ */ new Map(), this._audioEngine = t, this._publication = e, this._supportedAudioTypes = this.detectSupportedAudioTypes(), i.disableRemotePlayback && (this._audioEngine.getMediaElement().disableRemotePlayback = !0);
9739
9739
  }
@@ -9810,7 +9810,7 @@ class oo {
9810
9810
  this.pool.clear();
9811
9811
  }
9812
9812
  }
9813
- class ao {
9813
+ class ho {
9814
9814
  constructor(t = {}) {
9815
9815
  this.dragstartHandler = (e) => {
9816
9816
  e.preventDefault(), e.stopPropagation(), t.onDragDetected?.(Array.from(e.dataTransfer?.types ?? []));
@@ -9826,7 +9826,7 @@ class ao {
9826
9826
  document.removeEventListener("dragstart", this.dragstartHandler, !0), document.removeEventListener("dragover", this.dragoverHandler, !0), document.removeEventListener("drop", this.dropHandler, !0), window.removeEventListener("unload", this.unloadHandler);
9827
9827
  }
9828
9828
  }
9829
- class lo {
9829
+ class co {
9830
9830
  constructor(t = {}) {
9831
9831
  this.copyHandler = (e) => {
9832
9832
  e.preventDefault(), e.stopPropagation(), t.onCopyBlocked?.();
@@ -9836,16 +9836,16 @@ class lo {
9836
9836
  document.removeEventListener("copy", this.copyHandler, !0), window.removeEventListener("unload", this.unloadHandler);
9837
9837
  }
9838
9838
  }
9839
- class ho extends Ye {
9839
+ class uo extends Ye {
9840
9840
  constructor(t = {}) {
9841
- super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new ao({
9841
+ super(t), t.disableDragAndDrop && (this.dragAndDropProtector = new ho({
9842
9842
  onDragDetected: (e) => {
9843
9843
  this.dispatchSuspiciousActivity("drag_detected", { dataTransferTypes: e, targetFrameSrc: "" });
9844
9844
  },
9845
9845
  onDropDetected: (e, i) => {
9846
9846
  this.dispatchSuspiciousActivity("drop_detected", { dataTransferTypes: e, fileCount: i, targetFrameSrc: "" });
9847
9847
  }
9848
- })), t.protectCopy && (this.copyProtector = new lo({
9848
+ })), t.protectCopy && (this.copyProtector = new co({
9849
9849
  onCopyBlocked: () => {
9850
9850
  this.dispatchSuspiciousActivity("bulk_copy", { targetFrameSrc: "" });
9851
9851
  }
@@ -9855,7 +9855,7 @@ class ho extends Ye {
9855
9855
  super.destroy(), this.dragAndDropProtector?.destroy(), this.copyProtector?.destroy();
9856
9856
  }
9857
9857
  }
9858
- const co = (r) => ({
9858
+ const po = (r) => ({
9859
9859
  trackLoaded: r.trackLoaded ?? (() => {
9860
9860
  }),
9861
9861
  positionChanged: r.positionChanged ?? (() => {
@@ -9887,12 +9887,12 @@ const co = (r) => ({
9887
9887
  remotePlaybackStateChanged: r.remotePlaybackStateChanged ?? (() => {
9888
9888
  })
9889
9889
  });
9890
- class mo extends vs {
9890
+ class yo extends vs {
9891
9891
  constructor(t, e, i, n = {
9892
9892
  preferences: {},
9893
9893
  defaults: {}
9894
9894
  }) {
9895
- 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 = co(e), this._preferences = new ce(n.preferences), this._defaults = new ro(n.defaults), this._settings = new ji(this._preferences, this._defaults), t.readingOrder.items.length === 0)
9895
+ 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 = po(e), this._preferences = new ce(n.preferences), this._defaults = new ao(n.defaults), this._settings = new ji(this._preferences, this._defaults), t.readingOrder.items.length === 0)
9896
9896
  throw new Error("AudioNavigator: publication has an empty reading order");
9897
9897
  if (i)
9898
9898
  this.currentLocation = this.ensureLocatorLocations(i);
@@ -9913,7 +9913,7 @@ class mo extends vs {
9913
9913
  const s = this.currentLocation.href.split("#")[0], o = this.hrefToTrackIndex(s);
9914
9914
  if (o === -1)
9915
9915
  throw new Error(`AudioNavigator: initial href "${s}" not found in reading order`);
9916
- const a = this.currentLocation.locations?.time() || 0, l = new so({
9916
+ const a = this.currentLocation.locations?.time() || 0, l = new oo({
9917
9917
  playback: {
9918
9918
  state: {
9919
9919
  currentTime: a,
@@ -9923,14 +9923,14 @@ class mo extends vs {
9923
9923
  index: o
9924
9924
  }
9925
9925
  });
9926
- this.pool = new oo(l, t, n.contentProtection);
9926
+ this.pool = new lo(l, t, n.contentProtection);
9927
9927
  const h = n.contentProtection || {};
9928
9928
  this._contentProtection = h;
9929
9929
  const c = this.mergeKeyboardPeripherals(
9930
9930
  h,
9931
9931
  n.keyboardPeripherals || []
9932
9932
  );
9933
- (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new ho(h), this._suspiciousActivityListener = (u) => {
9933
+ (h.disableContextMenu || h.checkAutomation || h.checkIFrameEmbedding || h.monitorDevTools || h.protectPrinting?.disable || h.disableDragAndDrop || h.protectCopy) && (this._navigatorProtector = new uo(h), this._suspiciousActivityListener = (u) => {
9934
9934
  const { type: p, ...g } = u.detail;
9935
9935
  p === "context_menu" ? this.listeners.contextMenu(g) : this.listeners.contentProtection(p, g);
9936
9936
  }, window.addEventListener(ot, this._suspiciousActivityListener)), c.length > 0 && (this._keyboardPeripheralsManager = new qe({ keyboardPeripherals: c }), this._keyboardPeripheralListener = (u) => {
@@ -10247,28 +10247,28 @@ class mo extends vs {
10247
10247
  }
10248
10248
  }
10249
10249
  export {
10250
- ro as AudioDefaults,
10251
- mo as AudioNavigator,
10250
+ ao as AudioDefaults,
10251
+ yo as AudioNavigator,
10252
10252
  ce as AudioPreferences,
10253
10253
  $i as AudioPreferencesEditor,
10254
10254
  ji as AudioSettings,
10255
10255
  A as BooleanPreference,
10256
10256
  yn as EnumPreference,
10257
- jr as EpubDefaults,
10257
+ Gr as EpubDefaults,
10258
10258
  Ln as EpubNavigator,
10259
10259
  Ft as EpubPreferences,
10260
10260
  Bi as EpubPreferencesEditor,
10261
10261
  Vi as EpubSettings,
10262
- fo as ExperimentalWebPubNavigator,
10263
- Mr as FXLCoordinator,
10264
- Ar as FXLFrameManager,
10265
- Vr as FXLFramePoolManager,
10266
- Ir as FXLPeripherals,
10267
- zr as FXLSpreader,
10262
+ go as ExperimentalWebPubNavigator,
10263
+ Ir as FXLCoordinator,
10264
+ Nr as FXLFrameManager,
10265
+ $r as FXLFramePoolManager,
10266
+ Dr as FXLPeripherals,
10267
+ Wr as FXLSpreader,
10268
10268
  Nt as FrameComms,
10269
10269
  Cn as FrameManager,
10270
- Rr as FramePoolManager,
10271
- Tr as HorizontalThird,
10270
+ Tr as FramePoolManager,
10271
+ Mr as HorizontalThird,
10272
10272
  Sn as Injector,
10273
10273
  kt as LineLengths,
10274
10274
  vs as MediaNavigator,
@@ -10276,32 +10276,32 @@ export {
10276
10276
  Ne as Orientation,
10277
10277
  N as Preference,
10278
10278
  le as Properties,
10279
- Zr as RSProperties,
10279
+ to as RSProperties,
10280
10280
  x as RangePreference,
10281
- Qr as ReadiumCSS,
10281
+ eo as ReadiumCSS,
10282
10282
  Me as Spread,
10283
10283
  tt as TextAlignment,
10284
10284
  _n as UserProperties,
10285
- Nr as VerticalThird,
10285
+ Fr as VerticalThird,
10286
10286
  dn as VisualNavigator,
10287
- so as WebAudioEngine,
10287
+ oo as WebAudioEngine,
10288
10288
  Ps as WebPubBlobBuilder,
10289
- lr as WebPubCSS,
10290
- dr as WebPubDefaults,
10289
+ cr as WebPubCSS,
10290
+ pr as WebPubDefaults,
10291
10291
  ks as WebPubFrameManager,
10292
10292
  Os as WebPubFramePoolManager,
10293
- kr as WebPubNavigator,
10293
+ Rr as WebPubNavigator,
10294
10294
  Mt as WebPubPreferences,
10295
10295
  Ti as WebPubPreferencesEditor,
10296
10296
  Ai as WebPubSettings,
10297
- ar as WebRSProperties,
10297
+ hr as WebRSProperties,
10298
10298
  mn as WebUserProperties,
10299
10299
  E as ensureBoolean,
10300
10300
  he as ensureEnumValue,
10301
10301
  gn as ensureExperiment,
10302
10302
  wt as ensureFilter,
10303
- hr as ensureLessThanOrEqual,
10304
- cr as ensureMoreThanOrEqual,
10303
+ dr as ensureLessThanOrEqual,
10304
+ ur as ensureMoreThanOrEqual,
10305
10305
  S as ensureNonNegative,
10306
10306
  W as ensureString,
10307
10307
  F as ensureValueInRange,
@@ -10311,7 +10311,7 @@ export {
10311
10311
  st as fontWeightRangeConfig,
10312
10312
  qt as fontWidthRangeConfig,
10313
10313
  bt as getScriptMode,
10314
- po as i18n,
10314
+ mo as i18n,
10315
10315
  Kt as letterSpacingRangeConfig,
10316
10316
  Jt as lineHeightRangeConfig,
10317
10317
  ut as lineLengthRangeConfig,
@@ -10320,7 +10320,7 @@ export {
10320
10320
  ne as playbackRateRangeConfig,
10321
10321
  J as sML,
10322
10322
  T as sMLWithRequest,
10323
- uo as settings,
10323
+ fo as settings,
10324
10324
  it as skipIntervalRangeConfig,
10325
10325
  ie as volumeRangeConfig,
10326
10326
  ge as withFallback,