@readium/navigator 2.0.0 → 2.1.0
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 +870 -788
- package/dist/index.umd.cjs +14 -14
- package/package.json +1 -1
- package/src/epub/css/ReadiumCSS.ts +23 -22
package/dist/index.js
CHANGED
|
@@ -1,4 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
const Z = class st {
|
|
2
|
+
constructor(t) {
|
|
3
|
+
if (typeof t == "string") {
|
|
4
|
+
if (!st.VALID_MODES.has(t.toLowerCase()))
|
|
5
|
+
return;
|
|
6
|
+
this.value = t.toLowerCase();
|
|
7
|
+
} else {
|
|
8
|
+
const e = t.filter(
|
|
9
|
+
(A) => st.VALID_MODES.has(A.toLowerCase())
|
|
10
|
+
);
|
|
11
|
+
if (e.length === 0)
|
|
12
|
+
return;
|
|
13
|
+
this.value = Array.from(new Set(e));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parses a [PrimaryAccessMode] from its RWPM JSON representation.
|
|
18
|
+
*/
|
|
19
|
+
static deserialize(t) {
|
|
20
|
+
if (!t)
|
|
21
|
+
return;
|
|
22
|
+
if (typeof t == "string")
|
|
23
|
+
return new st(t);
|
|
24
|
+
if (!Array.isArray(t))
|
|
25
|
+
return;
|
|
26
|
+
const e = t.filter((A) => A ? st.VALID_MODES.has(A.toLowerCase()) : !1);
|
|
27
|
+
if (e.length !== 0)
|
|
28
|
+
return new st(e);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
|
|
32
|
+
*/
|
|
33
|
+
serialize() {
|
|
34
|
+
return this.value;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
Z.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]);
|
|
38
|
+
Z.AUDITORY = new Z("auditory");
|
|
39
|
+
Z.TACTILE = new Z("tactile");
|
|
40
|
+
Z.TEXTUAL = new Z("textual");
|
|
41
|
+
Z.VISUAL = new Z("visual");
|
|
42
|
+
var p = /* @__PURE__ */ ((i) => (i.reflowable = "reflowable", i.fixed = "fixed", i.scrolled = "scrolled", i))(p || {});
|
|
43
|
+
let PA = class Ke {
|
|
2
44
|
/**
|
|
3
45
|
* Creates a [Encryption].
|
|
4
46
|
*/
|
|
@@ -26,8 +68,8 @@ let VA = class Ke {
|
|
|
26
68
|
return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
|
|
27
69
|
}
|
|
28
70
|
};
|
|
29
|
-
var
|
|
30
|
-
|
|
71
|
+
var J = /* @__PURE__ */ ((i) => (i.left = "left", i.right = "right", i.center = "center", i))(J || {});
|
|
72
|
+
class j {
|
|
31
73
|
constructor(t) {
|
|
32
74
|
this.otherProperties = t;
|
|
33
75
|
}
|
|
@@ -39,7 +81,7 @@ let J = class Jt {
|
|
|
39
81
|
*/
|
|
40
82
|
static deserialize(t) {
|
|
41
83
|
if (t)
|
|
42
|
-
return new
|
|
84
|
+
return new j(t);
|
|
43
85
|
}
|
|
44
86
|
/**
|
|
45
87
|
* Serializes a [Properties] to its RWPM JSON representation.
|
|
@@ -54,34 +96,34 @@ let J = class Jt {
|
|
|
54
96
|
const e = Object.assign({}, this.otherProperties);
|
|
55
97
|
for (const A in t)
|
|
56
98
|
e[A] = t[A];
|
|
57
|
-
return new
|
|
99
|
+
return new j(e);
|
|
58
100
|
}
|
|
59
|
-
}
|
|
60
|
-
Object.defineProperty(
|
|
101
|
+
}
|
|
102
|
+
Object.defineProperty(j.prototype, "encryption", {
|
|
61
103
|
get: function() {
|
|
62
|
-
return
|
|
104
|
+
return PA.deserialize(this.otherProperties.encrypted);
|
|
63
105
|
}
|
|
64
106
|
});
|
|
65
|
-
function
|
|
107
|
+
function vA(i) {
|
|
66
108
|
return i && i instanceof Array ? i : void 0;
|
|
67
109
|
}
|
|
68
110
|
function qe(i) {
|
|
69
|
-
return i && typeof i == "string" ? [i] :
|
|
111
|
+
return i && typeof i == "string" ? [i] : vA(i);
|
|
70
112
|
}
|
|
71
|
-
function
|
|
113
|
+
function me(i) {
|
|
72
114
|
return typeof i == "string" ? new Date(i) : void 0;
|
|
73
115
|
}
|
|
74
|
-
function
|
|
116
|
+
function Ft(i) {
|
|
75
117
|
return isNaN(i) ? void 0 : i;
|
|
76
118
|
}
|
|
77
119
|
function S(i) {
|
|
78
|
-
return
|
|
120
|
+
return Ft(i) !== void 0 && Math.sign(i) >= 0 ? i : void 0;
|
|
79
121
|
}
|
|
80
|
-
function
|
|
122
|
+
function bA(i) {
|
|
81
123
|
const t = new Array();
|
|
82
124
|
return i.forEach((e) => t.push(e)), t;
|
|
83
125
|
}
|
|
84
|
-
|
|
126
|
+
class d {
|
|
85
127
|
/** Creates a MediaType object. */
|
|
86
128
|
constructor(t) {
|
|
87
129
|
let e, A, n = t.mediaType.replace(/\s/g, "").split(";");
|
|
@@ -110,7 +152,7 @@ let Ft = class u {
|
|
|
110
152
|
this.string = h, this.type = e, this.subtype = A, this.parameters = o, this.encoding = c, this.name = t.name, this.fileExtension = t.fileExtension;
|
|
111
153
|
}
|
|
112
154
|
static parse(t) {
|
|
113
|
-
return new
|
|
155
|
+
return new d(t);
|
|
114
156
|
}
|
|
115
157
|
/** Structured syntax suffix, e.g. `+zip` in `application/epub+zip`.
|
|
116
158
|
* Gives a hint on the underlying structure of this media type.
|
|
@@ -140,7 +182,7 @@ let Ft = class u {
|
|
|
140
182
|
* - Wildcards are supported, meaning that `image/*` contains `image/png`
|
|
141
183
|
*/
|
|
142
184
|
contains(t) {
|
|
143
|
-
const e = typeof t == "string" ?
|
|
185
|
+
const e = typeof t == "string" ? d.parse({ mediaType: t }) : t;
|
|
144
186
|
if (!((this.type === "*" || this.type === e.type) && (this.subtype === "*" || this.subtype === e.subtype)))
|
|
145
187
|
return !1;
|
|
146
188
|
const A = new Set(
|
|
@@ -159,7 +201,7 @@ let Ft = class u {
|
|
|
159
201
|
* doesn't. This is basically like `contains`, but working in both direction.
|
|
160
202
|
*/
|
|
161
203
|
matches(t) {
|
|
162
|
-
const e = typeof t == "string" ?
|
|
204
|
+
const e = typeof t == "string" ? d.parse({ mediaType: t }) : t;
|
|
163
205
|
return this.contains(e) || e.contains(this);
|
|
164
206
|
}
|
|
165
207
|
/**
|
|
@@ -178,38 +220,38 @@ let Ft = class u {
|
|
|
178
220
|
/** Returns whether this media type is structured as a ZIP archive. */
|
|
179
221
|
get isZIP() {
|
|
180
222
|
return this.matchesAny(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
223
|
+
d.ZIP,
|
|
224
|
+
d.LCP_PROTECTED_AUDIOBOOK,
|
|
225
|
+
d.LCP_PROTECTED_PDF
|
|
184
226
|
) || this.structuredSyntaxSuffix === "+zip";
|
|
185
227
|
}
|
|
186
228
|
/** Returns whether this media type is structured as a JSON file. */
|
|
187
229
|
get isJSON() {
|
|
188
|
-
return this.matchesAny(
|
|
230
|
+
return this.matchesAny(d.JSON) || this.structuredSyntaxSuffix === "+json";
|
|
189
231
|
}
|
|
190
232
|
/** Returns whether this media type is of an OPDS feed. */
|
|
191
233
|
get isOPDS() {
|
|
192
234
|
return this.matchesAny(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
235
|
+
d.OPDS1,
|
|
236
|
+
d.OPDS1_ENTRY,
|
|
237
|
+
d.OPDS2,
|
|
238
|
+
d.OPDS2_PUBLICATION,
|
|
239
|
+
d.OPDS_AUTHENTICATION
|
|
198
240
|
) || this.structuredSyntaxSuffix === "+json";
|
|
199
241
|
}
|
|
200
242
|
/** Returns whether this media type is of an HTML document. */
|
|
201
243
|
get isHTML() {
|
|
202
|
-
return this.matchesAny(
|
|
244
|
+
return this.matchesAny(d.HTML, d.XHTML);
|
|
203
245
|
}
|
|
204
246
|
/** Returns whether this media type is of a bitmap image, so excluding vectorial formats. */
|
|
205
247
|
get isBitmap() {
|
|
206
248
|
return this.matchesAny(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
249
|
+
d.BMP,
|
|
250
|
+
d.GIF,
|
|
251
|
+
d.JPEG,
|
|
252
|
+
d.PNG,
|
|
253
|
+
d.TIFF,
|
|
254
|
+
d.WEBP
|
|
213
255
|
);
|
|
214
256
|
}
|
|
215
257
|
/** Returns whether this media type is of an audio clip. */
|
|
@@ -223,319 +265,320 @@ let Ft = class u {
|
|
|
223
265
|
/** Returns whether this media type is of a Readium Web Publication Manifest. */
|
|
224
266
|
get isRWPM() {
|
|
225
267
|
return this.matchesAny(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
268
|
+
d.READIUM_AUDIOBOOK_MANIFEST,
|
|
269
|
+
d.DIVINA_MANIFEST,
|
|
270
|
+
d.READIUM_WEBPUB_MANIFEST
|
|
229
271
|
);
|
|
230
272
|
}
|
|
231
273
|
/** Returns whether this media type is of a publication file. */
|
|
232
274
|
get isPublication() {
|
|
233
275
|
return this.matchesAny(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
276
|
+
d.READIUM_AUDIOBOOK,
|
|
277
|
+
d.READIUM_AUDIOBOOK_MANIFEST,
|
|
278
|
+
d.CBZ,
|
|
279
|
+
d.DIVINA,
|
|
280
|
+
d.DIVINA_MANIFEST,
|
|
281
|
+
d.EPUB,
|
|
282
|
+
d.LCP_PROTECTED_AUDIOBOOK,
|
|
283
|
+
d.LCP_PROTECTED_PDF,
|
|
284
|
+
d.LPF,
|
|
285
|
+
d.PDF,
|
|
286
|
+
d.W3C_WPUB_MANIFEST,
|
|
287
|
+
d.READIUM_WEBPUB,
|
|
288
|
+
d.READIUM_WEBPUB_MANIFEST,
|
|
289
|
+
d.ZAB
|
|
248
290
|
);
|
|
249
291
|
}
|
|
250
292
|
// Known Media Types
|
|
251
293
|
static get AAC() {
|
|
252
|
-
return
|
|
294
|
+
return d.parse({ mediaType: "audio/aac", fileExtension: "aac" });
|
|
253
295
|
}
|
|
254
296
|
static get ACSM() {
|
|
255
|
-
return
|
|
297
|
+
return d.parse({
|
|
256
298
|
mediaType: "application/vnd.adobe.adept+xml",
|
|
257
299
|
name: "Adobe Content Server Message",
|
|
258
300
|
fileExtension: "acsm"
|
|
259
301
|
});
|
|
260
302
|
}
|
|
261
303
|
static get AIFF() {
|
|
262
|
-
return
|
|
304
|
+
return d.parse({ mediaType: "audio/aiff", fileExtension: "aiff" });
|
|
263
305
|
}
|
|
264
306
|
static get AVI() {
|
|
265
|
-
return
|
|
307
|
+
return d.parse({
|
|
266
308
|
mediaType: "video/x-msvideo",
|
|
267
309
|
fileExtension: "avi"
|
|
268
310
|
});
|
|
269
311
|
}
|
|
270
312
|
static get BINARY() {
|
|
271
|
-
return
|
|
313
|
+
return d.parse({ mediaType: "application/octet-stream" });
|
|
272
314
|
}
|
|
273
315
|
static get BMP() {
|
|
274
|
-
return
|
|
316
|
+
return d.parse({ mediaType: "image/bmp", fileExtension: "bmp" });
|
|
275
317
|
}
|
|
276
318
|
static get CBZ() {
|
|
277
|
-
return
|
|
319
|
+
return d.parse({
|
|
278
320
|
mediaType: "application/vnd.comicbook+zip",
|
|
279
321
|
name: "Comic Book Archive",
|
|
280
322
|
fileExtension: "cbz"
|
|
281
323
|
});
|
|
282
324
|
}
|
|
283
325
|
static get CSS() {
|
|
284
|
-
return
|
|
326
|
+
return d.parse({ mediaType: "text/css", fileExtension: "css" });
|
|
285
327
|
}
|
|
286
328
|
static get DIVINA() {
|
|
287
|
-
return
|
|
329
|
+
return d.parse({
|
|
288
330
|
mediaType: "application/divina+zip",
|
|
289
331
|
name: "Digital Visual Narratives",
|
|
290
332
|
fileExtension: "divina"
|
|
291
333
|
});
|
|
292
334
|
}
|
|
293
335
|
static get DIVINA_MANIFEST() {
|
|
294
|
-
return
|
|
336
|
+
return d.parse({
|
|
295
337
|
mediaType: "application/divina+json",
|
|
296
338
|
name: "Digital Visual Narratives",
|
|
297
339
|
fileExtension: "json"
|
|
298
340
|
});
|
|
299
341
|
}
|
|
300
342
|
static get EPUB() {
|
|
301
|
-
return
|
|
343
|
+
return d.parse({
|
|
302
344
|
mediaType: "application/epub+zip",
|
|
303
345
|
name: "EPUB",
|
|
304
346
|
fileExtension: "epub"
|
|
305
347
|
});
|
|
306
348
|
}
|
|
307
349
|
static get GIF() {
|
|
308
|
-
return
|
|
350
|
+
return d.parse({ mediaType: "image/gif", fileExtension: "gif" });
|
|
309
351
|
}
|
|
310
352
|
static get GZ() {
|
|
311
|
-
return
|
|
353
|
+
return d.parse({
|
|
312
354
|
mediaType: "application/gzip",
|
|
313
355
|
fileExtension: "gz"
|
|
314
356
|
});
|
|
315
357
|
}
|
|
316
358
|
static get HTML() {
|
|
317
|
-
return
|
|
359
|
+
return d.parse({ mediaType: "text/html", fileExtension: "html" });
|
|
318
360
|
}
|
|
319
361
|
static get JAVASCRIPT() {
|
|
320
|
-
return
|
|
362
|
+
return d.parse({
|
|
321
363
|
mediaType: "text/javascript",
|
|
322
364
|
fileExtension: "js"
|
|
323
365
|
});
|
|
324
366
|
}
|
|
325
367
|
static get JPEG() {
|
|
326
|
-
return
|
|
368
|
+
return d.parse({ mediaType: "image/jpeg", fileExtension: "jpeg" });
|
|
327
369
|
}
|
|
328
370
|
static get JSON() {
|
|
329
|
-
return
|
|
371
|
+
return d.parse({ mediaType: "application/json" });
|
|
330
372
|
}
|
|
331
373
|
static get LCP_LICENSE_DOCUMENT() {
|
|
332
|
-
return
|
|
374
|
+
return d.parse({
|
|
333
375
|
mediaType: "application/vnd.readium.lcp.license.v1.0+json",
|
|
334
376
|
name: "LCP License",
|
|
335
377
|
fileExtension: "lcpl"
|
|
336
378
|
});
|
|
337
379
|
}
|
|
338
380
|
static get LCP_PROTECTED_AUDIOBOOK() {
|
|
339
|
-
return
|
|
381
|
+
return d.parse({
|
|
340
382
|
mediaType: "application/audiobook+lcp",
|
|
341
383
|
name: "LCP Protected Audiobook",
|
|
342
384
|
fileExtension: "lcpa"
|
|
343
385
|
});
|
|
344
386
|
}
|
|
345
387
|
static get LCP_PROTECTED_PDF() {
|
|
346
|
-
return
|
|
388
|
+
return d.parse({
|
|
347
389
|
mediaType: "application/pdf+lcp",
|
|
348
390
|
name: "LCP Protected PDF",
|
|
349
391
|
fileExtension: "lcpdf"
|
|
350
392
|
});
|
|
351
393
|
}
|
|
352
394
|
static get LCP_STATUS_DOCUMENT() {
|
|
353
|
-
return
|
|
395
|
+
return d.parse({
|
|
354
396
|
mediaType: "application/vnd.readium.license.status.v1.0+json"
|
|
355
397
|
});
|
|
356
398
|
}
|
|
357
399
|
static get LPF() {
|
|
358
|
-
return
|
|
400
|
+
return d.parse({
|
|
359
401
|
mediaType: "application/lpf+zip",
|
|
360
402
|
fileExtension: "lpf"
|
|
361
403
|
});
|
|
362
404
|
}
|
|
363
405
|
static get MP3() {
|
|
364
|
-
return
|
|
406
|
+
return d.parse({ mediaType: "audio/mpeg", fileExtension: "mp3" });
|
|
365
407
|
}
|
|
366
408
|
static get MPEG() {
|
|
367
|
-
return
|
|
409
|
+
return d.parse({ mediaType: "video/mpeg", fileExtension: "mpeg" });
|
|
368
410
|
}
|
|
369
411
|
static get NCX() {
|
|
370
|
-
return
|
|
412
|
+
return d.parse({
|
|
371
413
|
mediaType: "application/x-dtbncx+xml",
|
|
372
414
|
fileExtension: "ncx"
|
|
373
415
|
});
|
|
374
416
|
}
|
|
375
417
|
static get OGG() {
|
|
376
|
-
return
|
|
418
|
+
return d.parse({ mediaType: "audio/ogg", fileExtension: "oga" });
|
|
377
419
|
}
|
|
378
420
|
static get OGV() {
|
|
379
|
-
return
|
|
421
|
+
return d.parse({ mediaType: "video/ogg", fileExtension: "ogv" });
|
|
380
422
|
}
|
|
381
423
|
static get OPDS1() {
|
|
382
|
-
return
|
|
424
|
+
return d.parse({
|
|
383
425
|
mediaType: "application/atom+xml;profile=opds-catalog"
|
|
384
426
|
});
|
|
385
427
|
}
|
|
386
428
|
static get OPDS1_ENTRY() {
|
|
387
|
-
return
|
|
429
|
+
return d.parse({
|
|
388
430
|
mediaType: "application/atom+xml;type=entry;profile=opds-catalog"
|
|
389
431
|
});
|
|
390
432
|
}
|
|
391
433
|
static get OPDS2() {
|
|
392
|
-
return
|
|
434
|
+
return d.parse({ mediaType: "application/opds+json" });
|
|
393
435
|
}
|
|
394
436
|
static get OPDS2_PUBLICATION() {
|
|
395
|
-
return
|
|
437
|
+
return d.parse({ mediaType: "application/opds-publication+json" });
|
|
396
438
|
}
|
|
397
439
|
static get OPDS_AUTHENTICATION() {
|
|
398
|
-
return
|
|
440
|
+
return d.parse({
|
|
399
441
|
mediaType: "application/opds-authentication+json"
|
|
400
442
|
});
|
|
401
443
|
}
|
|
402
444
|
static get OPUS() {
|
|
403
|
-
return
|
|
445
|
+
return d.parse({ mediaType: "audio/opus", fileExtension: "opus" });
|
|
404
446
|
}
|
|
405
447
|
static get OTF() {
|
|
406
|
-
return
|
|
448
|
+
return d.parse({ mediaType: "font/otf", fileExtension: "otf" });
|
|
407
449
|
}
|
|
408
450
|
static get PDF() {
|
|
409
|
-
return
|
|
451
|
+
return d.parse({
|
|
410
452
|
mediaType: "application/pdf",
|
|
411
453
|
name: "PDF",
|
|
412
454
|
fileExtension: "pdf"
|
|
413
455
|
});
|
|
414
456
|
}
|
|
415
457
|
static get PNG() {
|
|
416
|
-
return
|
|
458
|
+
return d.parse({ mediaType: "image/png", fileExtension: "png" });
|
|
417
459
|
}
|
|
418
460
|
static get READIUM_AUDIOBOOK() {
|
|
419
|
-
return
|
|
461
|
+
return d.parse({
|
|
420
462
|
mediaType: "application/audiobook+zip",
|
|
421
463
|
name: "Readium Audiobook",
|
|
422
464
|
fileExtension: "audiobook"
|
|
423
465
|
});
|
|
424
466
|
}
|
|
425
467
|
static get READIUM_AUDIOBOOK_MANIFEST() {
|
|
426
|
-
return
|
|
468
|
+
return d.parse({
|
|
427
469
|
mediaType: "application/audiobook+json",
|
|
428
470
|
name: "Readium Audiobook",
|
|
429
471
|
fileExtension: "json"
|
|
430
472
|
});
|
|
431
473
|
}
|
|
432
474
|
static get READIUM_CONTENT_DOCUMENT() {
|
|
433
|
-
return
|
|
475
|
+
return d.parse({
|
|
434
476
|
mediaType: "application/vnd.readium.content+json",
|
|
435
477
|
name: "Readium Content Document",
|
|
436
478
|
fileExtension: "json"
|
|
437
479
|
});
|
|
438
480
|
}
|
|
439
481
|
static get READIUM_GUIDED_NAVIGATION_DOCUMENT() {
|
|
440
|
-
return
|
|
482
|
+
return d.parse({
|
|
441
483
|
mediaType: "application/guided-navigation+json",
|
|
442
484
|
name: "Readium Guided Navigation Document",
|
|
443
485
|
fileExtension: "json"
|
|
444
486
|
});
|
|
445
487
|
}
|
|
446
488
|
static get READIUM_POSITION_LIST() {
|
|
447
|
-
return
|
|
489
|
+
return d.parse({
|
|
448
490
|
mediaType: "application/vnd.readium.position-list+json",
|
|
449
491
|
name: "Readium Position List",
|
|
450
492
|
fileExtension: "json"
|
|
451
493
|
});
|
|
452
494
|
}
|
|
453
495
|
static get READIUM_WEBPUB() {
|
|
454
|
-
return
|
|
496
|
+
return d.parse({
|
|
455
497
|
mediaType: "application/webpub+zip",
|
|
456
498
|
name: "Readium Web Publication",
|
|
457
499
|
fileExtension: "webpub"
|
|
458
500
|
});
|
|
459
501
|
}
|
|
460
502
|
static get READIUM_WEBPUB_MANIFEST() {
|
|
461
|
-
return
|
|
503
|
+
return d.parse({
|
|
462
504
|
mediaType: "application/webpub+json",
|
|
463
505
|
name: "Readium Web Publication",
|
|
464
506
|
fileExtension: "json"
|
|
465
507
|
});
|
|
466
508
|
}
|
|
467
509
|
static get SMIL() {
|
|
468
|
-
return
|
|
510
|
+
return d.parse({
|
|
469
511
|
mediaType: "application/smil+xml",
|
|
470
512
|
fileExtension: "smil"
|
|
471
513
|
});
|
|
472
514
|
}
|
|
473
515
|
static get SVG() {
|
|
474
|
-
return
|
|
516
|
+
return d.parse({
|
|
475
517
|
mediaType: "image/svg+xml",
|
|
476
518
|
fileExtension: "svg"
|
|
477
519
|
});
|
|
478
520
|
}
|
|
479
521
|
static get TEXT() {
|
|
480
|
-
return
|
|
522
|
+
return d.parse({ mediaType: "text/plain", fileExtension: "txt" });
|
|
481
523
|
}
|
|
482
524
|
static get TIFF() {
|
|
483
|
-
return
|
|
525
|
+
return d.parse({ mediaType: "image/tiff", fileExtension: "tiff" });
|
|
484
526
|
}
|
|
485
527
|
static get TTF() {
|
|
486
|
-
return
|
|
528
|
+
return d.parse({ mediaType: "font/ttf", fileExtension: "ttf" });
|
|
487
529
|
}
|
|
488
530
|
static get W3C_WPUB_MANIFEST() {
|
|
489
|
-
return
|
|
531
|
+
return d.parse({
|
|
490
532
|
mediaType: "application/x.readium.w3c.wpub+json",
|
|
491
533
|
name: "Web Publication",
|
|
492
534
|
fileExtension: "json"
|
|
493
535
|
});
|
|
494
536
|
}
|
|
495
537
|
static get WAV() {
|
|
496
|
-
return
|
|
538
|
+
return d.parse({ mediaType: "audio/wav", fileExtension: "wav" });
|
|
497
539
|
}
|
|
498
540
|
static get WEBM_AUDIO() {
|
|
499
|
-
return
|
|
541
|
+
return d.parse({ mediaType: "audio/webm", fileExtension: "webm" });
|
|
500
542
|
}
|
|
501
543
|
static get WEBM_VIDEO() {
|
|
502
|
-
return
|
|
544
|
+
return d.parse({ mediaType: "video/webm", fileExtension: "webm" });
|
|
503
545
|
}
|
|
504
546
|
static get WEBP() {
|
|
505
|
-
return
|
|
547
|
+
return d.parse({ mediaType: "image/webp", fileExtension: "webp" });
|
|
506
548
|
}
|
|
507
549
|
static get WOFF() {
|
|
508
|
-
return
|
|
550
|
+
return d.parse({ mediaType: "font/woff", fileExtension: "woff" });
|
|
509
551
|
}
|
|
510
552
|
static get WOFF2() {
|
|
511
|
-
return
|
|
553
|
+
return d.parse({ mediaType: "font/woff2", fileExtension: "woff2" });
|
|
512
554
|
}
|
|
513
555
|
static get XHTML() {
|
|
514
|
-
return
|
|
556
|
+
return d.parse({
|
|
515
557
|
mediaType: "application/xhtml+xml",
|
|
516
558
|
fileExtension: "xhtml"
|
|
517
559
|
});
|
|
518
560
|
}
|
|
519
561
|
static get XML() {
|
|
520
|
-
return
|
|
562
|
+
return d.parse({
|
|
521
563
|
mediaType: "application/xml",
|
|
522
564
|
fileExtension: "xml"
|
|
523
565
|
});
|
|
524
566
|
}
|
|
525
567
|
static get ZAB() {
|
|
526
|
-
return
|
|
568
|
+
return d.parse({
|
|
527
569
|
mediaType: "application/x.readium.zab+zip",
|
|
528
570
|
name: "Zipped Audio Book",
|
|
529
571
|
fileExtension: "zab"
|
|
530
572
|
});
|
|
531
573
|
}
|
|
532
574
|
static get ZIP() {
|
|
533
|
-
return
|
|
575
|
+
return d.parse({
|
|
534
576
|
mediaType: "application/zip",
|
|
535
577
|
fileExtension: "zip"
|
|
536
578
|
});
|
|
537
579
|
}
|
|
538
|
-
}
|
|
580
|
+
}
|
|
581
|
+
let Me = class {
|
|
539
582
|
constructor(t) {
|
|
540
583
|
this.uri = t, this.parameters = this.getParameters(t);
|
|
541
584
|
}
|
|
@@ -576,7 +619,7 @@ class T {
|
|
|
576
619
|
static deserialize(t) {
|
|
577
620
|
if (!t)
|
|
578
621
|
return;
|
|
579
|
-
const e =
|
|
622
|
+
const e = Ft(t.progression), A = Ft(t.totalProgression), n = Ft(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
|
|
580
623
|
"fragment",
|
|
581
624
|
"fragments",
|
|
582
625
|
"progression",
|
|
@@ -601,7 +644,7 @@ class T {
|
|
|
601
644
|
return this.fragments && (t.fragments = this.fragments), this.progression !== void 0 && (t.progression = this.progression), this.totalProgression !== void 0 && (t.totalProgression = this.totalProgression), this.position !== void 0 && (t.position = this.position), this.otherLocations && this.otherLocations.forEach((e, A) => t[A] = e), t;
|
|
602
645
|
}
|
|
603
646
|
}
|
|
604
|
-
let
|
|
647
|
+
let GA = class _e {
|
|
605
648
|
/**
|
|
606
649
|
* Creates a [Text].
|
|
607
650
|
*/
|
|
@@ -626,7 +669,8 @@ let vA = class _e {
|
|
|
626
669
|
const t = {};
|
|
627
670
|
return this.after !== void 0 && (t.after = this.after), this.before !== void 0 && (t.before = this.before), this.highlight !== void 0 && (t.highlight = this.highlight), t;
|
|
628
671
|
}
|
|
629
|
-
}
|
|
672
|
+
};
|
|
673
|
+
class ut {
|
|
630
674
|
/**
|
|
631
675
|
* Creates a [Locator].
|
|
632
676
|
*/
|
|
@@ -638,12 +682,12 @@ let vA = class _e {
|
|
|
638
682
|
*/
|
|
639
683
|
static deserialize(t) {
|
|
640
684
|
if (t && t.href && t.type)
|
|
641
|
-
return new
|
|
685
|
+
return new ut({
|
|
642
686
|
href: t.href,
|
|
643
687
|
type: t.type,
|
|
644
688
|
title: t.title,
|
|
645
689
|
locations: T.deserialize(t.locations),
|
|
646
|
-
text:
|
|
690
|
+
text: GA.deserialize(t.text)
|
|
647
691
|
});
|
|
648
692
|
}
|
|
649
693
|
/**
|
|
@@ -657,7 +701,7 @@ let vA = class _e {
|
|
|
657
701
|
* Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
|
|
658
702
|
*/
|
|
659
703
|
copyWithLocations(t) {
|
|
660
|
-
return new
|
|
704
|
+
return new ut({
|
|
661
705
|
href: this.href,
|
|
662
706
|
type: this.type,
|
|
663
707
|
title: this.title,
|
|
@@ -665,7 +709,7 @@ let vA = class _e {
|
|
|
665
709
|
locations: new T({ ...this.locations, ...t })
|
|
666
710
|
});
|
|
667
711
|
}
|
|
668
|
-
}
|
|
712
|
+
}
|
|
669
713
|
class X {
|
|
670
714
|
/**
|
|
671
715
|
* Creates a [Link].
|
|
@@ -684,15 +728,15 @@ class X {
|
|
|
684
728
|
type: t.type,
|
|
685
729
|
title: t.title,
|
|
686
730
|
rels: t.rel ? t.rel instanceof Array ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
|
|
687
|
-
properties:
|
|
731
|
+
properties: j.deserialize(t.properties),
|
|
688
732
|
height: S(t.height),
|
|
689
733
|
width: S(t.width),
|
|
690
734
|
size: S(t.size),
|
|
691
735
|
duration: S(t.duration),
|
|
692
736
|
bitrate: S(t.bitrate),
|
|
693
737
|
languages: qe(t.language),
|
|
694
|
-
alternates:
|
|
695
|
-
children:
|
|
738
|
+
alternates: fe.deserialize(t.alternate),
|
|
739
|
+
children: fe.deserialize(t.children)
|
|
696
740
|
});
|
|
697
741
|
}
|
|
698
742
|
/**
|
|
@@ -700,11 +744,11 @@ class X {
|
|
|
700
744
|
*/
|
|
701
745
|
serialize() {
|
|
702
746
|
const t = { href: this.href };
|
|
703
|
-
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 =
|
|
747
|
+
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 = bA(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;
|
|
704
748
|
}
|
|
705
749
|
/** MediaType of the linked resource. */
|
|
706
750
|
get mediaType() {
|
|
707
|
-
return this.type !== void 0 ?
|
|
751
|
+
return this.type !== void 0 ? d.parse({ mediaType: this.type }) : d.BINARY;
|
|
708
752
|
}
|
|
709
753
|
/** Computes an absolute URL to the link, relative to the given `baseURL`.
|
|
710
754
|
* If the link's `href` is already absolute, the `baseURL` is ignored.
|
|
@@ -718,14 +762,14 @@ class X {
|
|
|
718
762
|
}
|
|
719
763
|
/** List of URI template parameter keys, if the `Link` is templated. */
|
|
720
764
|
get templateParameters() {
|
|
721
|
-
return this.templated ? new
|
|
765
|
+
return this.templated ? new Me(this.href).parameters : /* @__PURE__ */ new Set();
|
|
722
766
|
}
|
|
723
767
|
/** Expands the `Link`'s HREF by replacing URI template variables by the given parameters.
|
|
724
768
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
725
769
|
*/
|
|
726
770
|
expandTemplate(t) {
|
|
727
771
|
return new X({
|
|
728
|
-
href: new
|
|
772
|
+
href: new Me(this.href).expand(t),
|
|
729
773
|
templated: !1
|
|
730
774
|
});
|
|
731
775
|
}
|
|
@@ -735,14 +779,14 @@ class X {
|
|
|
735
779
|
addProperties(t) {
|
|
736
780
|
var e;
|
|
737
781
|
const A = X.deserialize(this.serialize());
|
|
738
|
-
return A.properties = A.properties ? (e = A.properties) == null ? void 0 : e.add(t) : new
|
|
782
|
+
return A.properties = A.properties ? (e = A.properties) == null ? void 0 : e.add(t) : new j(t), A;
|
|
739
783
|
}
|
|
740
784
|
/**
|
|
741
785
|
* Creates a [Locator] from a reading order [Link].
|
|
742
786
|
*/
|
|
743
787
|
get locator() {
|
|
744
788
|
let t = this.href.split("#");
|
|
745
|
-
return new
|
|
789
|
+
return new ut({
|
|
746
790
|
href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
|
|
747
791
|
type: this.type ?? "",
|
|
748
792
|
title: this.title,
|
|
@@ -752,7 +796,7 @@ class X {
|
|
|
752
796
|
});
|
|
753
797
|
}
|
|
754
798
|
}
|
|
755
|
-
class
|
|
799
|
+
let fe = class $e {
|
|
756
800
|
/**
|
|
757
801
|
* Creates a [Links].
|
|
758
802
|
*/
|
|
@@ -764,7 +808,7 @@ class Ut {
|
|
|
764
808
|
*/
|
|
765
809
|
static deserialize(t) {
|
|
766
810
|
if (t && t instanceof Array)
|
|
767
|
-
return new
|
|
811
|
+
return new $e(
|
|
768
812
|
t.map((e) => X.deserialize(e)).filter((e) => e !== void 0)
|
|
769
813
|
);
|
|
770
814
|
}
|
|
@@ -845,12 +889,12 @@ class Ut {
|
|
|
845
889
|
filterLinksHasType() {
|
|
846
890
|
return this.items.filter((t) => t.type);
|
|
847
891
|
}
|
|
848
|
-
}
|
|
849
|
-
var
|
|
850
|
-
|
|
892
|
+
};
|
|
893
|
+
var tA = /* @__PURE__ */ ((i) => (i.EPUB = "https://readium.org/webpub-manifest/profiles/epub", i.AUDIOBOOK = "https://readium.org/webpub-manifest/profiles/audiobook", i.DIVINA = "https://readium.org/webpub-manifest/profiles/divina", i.PDF = "https://readium.org/webpub-manifest/profiles/pdf", i))(tA || {}), R = /* @__PURE__ */ ((i) => (i.ltr = "ltr", i.rtl = "rtl", i))(R || {});
|
|
894
|
+
j.prototype.getContains = function() {
|
|
851
895
|
return new Set(this.otherProperties.contains || []);
|
|
852
896
|
};
|
|
853
|
-
let pe = class
|
|
897
|
+
let pe = class eA {
|
|
854
898
|
/**
|
|
855
899
|
* Creates a [DomRange].
|
|
856
900
|
*/
|
|
@@ -867,7 +911,7 @@ let pe = class tA {
|
|
|
867
911
|
if (e === void 0)
|
|
868
912
|
return;
|
|
869
913
|
let A = S(t.charOffset);
|
|
870
|
-
return A === void 0 && (A = S(t.offset)), new
|
|
914
|
+
return A === void 0 && (A = S(t.offset)), new eA({
|
|
871
915
|
cssSelector: t.cssSelector,
|
|
872
916
|
textNodeIndex: e,
|
|
873
917
|
charOffset: A
|
|
@@ -883,7 +927,7 @@ let pe = class tA {
|
|
|
883
927
|
};
|
|
884
928
|
return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
|
|
885
929
|
}
|
|
886
|
-
},
|
|
930
|
+
}, HA = class AA {
|
|
887
931
|
/**
|
|
888
932
|
* Creates a [DomRange].
|
|
889
933
|
*/
|
|
@@ -898,7 +942,7 @@ let pe = class tA {
|
|
|
898
942
|
return;
|
|
899
943
|
let e = pe.deserialize(t.start);
|
|
900
944
|
if (e)
|
|
901
|
-
return new
|
|
945
|
+
return new AA({
|
|
902
946
|
start: e,
|
|
903
947
|
end: pe.deserialize(t.end)
|
|
904
948
|
});
|
|
@@ -921,7 +965,7 @@ T.prototype.getPartialCfi = function() {
|
|
|
921
965
|
};
|
|
922
966
|
T.prototype.getDomRange = function() {
|
|
923
967
|
var i;
|
|
924
|
-
return
|
|
968
|
+
return HA.deserialize((i = this.otherLocations) == null ? void 0 : i.get("domRange"));
|
|
925
969
|
};
|
|
926
970
|
T.prototype.fragmentParameters = function() {
|
|
927
971
|
return new Map(
|
|
@@ -959,7 +1003,7 @@ T.prototype.space = function() {
|
|
|
959
1003
|
if (t.length === 4 && !t.some(isNaN))
|
|
960
1004
|
return t;
|
|
961
1005
|
};
|
|
962
|
-
let
|
|
1006
|
+
let kA = class iA {
|
|
963
1007
|
/** Creates a [Price]. */
|
|
964
1008
|
constructor(t) {
|
|
965
1009
|
this.currency = t.currency, this.value = t.value;
|
|
@@ -975,7 +1019,7 @@ let GA = class AA {
|
|
|
975
1019
|
return;
|
|
976
1020
|
let A = S(t.value);
|
|
977
1021
|
if (A !== void 0)
|
|
978
|
-
return new
|
|
1022
|
+
return new iA({ currency: e, value: A });
|
|
979
1023
|
}
|
|
980
1024
|
/**
|
|
981
1025
|
* Serializes a [Price] to its RWPM JSON representation.
|
|
@@ -983,7 +1027,7 @@ let GA = class AA {
|
|
|
983
1027
|
serialize() {
|
|
984
1028
|
return { currency: this.currency, value: this.value };
|
|
985
1029
|
}
|
|
986
|
-
},
|
|
1030
|
+
}, JA = class Ut {
|
|
987
1031
|
/** Creates a [Acquisition]. */
|
|
988
1032
|
constructor(t) {
|
|
989
1033
|
this.type = t.type, this.children = t.children;
|
|
@@ -993,14 +1037,14 @@ let GA = class AA {
|
|
|
993
1037
|
*/
|
|
994
1038
|
static deserialize(t) {
|
|
995
1039
|
if (t && t.type)
|
|
996
|
-
return new
|
|
1040
|
+
return new Ut({
|
|
997
1041
|
type: t.type,
|
|
998
|
-
children:
|
|
1042
|
+
children: Ut.deserializeArray(t.children)
|
|
999
1043
|
});
|
|
1000
1044
|
}
|
|
1001
1045
|
static deserializeArray(t) {
|
|
1002
1046
|
if (t instanceof Array)
|
|
1003
|
-
return t.map((e) =>
|
|
1047
|
+
return t.map((e) => Ut.deserialize(e)).filter((e) => e !== void 0);
|
|
1004
1048
|
}
|
|
1005
1049
|
/**
|
|
1006
1050
|
* Serializes a [Acquisition] to its RWPM JSON representation.
|
|
@@ -1009,7 +1053,7 @@ let GA = class AA {
|
|
|
1009
1053
|
const t = { type: this.type };
|
|
1010
1054
|
return this.children && (t.children = this.children.map((e) => e.serialize())), t;
|
|
1011
1055
|
}
|
|
1012
|
-
},
|
|
1056
|
+
}, WA = class nA {
|
|
1013
1057
|
/** Creates a [Price]. */
|
|
1014
1058
|
constructor(t) {
|
|
1015
1059
|
this.total = t.total, this.position = t.position;
|
|
@@ -1019,7 +1063,7 @@ let GA = class AA {
|
|
|
1019
1063
|
*/
|
|
1020
1064
|
static deserialize(t) {
|
|
1021
1065
|
if (t)
|
|
1022
|
-
return new
|
|
1066
|
+
return new nA({
|
|
1023
1067
|
total: S(t.total),
|
|
1024
1068
|
position: S(t.position)
|
|
1025
1069
|
});
|
|
@@ -1031,8 +1075,7 @@ let GA = class AA {
|
|
|
1031
1075
|
const t = {};
|
|
1032
1076
|
return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
|
|
1033
1077
|
}
|
|
1034
|
-
}
|
|
1035
|
-
class Ae {
|
|
1078
|
+
}, LA = class rA {
|
|
1036
1079
|
/** Creates a [Copies]. */
|
|
1037
1080
|
constructor(t) {
|
|
1038
1081
|
this.total = t.total, this.available = t.available;
|
|
@@ -1042,7 +1085,7 @@ class Ae {
|
|
|
1042
1085
|
*/
|
|
1043
1086
|
static deserialize(t) {
|
|
1044
1087
|
if (t)
|
|
1045
|
-
return new
|
|
1088
|
+
return new rA({
|
|
1046
1089
|
total: S(t.total),
|
|
1047
1090
|
available: S(t.available)
|
|
1048
1091
|
});
|
|
@@ -1054,8 +1097,7 @@ class Ae {
|
|
|
1054
1097
|
const t = {};
|
|
1055
1098
|
return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
|
|
1056
1099
|
}
|
|
1057
|
-
}
|
|
1058
|
-
let JA = class nA {
|
|
1100
|
+
}, OA = class sA {
|
|
1059
1101
|
/** Creates a [Availability]. */
|
|
1060
1102
|
constructor(t) {
|
|
1061
1103
|
this.state = t.state, this.since = t.since, this.until = t.until;
|
|
@@ -1065,10 +1107,10 @@ let JA = class nA {
|
|
|
1065
1107
|
*/
|
|
1066
1108
|
static deserialize(t) {
|
|
1067
1109
|
if (t && t.state)
|
|
1068
|
-
return new
|
|
1110
|
+
return new sA({
|
|
1069
1111
|
state: t.state,
|
|
1070
|
-
since:
|
|
1071
|
-
until:
|
|
1112
|
+
since: me(t.since),
|
|
1113
|
+
until: me(t.until)
|
|
1072
1114
|
});
|
|
1073
1115
|
}
|
|
1074
1116
|
/**
|
|
@@ -1079,51 +1121,51 @@ let JA = class nA {
|
|
|
1079
1121
|
return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
|
|
1080
1122
|
}
|
|
1081
1123
|
};
|
|
1082
|
-
|
|
1124
|
+
j.prototype.getNumberOfItems = function() {
|
|
1083
1125
|
return S(this.otherProperties.numberOfItems);
|
|
1084
1126
|
};
|
|
1085
|
-
|
|
1086
|
-
return
|
|
1127
|
+
j.prototype.getPrice = function() {
|
|
1128
|
+
return kA.deserialize(this.otherProperties.price);
|
|
1087
1129
|
};
|
|
1088
|
-
|
|
1130
|
+
j.prototype.getIndirectAcquisitions = function() {
|
|
1089
1131
|
const i = this.otherProperties.indirectAcquisition;
|
|
1090
1132
|
if (i && i instanceof Array)
|
|
1091
|
-
return i.map((t) =>
|
|
1133
|
+
return i.map((t) => JA.deserialize(t)).filter((t) => t !== void 0);
|
|
1092
1134
|
};
|
|
1093
|
-
|
|
1094
|
-
return
|
|
1135
|
+
j.prototype.getHolds = function() {
|
|
1136
|
+
return WA.deserialize(this.otherProperties.holds);
|
|
1095
1137
|
};
|
|
1096
|
-
|
|
1097
|
-
return
|
|
1138
|
+
j.prototype.getCopies = function() {
|
|
1139
|
+
return LA.deserialize(this.otherProperties.copies);
|
|
1098
1140
|
};
|
|
1099
|
-
|
|
1100
|
-
return
|
|
1141
|
+
j.prototype.getAvailability = function() {
|
|
1142
|
+
return OA.deserialize(this.otherProperties.availability);
|
|
1101
1143
|
};
|
|
1102
|
-
|
|
1144
|
+
j.prototype.getAuthenticate = function() {
|
|
1103
1145
|
return X.deserialize(this.otherProperties.authenticate);
|
|
1104
1146
|
};
|
|
1105
|
-
var
|
|
1147
|
+
var _;
|
|
1106
1148
|
(function(i) {
|
|
1107
1149
|
i.NONE = "none", i.DESCENDANT = "descendant", i.CHILD = "child";
|
|
1108
|
-
})(
|
|
1109
|
-
var
|
|
1150
|
+
})(_ || (_ = {}));
|
|
1151
|
+
var b;
|
|
1110
1152
|
(function(i) {
|
|
1111
1153
|
i.id = "id", i.class = "class", i.tag = "tag", i.attribute = "attribute", i.nthchild = "nthchild", i.nthoftype = "nthoftype";
|
|
1112
|
-
})(
|
|
1113
|
-
const
|
|
1154
|
+
})(b || (b = {}));
|
|
1155
|
+
const XA = "CssSelectorGenerator";
|
|
1114
1156
|
function Be(i = "unknown problem", ...t) {
|
|
1115
|
-
console.warn(`${
|
|
1157
|
+
console.warn(`${XA}: ${i}`, ...t);
|
|
1116
1158
|
}
|
|
1117
|
-
|
|
1118
|
-
function
|
|
1159
|
+
b.id, b.class, b.tag, b.attribute, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY;
|
|
1160
|
+
function ZA(i) {
|
|
1119
1161
|
return i instanceof RegExp;
|
|
1120
1162
|
}
|
|
1121
|
-
function
|
|
1163
|
+
function KA(i) {
|
|
1122
1164
|
return i.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
1123
1165
|
}
|
|
1124
|
-
function
|
|
1166
|
+
function qA(i) {
|
|
1125
1167
|
const t = i.map((e) => {
|
|
1126
|
-
if (
|
|
1168
|
+
if (ZA(e))
|
|
1127
1169
|
return (A) => e.test(A);
|
|
1128
1170
|
if (typeof e == "function")
|
|
1129
1171
|
return (A) => {
|
|
@@ -1131,25 +1173,25 @@ function XA(i) {
|
|
|
1131
1173
|
return typeof n != "boolean" ? (Be("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
|
|
1132
1174
|
};
|
|
1133
1175
|
if (typeof e == "string") {
|
|
1134
|
-
const A = new RegExp("^" +
|
|
1176
|
+
const A = new RegExp("^" + KA(e) + "$");
|
|
1135
1177
|
return (n) => A.test(n);
|
|
1136
1178
|
}
|
|
1137
1179
|
return Be("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
1138
1180
|
});
|
|
1139
1181
|
return (e) => t.some((A) => A(e));
|
|
1140
1182
|
}
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1183
|
+
const _A = "", $A = " > ", ti = " ";
|
|
1184
|
+
_.NONE + "", _.NONE, _.DESCENDANT + "", _.DESCENDANT, _.CHILD + "", _.CHILD;
|
|
1185
|
+
b.nthoftype, b.tag, b.id, b.class, b.attribute, b.nthchild;
|
|
1186
|
+
qA([
|
|
1145
1187
|
"class",
|
|
1146
1188
|
"id",
|
|
1147
1189
|
// Angular attributes
|
|
1148
1190
|
"ng-*"
|
|
1149
1191
|
]);
|
|
1150
|
-
class
|
|
1192
|
+
class ei {
|
|
1151
1193
|
}
|
|
1152
|
-
class
|
|
1194
|
+
class Ai extends ei {
|
|
1153
1195
|
/**
|
|
1154
1196
|
* Moves to the left content portion (eg. page) relative to the reading progression direction.
|
|
1155
1197
|
*/
|
|
@@ -1163,24 +1205,24 @@ class $A extends _A {
|
|
|
1163
1205
|
this.readingProgression === R.ltr ? this.goForward(t, e) : this.readingProgression === R.rtl && this.goBackward(t, e);
|
|
1164
1206
|
}
|
|
1165
1207
|
}
|
|
1166
|
-
const ti = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__viewportWidth:100%;--RS__pageGutter:0;--RS__defaultLineLength:40rem;--RS__colGap:0;--RS__colCount:1;--RS__colWidth:100vw}@page{margin:0!important}:root{position:relative;-webkit-column-width:var(--RS__colWidth);-moz-column-width:var(--RS__colWidth);column-width:var(--RS__colWidth);-webkit-column-count:var(--RS__colCount);-moz-column-count:var(--RS__colCount);column-count:var(--RS__colCount);-webkit-column-gap:var(--RS__colGap);-moz-column-gap:var(--RS__colGap);column-gap:var(--RS__colGap);-moz-column-fill:auto;column-fill:auto;width:var(--RS__viewportWidth);height:100vh;max-width:var(--RS__viewportWidth);max-height:100vh;min-width:var(--RS__viewportWidth);min-height:100vh;padding:0!important;margin:0!important;font-size:1rem!important;box-sizing:border-box;-webkit-touch-callout:none}body{width:100%;max-width:var(--RS__defaultLineLength)!important;padding:0 var(--RS__pageGutter)!important;margin:0 auto!important;box-sizing:border-box}:root:not([style*=readium-noOverflow-on]) body{overflow:hidden}@supports (overflow: clip){:root:not([style*=readium-noOverflow-on]){overflow:clip}:root:not([style*=readium-noOverflow-on]) body{overflow:clip;overflow-clip-margin:content-box}}:root[style*=readium-scroll-on]{-webkit-columns:auto auto!important;-moz-columns:auto auto!important;columns:auto auto!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}:root[style*=readium-scroll-on] body{max-width:var(--RS__defaultLineLength)!important;box-sizing:border-box!important}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:auto}@supports (overflow: clip){:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]){overflow:auto}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:clip}}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingTop] body{padding-top:var(--RS__scrollPaddingTop)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingBottom] body{padding-bottom:var(--RS__scrollPaddingBottom)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingLeft] body{padding-left:var(--RS__scrollPaddingLeft)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingRight] body{padding-right:var(--RS__scrollPaddingRight)!important}:root[style*=readium-night-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#0099E5;--RS__linkColor:#63caff;--RS__textColor:#FEFEFE;--RS__backgroundColor:#000000}:root[style*=readium-night-on] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=readium-night-on] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=readium-night-on] a:link,:root[style*=readium-night-on] a:link *{color:var(--RS__linkColor)!important}:root[style*=readium-night-on] a:visited,:root[style*=readium-night-on] a:visited *{color:var(--RS__visitedColor)!important}:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-sepia-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#faf4e8}:root[style*=readium-sepia-on] *:not(a){color:inherit!important;background-color:transparent!important}:root[style*=readium-sepia-on] a:link,:root[style*=readium-sepia-on] a:link *{color:var(--RS__linkColor)}:root[style*=readium-sepia-on] a:visited,:root[style*=readium-sepia-on] a:visited *{color:var(--RS__visitedColor)}@media screen and (-ms-high-contrast: active){:root{color:windowText!important;background-color:window!important}:root :not(#\\#):not(#\\#):not(#\\#),:root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#){color:inherit!important;background-color:inherit!important}.readiumCSS-mo-active-default{color:highlightText!important;background-color:highlight!important}}@media screen and (-ms-high-contrast: white-on-black){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (inverted-colors){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}:root[style*=--USER__backgroundColor]{background-color:var(--USER__backgroundColor)!important}:root[style*=--USER__backgroundColor] *{background-color:transparent!important}:root[style*=--USER__textColor]{color:var(--USER__textColor)!important}:root[style*=--USER__textColor] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=--USER__textColor] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=--USER__linkColor] a:link,:root[style*=--USER__linkColor] a:link *{color:var(--USER__linkColor)!important}:root[style*=--USER__visitedColor] a:visited,:root[style*=--USER__visitedColor] a:visited *{color:var(--USER__visitedColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::-moz-selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__colCount]{-webkit-column-count:var(--USER__colCount);-moz-column-count:var(--USER__colCount);column-count:var(--USER__colCount);--RS__colWidth:auto}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"]{-webkit-column-count:1;-moz-column-count:1;column-count:1}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"],:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"]{--RS__colWidth:100vw}:root[style*=--USER__lineLength] body{max-width:var(--USER__lineLength)!important}:root[style*=--USER__textAlign]{text-align:var(--USER__textAlign)}:root[style*=--USER__textAlign] body,:root[style*=--USER__textAlign] p:not(blockquote p):not(figcaption p):not(hgroup p),:root[style*=--USER__textAlign] li,:root[style*=--USER__textAlign] dd{text-align:var(--USER__textAlign)!important;-moz-text-align-last:auto!important;-epub-text-align-last:auto!important;text-align-last:auto!important}:root[style*=--USER__bodyHyphens]{-webkit-hyphens:var(--USER__bodyHyphens)!important;-moz-hyphens:var(--USER__bodyHyphens)!important;-ms-hyphens:var(--USER__bodyHyphens)!important;-epub-hyphens:var(--USER__bodyHyphens)!important;hyphens:var(--USER__bodyHyphens)!important}:root[style*=--USER__bodyHyphens] body,:root[style*=--USER__bodyHyphens] p,:root[style*=--USER__bodyHyphens] li,:root[style*=--USER__bodyHyphens] div,:root[style*=--USER__bodyHyphens] dd{-webkit-hyphens:inherit;-moz-hyphens:inherit;-ms-hyphens:inherit;-epub-hyphens:inherit;hyphens:inherit}:root[style*=--USER__fontFamily]{font-family:var(--USER__fontFamily)!important}:root[style*=--USER__fontFamily] *{font-family:revert!important}:root[style*=AccessibleDfA]{font-family:AccessibleDfA,Verdana,Tahoma,Trebuchet MS,sans-serif!important}:root[style*="IA Writer Duospace"]{font-family:IA Writer Duospace,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace!important}:root[style*=AccessibleDfA],:root[style*="IA Writer Duospace"],:root[style*=readium-a11y-on]{font-style:normal!important;font-weight:400!important}:root[style*=AccessibleDfA] *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-a11y-on] *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=AccessibleDfA] *,:root[style*="IA Writer Duospace"] *,:root[style*=readium-a11y-on] *{text-decoration:none!important;font-variant-caps:normal!important;font-variant-numeric:normal!important;font-variant-position:normal!important}:root[style*=AccessibleDfA] sup,:root[style*="IA Writer Duospace"] sup,:root[style*=readium-a11y-on] sup,:root[style*=AccessibleDfA] sub,:root[style*="IA Writer Duospace"] sub,:root[style*=readium-a11y-on] sub{font-size:1rem!important;vertical-align:baseline!important}:root:not([style*=readium-deprecatedFontSize-on])[style*=--USER__fontSize] body{zoom:var(--USER__fontSize)!important}@supports not (zoom: 1){:root[style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}}:root[style*=readium-deprecatedFontSize-on][style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}:root[style*=--USER__lineHeight]{line-height:var(--USER__lineHeight)!important}:root[style*=--USER__lineHeight] body,:root[style*=--USER__lineHeight] p,:root[style*=--USER__lineHeight] li,:root[style*=--USER__lineHeight] div{line-height:inherit}:root[style*=--USER__paraSpacing] p{margin-top:var(--USER__paraSpacing)!important;margin-bottom:var(--USER__paraSpacing)!important}:root[style*=--USER__paraIndent] p{text-indent:var(--USER__paraIndent)!important}:root[style*=--USER__paraIndent] p *,:root[style*=--USER__paraIndent] p:first-letter{text-indent:0!important}:root[style*=--USER__wordSpacing] h1,:root[style*=--USER__wordSpacing] h2,:root[style*=--USER__wordSpacing] h3,:root[style*=--USER__wordSpacing] h4,:root[style*=--USER__wordSpacing] h5,:root[style*=--USER__wordSpacing] h6,:root[style*=--USER__wordSpacing] p,:root[style*=--USER__wordSpacing] li,:root[style*=--USER__wordSpacing] div,:root[style*=--USER__wordSpacing] dt,:root[style*=--USER__wordSpacing] dd{word-spacing:var(--USER__wordSpacing)}:root[style*=--USER__letterSpacing] h1,:root[style*=--USER__letterSpacing] h2,:root[style*=--USER__letterSpacing] h3,:root[style*=--USER__letterSpacing] h4,:root[style*=--USER__letterSpacing] h5,:root[style*=--USER__letterSpacing] h6,:root[style*=--USER__letterSpacing] p,:root[style*=--USER__letterSpacing] li,:root[style*=--USER__letterSpacing] div,:root[style*=--USER__letterSpacing] dt,:root[style*=--USER__letterSpacing] dd{letter-spacing:var(--USER__letterSpacing);font-variant:none}:root[style*=--USER__fontWeight] body{font-weight:var(--USER__fontWeight)!important}:root[style*=--USER__fontWeight] b,:root[style*=--USER__fontWeight] strong{font-weight:bolder}:root[style*=--USER__fontWidth] body{font-stretch:var(--USER__fontWidth)!important}:root[style*=--USER__fontOpticalSizing] body{font-optical-sizing:var(--USER__fontOpticalSizing)!important}:root[style*=readium-blend-on] svg,:root[style*=readium-blend-on] img{background-color:transparent!important;mix-blend-mode:multiply!important}:root[style*=--USER__darkenImages] img{-webkit-filter:brightness(var(--USER__darkenImages))!important;filter:brightness(var(--USER__darkenImages))!important}:root[style*=readium-darken-on] img{-webkit-filter:brightness(80%)!important;filter:brightness(80%)!important}:root[style*=--USER__invertImages] img{-webkit-filter:invert(var(--USER__invertImages))!important;filter:invert(var(--USER__invertImages))!important}:root[style*=readium-invert-on] img{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=--USER__darkenImages][style*=--USER__invertImages] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important;filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important}:root[style*=readium-darken-on][style*=--USER__invertImages] img{-webkit-filter:brightness(80%) invert(var(--USER__invertImages))!important;filter:brightness(80%) invert(var(--USER__invertImages))!important}:root[style*=--USER__darkenImages][style*=readium-invert-on] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(100%)!important;filter:brightness(var(--USER__darkenImages)) invert(100%)!important}:root[style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%) invert(100%)!important;filter:brightness(80%) invert(100%)!important}:root[style*=--USER__invertGaiji] img[class*=gaiji]{-webkit-filter:invert(var(--USER__invertGaiji))!important;filter:invert(var(--USER__invertGaiji))!important}:root[style*=readium-invertGaiji-on] img[class*=gaiji]{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=readium-normalize-on]{--USER__typeScale:1.2}:root[style*=readium-normalize-on] p,:root[style*=readium-normalize-on] li,:root[style*=readium-normalize-on] div,:root[style*=readium-normalize-on] pre,:root[style*=readium-normalize-on] dd{font-size:1rem!important}:root[style*=readium-normalize-on] h1{font-size:1.75rem!important;font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h2{font-size:1.5rem!important;font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h3{font-size:1.25rem!important;font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h4,:root[style*=readium-normalize-on] h5,:root[style*=readium-normalize-on] h6{font-size:1rem!important}:root[style*=readium-normalize-on] small{font-size:smaller!important}:root[style*=readium-normalize-on] sub,:root[style*=readium-normalize-on] sup{font-size:67.5%!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h1{font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h2{font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h3{font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-iPadOSPatch-on] body{-webkit-text-size-adjust:none}:root[style*=readium-iPadOSPatch-on] p,:root[style*=readium-iPadOSPatch-on] h1,:root[style*=readium-iPadOSPatch-on] h2,:root[style*=readium-iPadOSPatch-on] h3,:root[style*=readium-iPadOSPatch-on] h4,:root[style*=readium-iPadOSPatch-on] h5,:root[style*=readium-iPadOSPatch-on] h6,:root[style*=readium-iPadOSPatch-on] li,:root[style*=readium-iPadOSPatch-on] th,:root[style*=readium-iPadOSPatch-on] td,:root[style*=readium-iPadOSPatch-on] dt,:root[style*=readium-iPadOSPatch-on] dd,:root[style*=readium-iPadOSPatch-on] pre,:root[style*=readium-iPadOSPatch-on] address,:root[style*=readium-iPadOSPatch-on] details,:root[style*=readium-iPadOSPatch-on] summary,:root[style*=readium-iPadOSPatch-on] figcaption,:root[style*=readium-iPadOSPatch-on] div:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)),:root[style*=readium-iPadOSPatch-on] aside:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)){-webkit-text-zoom:reset}:root[style*=readium-iPadOSPatch-on] abbr,:root[style*=readium-iPadOSPatch-on] b,:root[style*=readium-iPadOSPatch-on] bdi,:root[style*=readium-iPadOSPatch-on] bdo,:root[style*=readium-iPadOSPatch-on] cite,:root[style*=readium-iPadOSPatch-on] code,:root[style*=readium-iPadOSPatch-on] dfn,:root[style*=readium-iPadOSPatch-on] em,:root[style*=readium-iPadOSPatch-on] i,:root[style*=readium-iPadOSPatch-on] kbd,:root[style*=readium-iPadOSPatch-on] mark,:root[style*=readium-iPadOSPatch-on] q,:root[style*=readium-iPadOSPatch-on] rp,:root[style*=readium-iPadOSPatch-on] rt,:root[style*=readium-iPadOSPatch-on] ruby,:root[style*=readium-iPadOSPatch-on] s,:root[style*=readium-iPadOSPatch-on] samp,:root[style*=readium-iPadOSPatch-on] small,:root[style*=readium-iPadOSPatch-on] span,:root[style*=readium-iPadOSPatch-on] strong,:root[style*=readium-iPadOSPatch-on] sub,:root[style*=readium-iPadOSPatch-on] sup,:root[style*=readium-iPadOSPatch-on] time,:root[style*=readium-iPadOSPatch-on] u,:root[style*=readium-iPadOSPatch-on] var{-webkit-text-zoom:normal}:root[style*=readium-iPadOSPatch-on] p:not(:has(b,cite,em,i,q,s,small,span,strong)):first-line{-webkit-text-zoom:normal}
|
|
1167
|
-
`, ei = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);@-ms-viewport{width:device-width}@viewport{width:device-width;zoom:1}:root{--RS__monospaceTf:ui-monospace, "Andale Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;--RS__humanistTf:Seravek, Calibri, "Gill Sans Nova", Roboto, Ubuntu, "DejaVu Sans", source-sans-pro, sans-serif;--RS__sansTf:-ui-sans-serif, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", "Arial Nova", "Liberation Sans", Arial, sans-serif;--RS__modernTf:Athelas, Constantia, Charter, "Bitstream Charter", Cambria, "Georgia Pro", Georgia, serif;--RS__oldStyleTf:"Iowan Old Style", Sitka, "Sitka Text", Palatino, "Book Antiqua", "URW Palladio L", P052, serif;--RS__baseFontFamily:var(--RS__oldStyleTf);--RS__lineHeightCompensation:1;--RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation));--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#FFFFFF;color:var(--RS__textColor)!important;background-color:var(--RS__backgroundColor)!important}::-moz-selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}::selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}html{font-family:var(--RS__baseFontFamily);line-height:1.6;line-height:var(--RS__baseLineHeight);text-rendering:optimizelegibility}h1,h2,h3{line-height:normal}:lang(ja),:lang(zh),:lang(ko){word-wrap:break-word;-webkit-line-break:strict;-epub-line-break:strict;line-break:strict}math{font-family:"Latin Modern Math","STIX Two Math","XITS Math","STIX Math","Libertinus Math","TeX Gyre Termes Math","TeX Gyre Bonum Math",TeX Gyre Schola,"DejaVu Math TeX Gyre","TeX Gyre Pagella Math","Asana Math","Cambria Math","Lucida Bright Math","Minion Math",STIXGeneral,STIXSizeOneSym,Symbol,Times New Roman,serif}:lang(am){--RS__baseFontFamily:kefa, nyala, roboto, noto, "Noto Sans Ethiopic", serif;--RS__lineHeightCompensation:1.167}:lang(ar){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(bn){--RS__baseFontFamily:"Kohinoor Bangla", "Bangla Sangam MN", vrinda, roboto, noto, "Noto Sans Bengali", sans-serif;--RS__lineHeightCompensation:1.067}:lang(bo){--RS__baseFontFamily:kailasa, "Microsoft Himalaya", roboto, noto, "Noto Sans Tibetan", sans-serif}:lang(chr){--RS__baseFontFamily:"Plantagenet Cherokee", roboto, noto, "Noto Sans Cherokee";--RS__lineHeightCompensation:1.167}:lang(fa){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(gu){--RS__baseFontFamily:"Gujarati Sangam MN", "Nirmala UI", shruti, roboto, noto, "Noto Sans Gujarati", sans-serif;--RS__lineHeightCompensation:1.167}:lang(he){--RS__baseFontFamily:"New Peninim MT", "Arial Hebrew", gisha, "Times New Roman", roboto, noto, "Noto Sans Hebrew" sans-serif;--RS__lineHeightCompensation:1.1}:lang(hi){--RS__baseFontFamily:"Kohinoor Devanagari", "Devanagari Sangam MN", kokila, "Nirmala UI", roboto, noto, "Noto Sans Devanagari", sans-serif;--RS__lineHeightCompensation:1.1}:lang(hy){--RS__baseFontFamily:mshtakan, sylfaen, roboto, noto, "Noto Serif Armenian", serif}:lang(iu){--RS__baseFontFamily:"Euphemia UCAS", euphemia, roboto, noto, "Noto Sans Canadian Aboriginal", sans-serif}:lang(ja){--RS__baseFontFamily:yugothic, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "MS Gothic", roboto, noto, "Noto Sans CJK JP", sans-serif;--RS__lineHeightCompensation:1.167;--RS__serif-ja:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDPMincho", "Yu Mincho", "MS P明朝", "MS PMincho", serif;--RS__sans-serif-ja:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDPGothic", "Yu Gothic", "MS Pゴシック", "MS PGothic", sans-serif;--RS__serif-ja-v:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDMincho", "Yu Mincho", "MS明朝", "MS Mincho", serif;--RS__sans-serif-ja-v:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDGothic", "Yu Gothic", "MSゴシック", "MS Gothic", sans-serif}:lang(km){--RS__baseFontFamily:"Khmer Sangam MN", "Leelawadee UI", "Khmer UI", roboto, noto, "Noto Sans Khmer", sans-serif;--RS__lineHeightCompensation:1.067}:lang(kn){--RS__baseFontFamily:"Kannada Sangam MN", "Nirmala UI", tunga, roboto, noto, "Noto Sans Kannada", sans-serif;--RS__lineHeightCompensation:1.1}:lang(ko){--RS__baseFontFamily:"Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", roboto, noto, "Noto Sans CJK KR", sans-serif;--RS__lineHeightCompensation:1.167}:lang(lo){--RS__baseFontFamily:"Lao Sangam MN", "Leelawadee UI", "Lao UI", roboto, noto, "Noto Sans Lao", sans-serif}:lang(ml){--RS__baseFontFamily:"Malayalam Sangam MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Malayalam", sans-serif;--RS__lineHeightCompensation:1.067}:lang(or){--RS__baseFontFamily:"Oriya Sangam MN", "Nirmala UI", kalinga, roboto, noto, "Noto Sans Oriya", sans-serif;--RS__lineHeightCompensation:1.167}:lang(pa){--RS__baseFontFamily:"Gurmukhi MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Gurmukhi", sans-serif;--RS__lineHeightCompensation:1.1}:lang(si){--RS__baseFontFamily:"Sinhala Sangam MN", "Nirmala UI", "Iskoola Pota", roboto, noto, "Noto Sans Sinhala", sans-serif;--RS__lineHeightCompensation:1.167}:lang(ta){--RS__baseFontFamily:"Tamil Sangam MN", "Nirmala UI", latha, roboto, noto, "Noto Sans Tamil", sans-serif;--RS__lineHeightCompensation:1.067}:lang(te){--RS__baseFontFamily:"Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", gautami, roboto, noto, "Noto Sans Telugu", sans-serif}:lang(th){--RS__baseFontFamily:"Thonburi", "Leelawadee UI", "Cordia New", roboto, noto, "Noto Sans Thai", sans-serif;--RS__lineHeightCompensation:1.067}:lang(zh){--RS__baseFontFamily:"方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK SC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-Hant),:lang(zh-TW){--RS__baseFontFamily:"方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-HK){--RS__baseFontFamily:"方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Regular.woff2) format("woff2"),url(./assets/AccessibleDfA-Regular.woff) format("woff")}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:700;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Bold.woff2) format("woff2")}@font-face{font-family:AccessibleDfA;font-style:italic;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Italic.woff2) format("woff2")}@font-face{font-family:IA Writer Duospace;font-style:normal;font-weight:400;src:local("iAWriterDuospace-Regular"),url(./assets/iAWriterDuospace-Regular.ttf) format("truetype")}body{widows:2;orphans:2}figcaption,th,td{widows:1;orphans:1}h2,h3,h4,h5,h6,dt,hr,caption{-webkit-column-break-after:avoid;page-break-after:avoid;break-after:avoid}h1,h2,h3,h4,h5,h6,dt,figure,tr{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}body{-webkit-hyphenate-character:"-";-moz-hyphenate-character:"-";-ms-hyphenate-character:"-";hyphenate-character:"-";-webkit-hyphenate-limit-lines:3;-ms-hyphenate-limit-lines:3;hyphenate-limit-lines:3}h1,h2,h3,h4,h5,h6,dt,figcaption,pre,caption,address,center,code,var{-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none;-epub-hyphens:none;hyphens:none}body{font-variant-numeric:oldstyle-nums proportional-nums}:lang(ja) body,:lang(zh) body,:lang(ko) body{font-variant-numeric:lining-nums proportional-nums}h1,h2,h3,h4,h5,h6,dt{font-variant-numeric:lining-nums proportional-nums}table{font-variant-numeric:lining-nums tabular-nums}code,var{font-variant-ligatures:none;font-variant-numeric:lining-nums tabular-nums slashed-zero}rt{font-variant-east-asian:ruby}:lang(ar){font-variant-ligatures:common-ligatures}:lang(ko){font-kerning:normal}hr{color:inherit;border-color:currentcolor}table,th,td{border-color:currentcolor}figure,blockquote{margin:1em 5%}ul,ol{padding-left:5%}dd{margin-left:5%}pre{white-space:pre-wrap;-ms-tab-size:2;-moz-tab-size:2;-webkit-tab-size:2;tab-size:2}abbr[title],acronym[title]{text-decoration:dotted underline}nobr wbr{white-space:normal}ruby>rt,ruby>rp{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}*:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)),*:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)),*:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)),:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) cite,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) dfn,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) em,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) i,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) cite,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) dfn,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) em,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) i,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) cite,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) dfn,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) em,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) i{font-style:normal}:lang(ja) a,:lang(zh) a,:lang(ko) a{text-decoration:none}:root{--RS__maxMediaWidth:100%;--RS__maxMediaHeight:95vh;--RS__boxSizingMedia:border-box;--RS__boxSizingTable:border-box}a,a span,span a,h1,h2,h3,h4,h5,h6{word-wrap:break-word}div{max-width:var(--RS__maxMediaWidth)}img,svg|svg,video{object-fit:contain;width:auto;height:auto;max-width:var(--RS__maxMediaWidth);max-height:var(--RS__maxMediaHeight)!important;box-sizing:var(--RS__boxSizingMedia);-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}audio{max-width:100%;-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}table{max-width:var(--RS__maxMediaWidth);box-sizing:var(--RS__boxSizingTable)}
|
|
1168
|
-
`,
|
|
1169
|
-
`,
|
|
1208
|
+
const ii = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__viewportWidth:100%;--RS__pageGutter:0;--RS__defaultLineLength:40rem;--RS__colGap:0;--RS__colCount:1;--RS__colWidth:100vw}@page{margin:0!important}:root{position:relative;-webkit-column-width:var(--RS__colWidth);-moz-column-width:var(--RS__colWidth);column-width:var(--RS__colWidth);-webkit-column-count:var(--RS__colCount);-moz-column-count:var(--RS__colCount);column-count:var(--RS__colCount);-webkit-column-gap:var(--RS__colGap);-moz-column-gap:var(--RS__colGap);column-gap:var(--RS__colGap);-moz-column-fill:auto;column-fill:auto;width:var(--RS__viewportWidth);height:100vh;max-width:var(--RS__viewportWidth);max-height:100vh;min-width:var(--RS__viewportWidth);min-height:100vh;padding:0!important;margin:0!important;font-size:1rem!important;box-sizing:border-box;-webkit-touch-callout:none}body{width:100%;max-width:var(--RS__defaultLineLength)!important;padding:0 var(--RS__pageGutter)!important;margin:0 auto!important;box-sizing:border-box}:root:not([style*=readium-noOverflow-on]) body{overflow:hidden}@supports (overflow: clip){:root:not([style*=readium-noOverflow-on]){overflow:clip}:root:not([style*=readium-noOverflow-on]) body{overflow:clip;overflow-clip-margin:content-box}}:root[style*=readium-scroll-on]{-webkit-columns:auto auto!important;-moz-columns:auto auto!important;columns:auto auto!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important}:root[style*=readium-scroll-on] body{max-width:var(--RS__defaultLineLength)!important;box-sizing:border-box!important}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:auto}@supports (overflow: clip){:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]){overflow:auto}:root[style*=readium-scroll-on]:not([style*=readium-noOverflow-on]) body{overflow:clip}}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingTop] body{padding-top:var(--RS__scrollPaddingTop)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingBottom] body{padding-bottom:var(--RS__scrollPaddingBottom)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingLeft] body{padding-left:var(--RS__scrollPaddingLeft)!important}:root[style*=readium-scroll-on][style*=--RS__scrollPaddingRight] body{padding-right:var(--RS__scrollPaddingRight)!important}:root[style*=readium-night-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#0099E5;--RS__linkColor:#63caff;--RS__textColor:#FEFEFE;--RS__backgroundColor:#000000}:root[style*=readium-night-on] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=readium-night-on] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=readium-night-on] a:link,:root[style*=readium-night-on] a:link *{color:var(--RS__linkColor)!important}:root[style*=readium-night-on] a:visited,:root[style*=readium-night-on] a:visited *{color:var(--RS__visitedColor)!important}:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:invert(100%);filter:invert(100%)}:root[style*=readium-sepia-on]{--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#faf4e8}:root[style*=readium-sepia-on] *:not(a){color:inherit!important;background-color:transparent!important}:root[style*=readium-sepia-on] a:link,:root[style*=readium-sepia-on] a:link *{color:var(--RS__linkColor)}:root[style*=readium-sepia-on] a:visited,:root[style*=readium-sepia-on] a:visited *{color:var(--RS__visitedColor)}@media screen and (-ms-high-contrast: active){:root{color:windowText!important;background-color:window!important}:root :not(#\\#):not(#\\#):not(#\\#),:root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :root :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#) :not(#\\#):not(#\\#):not(#\\#){color:inherit!important;background-color:inherit!important}.readiumCSS-mo-active-default{color:highlightText!important;background-color:highlight!important}}@media screen and (-ms-high-contrast: white-on-black){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}@media screen and (inverted-colors){:root[style*=readium-night-on] img[class*=gaiji],:root[style*=readium-night-on] *[epub\\:type~=titlepage] img:only-child,:root[style*=readium-night-on] *[epub|type~=titlepage] img:only-child{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-invert-on] img{-webkit-filter:none!important;filter:none!important}:root[style*=readium-night-on][style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%);filter:brightness(80%)}}:root[style*=--USER__backgroundColor]{background-color:var(--USER__backgroundColor)!important}:root[style*=--USER__backgroundColor] *{background-color:transparent!important}:root[style*=--USER__textColor]{color:var(--USER__textColor)!important}:root[style*=--USER__textColor] *:not(a){color:inherit!important;background-color:transparent!important;border-color:currentcolor!important}:root[style*=--USER__textColor] svg text{fill:currentcolor!important;stroke:none!important}:root[style*=--USER__linkColor] a:link,:root[style*=--USER__linkColor] a:link *{color:var(--USER__linkColor)!important}:root[style*=--USER__visitedColor] a:visited,:root[style*=--USER__visitedColor] a:visited *{color:var(--USER__visitedColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::-moz-selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__selectionBackgroundColor][style*=--USER__selectionTextColor] ::selection{color:var(--USER__selectionTextColor)!important;background-color:var(--USER__selectionBackgroundColor)!important}:root[style*=--USER__colCount]{-webkit-column-count:var(--USER__colCount);-moz-column-count:var(--USER__colCount);column-count:var(--USER__colCount);--RS__colWidth:auto}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"]{-webkit-column-count:1;-moz-column-count:1;column-count:1}:root[style*="--USER__colCount: 0"],:root[style*="--USER__colCount:0"],:root[style*="--USER__colCount: 1"],:root[style*="--USER__colCount:1"]{--RS__colWidth:100vw}:root[style*=--USER__lineLength] body{max-width:var(--USER__lineLength)!important}:root[style*=--USER__textAlign]{text-align:var(--USER__textAlign)}:root[style*=--USER__textAlign] body,:root[style*=--USER__textAlign] p:not(blockquote p):not(figcaption p):not(hgroup p),:root[style*=--USER__textAlign] li,:root[style*=--USER__textAlign] dd{text-align:var(--USER__textAlign)!important;-moz-text-align-last:auto!important;-epub-text-align-last:auto!important;text-align-last:auto!important}:root[style*=--USER__bodyHyphens]{-webkit-hyphens:var(--USER__bodyHyphens)!important;-moz-hyphens:var(--USER__bodyHyphens)!important;-ms-hyphens:var(--USER__bodyHyphens)!important;-epub-hyphens:var(--USER__bodyHyphens)!important;hyphens:var(--USER__bodyHyphens)!important}:root[style*=--USER__bodyHyphens] body,:root[style*=--USER__bodyHyphens] p,:root[style*=--USER__bodyHyphens] li,:root[style*=--USER__bodyHyphens] div,:root[style*=--USER__bodyHyphens] dd{-webkit-hyphens:inherit;-moz-hyphens:inherit;-ms-hyphens:inherit;-epub-hyphens:inherit;hyphens:inherit}:root[style*=--USER__fontFamily]{font-family:var(--USER__fontFamily)!important}:root[style*=--USER__fontFamily] *{font-family:revert!important}:root[style*=AccessibleDfA]{font-family:AccessibleDfA,Verdana,Tahoma,Trebuchet MS,sans-serif!important}:root[style*="IA Writer Duospace"]{font-family:IA Writer Duospace,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace!important}:root[style*=AccessibleDfA],:root[style*="IA Writer Duospace"],:root[style*=readium-a11y-on]{font-style:normal!important;font-weight:400!important}:root[style*=AccessibleDfA] *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp),:root[style*=readium-a11y-on] *:not(code):not(var):not(kbd):not(samp){font-family:inherit!important;font-style:inherit!important;font-weight:inherit!important}:root[style*=AccessibleDfA] *,:root[style*="IA Writer Duospace"] *,:root[style*=readium-a11y-on] *{text-decoration:none!important;font-variant-caps:normal!important;font-variant-numeric:normal!important;font-variant-position:normal!important}:root[style*=AccessibleDfA] sup,:root[style*="IA Writer Duospace"] sup,:root[style*=readium-a11y-on] sup,:root[style*=AccessibleDfA] sub,:root[style*="IA Writer Duospace"] sub,:root[style*=readium-a11y-on] sub{font-size:1rem!important;vertical-align:baseline!important}:root:not([style*=readium-deprecatedFontSize-on])[style*=--USER__fontSize] body{zoom:var(--USER__fontSize)!important}@supports not (zoom: 1){:root[style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}}:root[style*=readium-deprecatedFontSize-on][style*=--USER__fontSize]{font-size:var(--USER__fontSize)!important}:root[style*=--USER__lineHeight]{line-height:var(--USER__lineHeight)!important}:root[style*=--USER__lineHeight] body,:root[style*=--USER__lineHeight] p,:root[style*=--USER__lineHeight] li,:root[style*=--USER__lineHeight] div{line-height:inherit}:root[style*=--USER__paraSpacing] p{margin-top:var(--USER__paraSpacing)!important;margin-bottom:var(--USER__paraSpacing)!important}:root[style*=--USER__paraIndent] p{text-indent:var(--USER__paraIndent)!important}:root[style*=--USER__paraIndent] p *,:root[style*=--USER__paraIndent] p:first-letter{text-indent:0!important}:root[style*=--USER__wordSpacing] h1,:root[style*=--USER__wordSpacing] h2,:root[style*=--USER__wordSpacing] h3,:root[style*=--USER__wordSpacing] h4,:root[style*=--USER__wordSpacing] h5,:root[style*=--USER__wordSpacing] h6,:root[style*=--USER__wordSpacing] p,:root[style*=--USER__wordSpacing] li,:root[style*=--USER__wordSpacing] div,:root[style*=--USER__wordSpacing] dt,:root[style*=--USER__wordSpacing] dd{word-spacing:var(--USER__wordSpacing)}:root[style*=--USER__letterSpacing] h1,:root[style*=--USER__letterSpacing] h2,:root[style*=--USER__letterSpacing] h3,:root[style*=--USER__letterSpacing] h4,:root[style*=--USER__letterSpacing] h5,:root[style*=--USER__letterSpacing] h6,:root[style*=--USER__letterSpacing] p,:root[style*=--USER__letterSpacing] li,:root[style*=--USER__letterSpacing] div,:root[style*=--USER__letterSpacing] dt,:root[style*=--USER__letterSpacing] dd{letter-spacing:var(--USER__letterSpacing);font-variant:none}:root[style*=--USER__fontWeight] body{font-weight:var(--USER__fontWeight)!important}:root[style*=--USER__fontWeight] b,:root[style*=--USER__fontWeight] strong{font-weight:bolder}:root[style*=--USER__fontWidth] body{font-stretch:var(--USER__fontWidth)!important}:root[style*=--USER__fontOpticalSizing] body{font-optical-sizing:var(--USER__fontOpticalSizing)!important}:root[style*=readium-blend-on] svg,:root[style*=readium-blend-on] img{background-color:transparent!important;mix-blend-mode:multiply!important}:root[style*=--USER__darkenImages] img{-webkit-filter:brightness(var(--USER__darkenImages))!important;filter:brightness(var(--USER__darkenImages))!important}:root[style*=readium-darken-on] img{-webkit-filter:brightness(80%)!important;filter:brightness(80%)!important}:root[style*=--USER__invertImages] img{-webkit-filter:invert(var(--USER__invertImages))!important;filter:invert(var(--USER__invertImages))!important}:root[style*=readium-invert-on] img{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=--USER__darkenImages][style*=--USER__invertImages] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important;filter:brightness(var(--USER__darkenImages)) invert(var(--USER__invertImages))!important}:root[style*=readium-darken-on][style*=--USER__invertImages] img{-webkit-filter:brightness(80%) invert(var(--USER__invertImages))!important;filter:brightness(80%) invert(var(--USER__invertImages))!important}:root[style*=--USER__darkenImages][style*=readium-invert-on] img{-webkit-filter:brightness(var(--USER__darkenImages)) invert(100%)!important;filter:brightness(var(--USER__darkenImages)) invert(100%)!important}:root[style*=readium-darken-on][style*=readium-invert-on] img{-webkit-filter:brightness(80%) invert(100%)!important;filter:brightness(80%) invert(100%)!important}:root[style*=--USER__invertGaiji] img[class*=gaiji]{-webkit-filter:invert(var(--USER__invertGaiji))!important;filter:invert(var(--USER__invertGaiji))!important}:root[style*=readium-invertGaiji-on] img[class*=gaiji]{-webkit-filter:invert(100%)!important;filter:invert(100%)!important}:root[style*=readium-normalize-on]{--USER__typeScale:1.2}:root[style*=readium-normalize-on] p,:root[style*=readium-normalize-on] li,:root[style*=readium-normalize-on] div,:root[style*=readium-normalize-on] pre,:root[style*=readium-normalize-on] dd{font-size:1rem!important}:root[style*=readium-normalize-on] h1{font-size:1.75rem!important;font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h2{font-size:1.5rem!important;font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h3{font-size:1.25rem!important;font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-normalize-on] h4,:root[style*=readium-normalize-on] h5,:root[style*=readium-normalize-on] h6{font-size:1rem!important}:root[style*=readium-normalize-on] small{font-size:smaller!important}:root[style*=readium-normalize-on] sub,:root[style*=readium-normalize-on] sup{font-size:67.5%!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h1{font-size:calc(((1rem * var(--USER__typeScale)) * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h2{font-size:calc((1rem * var(--USER__typeScale)) * var(--USER__typeScale))!important}:root[style*=readium-normalize-on][style*=--USER__typeScale] h3{font-size:calc(1rem * var(--USER__typeScale))!important}:root[style*=readium-iPadOSPatch-on] body{-webkit-text-size-adjust:none}:root[style*=readium-iPadOSPatch-on] p,:root[style*=readium-iPadOSPatch-on] h1,:root[style*=readium-iPadOSPatch-on] h2,:root[style*=readium-iPadOSPatch-on] h3,:root[style*=readium-iPadOSPatch-on] h4,:root[style*=readium-iPadOSPatch-on] h5,:root[style*=readium-iPadOSPatch-on] h6,:root[style*=readium-iPadOSPatch-on] li,:root[style*=readium-iPadOSPatch-on] th,:root[style*=readium-iPadOSPatch-on] td,:root[style*=readium-iPadOSPatch-on] dt,:root[style*=readium-iPadOSPatch-on] dd,:root[style*=readium-iPadOSPatch-on] pre,:root[style*=readium-iPadOSPatch-on] address,:root[style*=readium-iPadOSPatch-on] details,:root[style*=readium-iPadOSPatch-on] summary,:root[style*=readium-iPadOSPatch-on] figcaption,:root[style*=readium-iPadOSPatch-on] div:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)),:root[style*=readium-iPadOSPatch-on] aside:not(:has(p,h1,h2,h3,h4,h5,h6,li,th,td,dt,dd,pre,address,aside,details,figcaption,summary)){-webkit-text-zoom:reset}:root[style*=readium-iPadOSPatch-on] abbr,:root[style*=readium-iPadOSPatch-on] b,:root[style*=readium-iPadOSPatch-on] bdi,:root[style*=readium-iPadOSPatch-on] bdo,:root[style*=readium-iPadOSPatch-on] cite,:root[style*=readium-iPadOSPatch-on] code,:root[style*=readium-iPadOSPatch-on] dfn,:root[style*=readium-iPadOSPatch-on] em,:root[style*=readium-iPadOSPatch-on] i,:root[style*=readium-iPadOSPatch-on] kbd,:root[style*=readium-iPadOSPatch-on] mark,:root[style*=readium-iPadOSPatch-on] q,:root[style*=readium-iPadOSPatch-on] rp,:root[style*=readium-iPadOSPatch-on] rt,:root[style*=readium-iPadOSPatch-on] ruby,:root[style*=readium-iPadOSPatch-on] s,:root[style*=readium-iPadOSPatch-on] samp,:root[style*=readium-iPadOSPatch-on] small,:root[style*=readium-iPadOSPatch-on] span,:root[style*=readium-iPadOSPatch-on] strong,:root[style*=readium-iPadOSPatch-on] sub,:root[style*=readium-iPadOSPatch-on] sup,:root[style*=readium-iPadOSPatch-on] time,:root[style*=readium-iPadOSPatch-on] u,:root[style*=readium-iPadOSPatch-on] var{-webkit-text-zoom:normal}:root[style*=readium-iPadOSPatch-on] p:not(:has(b,cite,em,i,q,s,small,span,strong)):first-line{-webkit-text-zoom:normal}
|
|
1209
|
+
`, ni = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);@-ms-viewport{width:device-width}@viewport{width:device-width;zoom:1}:root{--RS__monospaceTf:ui-monospace, "Andale Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;--RS__humanistTf:Seravek, Calibri, "Gill Sans Nova", Roboto, Ubuntu, "DejaVu Sans", source-sans-pro, sans-serif;--RS__sansTf:-ui-sans-serif, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", "Arial Nova", "Liberation Sans", Arial, sans-serif;--RS__modernTf:Athelas, Constantia, Charter, "Bitstream Charter", Cambria, "Georgia Pro", Georgia, serif;--RS__oldStyleTf:"Iowan Old Style", Sitka, "Sitka Text", Palatino, "Book Antiqua", "URW Palladio L", P052, serif;--RS__baseFontFamily:var(--RS__oldStyleTf);--RS__lineHeightCompensation:1;--RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation));--RS__selectionTextColor:inherit;--RS__selectionBackgroundColor:#b4d8fe;--RS__visitedColor:#551A8B;--RS__linkColor:#0000EE;--RS__textColor:#121212;--RS__backgroundColor:#FFFFFF;color:var(--RS__textColor)!important;background-color:var(--RS__backgroundColor)!important}::-moz-selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}::selection{color:var(--RS__selectionTextColor);background-color:var(--RS__selectionBackgroundColor)}html{font-family:var(--RS__baseFontFamily);line-height:1.6;line-height:var(--RS__baseLineHeight);text-rendering:optimizelegibility}h1,h2,h3{line-height:normal}:lang(ja),:lang(zh),:lang(ko){word-wrap:break-word;-webkit-line-break:strict;-epub-line-break:strict;line-break:strict}math{font-family:"Latin Modern Math","STIX Two Math","XITS Math","STIX Math","Libertinus Math","TeX Gyre Termes Math","TeX Gyre Bonum Math",TeX Gyre Schola,"DejaVu Math TeX Gyre","TeX Gyre Pagella Math","Asana Math","Cambria Math","Lucida Bright Math","Minion Math",STIXGeneral,STIXSizeOneSym,Symbol,Times New Roman,serif}:lang(am){--RS__baseFontFamily:kefa, nyala, roboto, noto, "Noto Sans Ethiopic", serif;--RS__lineHeightCompensation:1.167}:lang(ar){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(bn){--RS__baseFontFamily:"Kohinoor Bangla", "Bangla Sangam MN", vrinda, roboto, noto, "Noto Sans Bengali", sans-serif;--RS__lineHeightCompensation:1.067}:lang(bo){--RS__baseFontFamily:kailasa, "Microsoft Himalaya", roboto, noto, "Noto Sans Tibetan", sans-serif}:lang(chr){--RS__baseFontFamily:"Plantagenet Cherokee", roboto, noto, "Noto Sans Cherokee";--RS__lineHeightCompensation:1.167}:lang(fa){--RS__baseFontFamily:"Geeza Pro", "Arabic Typesetting", roboto, noto, "Noto Naskh Arabic", "Times New Roman", serif}:lang(gu){--RS__baseFontFamily:"Gujarati Sangam MN", "Nirmala UI", shruti, roboto, noto, "Noto Sans Gujarati", sans-serif;--RS__lineHeightCompensation:1.167}:lang(he){--RS__baseFontFamily:"New Peninim MT", "Arial Hebrew", gisha, "Times New Roman", roboto, noto, "Noto Sans Hebrew" sans-serif;--RS__lineHeightCompensation:1.1}:lang(hi){--RS__baseFontFamily:"Kohinoor Devanagari", "Devanagari Sangam MN", kokila, "Nirmala UI", roboto, noto, "Noto Sans Devanagari", sans-serif;--RS__lineHeightCompensation:1.1}:lang(hy){--RS__baseFontFamily:mshtakan, sylfaen, roboto, noto, "Noto Serif Armenian", serif}:lang(iu){--RS__baseFontFamily:"Euphemia UCAS", euphemia, roboto, noto, "Noto Sans Canadian Aboriginal", sans-serif}:lang(ja){--RS__baseFontFamily:yugothic, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "MS Gothic", roboto, noto, "Noto Sans CJK JP", sans-serif;--RS__lineHeightCompensation:1.167;--RS__serif-ja:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDPMincho", "Yu Mincho", "MS P明朝", "MS PMincho", serif;--RS__sans-serif-ja:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDPGothic", "Yu Gothic", "MS Pゴシック", "MS PGothic", sans-serif;--RS__serif-ja-v:"Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "BIZ UDMincho", "Yu Mincho", "MS明朝", "MS Mincho", serif;--RS__sans-serif-ja-v:"Hiragino Sans", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ W3", "YuGothic", "Yu Gothic Medium", "BIZ UDGothic", "Yu Gothic", "MSゴシック", "MS Gothic", sans-serif}:lang(km){--RS__baseFontFamily:"Khmer Sangam MN", "Leelawadee UI", "Khmer UI", roboto, noto, "Noto Sans Khmer", sans-serif;--RS__lineHeightCompensation:1.067}:lang(kn){--RS__baseFontFamily:"Kannada Sangam MN", "Nirmala UI", tunga, roboto, noto, "Noto Sans Kannada", sans-serif;--RS__lineHeightCompensation:1.1}:lang(ko){--RS__baseFontFamily:"Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", roboto, noto, "Noto Sans CJK KR", sans-serif;--RS__lineHeightCompensation:1.167}:lang(lo){--RS__baseFontFamily:"Lao Sangam MN", "Leelawadee UI", "Lao UI", roboto, noto, "Noto Sans Lao", sans-serif}:lang(ml){--RS__baseFontFamily:"Malayalam Sangam MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Malayalam", sans-serif;--RS__lineHeightCompensation:1.067}:lang(or){--RS__baseFontFamily:"Oriya Sangam MN", "Nirmala UI", kalinga, roboto, noto, "Noto Sans Oriya", sans-serif;--RS__lineHeightCompensation:1.167}:lang(pa){--RS__baseFontFamily:"Gurmukhi MN", "Nirmala UI", kartika, roboto, noto, "Noto Sans Gurmukhi", sans-serif;--RS__lineHeightCompensation:1.1}:lang(si){--RS__baseFontFamily:"Sinhala Sangam MN", "Nirmala UI", "Iskoola Pota", roboto, noto, "Noto Sans Sinhala", sans-serif;--RS__lineHeightCompensation:1.167}:lang(ta){--RS__baseFontFamily:"Tamil Sangam MN", "Nirmala UI", latha, roboto, noto, "Noto Sans Tamil", sans-serif;--RS__lineHeightCompensation:1.067}:lang(te){--RS__baseFontFamily:"Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", gautami, roboto, noto, "Noto Sans Telugu", sans-serif}:lang(th){--RS__baseFontFamily:"Thonburi", "Leelawadee UI", "Cordia New", roboto, noto, "Noto Sans Thai", sans-serif;--RS__lineHeightCompensation:1.067}:lang(zh){--RS__baseFontFamily:"方体", "PingFang SC", "黑体", "Heiti SC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK SC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-Hant),:lang(zh-TW){--RS__baseFontFamily:"方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}:lang(zh-HK){--RS__baseFontFamily:"方體", "PingFang HK", "方體", "PingFang TC", "黑體", "Heiti TC", "Microsoft JhengHei UI", "Microsoft JhengHei", roboto, noto, "Noto Sans CJK TC", sans-serif;--RS__lineHeightCompensation:1.167}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Regular.woff2) format("woff2"),url(./assets/AccessibleDfA-Regular.woff) format("woff")}@font-face{font-family:AccessibleDfA;font-style:normal;font-weight:700;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Bold.woff2) format("woff2")}@font-face{font-family:AccessibleDfA;font-style:italic;font-weight:400;src:local("AccessibleDfA"),url(./assets/AccessibleDfA-Italic.woff2) format("woff2")}@font-face{font-family:IA Writer Duospace;font-style:normal;font-weight:400;src:local("iAWriterDuospace-Regular"),url(./assets/iAWriterDuospace-Regular.ttf) format("truetype")}body{widows:2;orphans:2}figcaption,th,td{widows:1;orphans:1}h2,h3,h4,h5,h6,dt,hr,caption{-webkit-column-break-after:avoid;page-break-after:avoid;break-after:avoid}h1,h2,h3,h4,h5,h6,dt,figure,tr{-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}body{-webkit-hyphenate-character:"-";-moz-hyphenate-character:"-";-ms-hyphenate-character:"-";hyphenate-character:"-";-webkit-hyphenate-limit-lines:3;-ms-hyphenate-limit-lines:3;hyphenate-limit-lines:3}h1,h2,h3,h4,h5,h6,dt,figcaption,pre,caption,address,center,code,var{-ms-hyphens:none;-moz-hyphens:none;-webkit-hyphens:none;-epub-hyphens:none;hyphens:none}body{font-variant-numeric:oldstyle-nums proportional-nums}:lang(ja) body,:lang(zh) body,:lang(ko) body{font-variant-numeric:lining-nums proportional-nums}h1,h2,h3,h4,h5,h6,dt{font-variant-numeric:lining-nums proportional-nums}table{font-variant-numeric:lining-nums tabular-nums}code,var{font-variant-ligatures:none;font-variant-numeric:lining-nums tabular-nums slashed-zero}rt{font-variant-east-asian:ruby}:lang(ar){font-variant-ligatures:common-ligatures}:lang(ko){font-kerning:normal}hr{color:inherit;border-color:currentcolor}table,th,td{border-color:currentcolor}figure,blockquote{margin:1em 5%}ul,ol{padding-left:5%}dd{margin-left:5%}pre{white-space:pre-wrap;-ms-tab-size:2;-moz-tab-size:2;-webkit-tab-size:2;tab-size:2}abbr[title],acronym[title]{text-decoration:dotted underline}nobr wbr{white-space:normal}ruby>rt,ruby>rp{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}*:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)),*:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)),*:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)),:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) cite,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) dfn,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) em,:lang(ja):not(:lang(ja-Latn)):not(:lang(ja-Cyrl)) i,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) cite,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) dfn,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) em,:lang(zh):not(:lang(zh-Latn)):not(:lang(zh-Cyrl)) i,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) cite,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) dfn,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) em,:lang(ko):not(:lang(ko-Latn)):not(:lang(ko-Cyrl)) i{font-style:normal}:lang(ja) a,:lang(zh) a,:lang(ko) a{text-decoration:none}:root{--RS__maxMediaWidth:100%;--RS__maxMediaHeight:95vh;--RS__boxSizingMedia:border-box;--RS__boxSizingTable:border-box}a,a span,span a,h1,h2,h3,h4,h5,h6{word-wrap:break-word}div{max-width:var(--RS__maxMediaWidth)}img,svg|svg,video{object-fit:contain;width:auto;height:auto;max-width:var(--RS__maxMediaWidth);max-height:var(--RS__maxMediaHeight)!important;box-sizing:var(--RS__boxSizingMedia);-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}audio{max-width:100%;-webkit-column-break-inside:avoid;page-break-inside:avoid;break-inside:avoid}table{max-width:var(--RS__maxMediaWidth);box-sizing:var(--RS__boxSizingTable)}
|
|
1210
|
+
`, ri = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(http://www.idpf.org/2007/ops);@namespace m url(http://www.w3.org/1998/Math/MathML);@namespace svg url(http://www.w3.org/2000/svg);:root{--RS__compFontFamily:var(--RS__baseFontFamily);--RS__codeFontFamily:var(--RS__monospaceTf);--RS__typeScale:1.125;--RS__baseFontSize:100%;--RS__flowSpacing:1.5rem;--RS__paraSpacing:0;--RS__paraIndent:1em;--RS__linkColor:#0000EE;--RS__visitedColor:#551A8B;--RS__primaryColor:;--RS__secondaryColor:}body{font-size:var(--RS__baseFontSize)}h1,h2,h3,h4,h5,h6{font-family:var(--RS__compFontFamily)}blockquote,figure,p,pre,aside,footer,form,hr{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}p{margin-top:var(--RS__paraSpacing);margin-bottom:var(--RS__paraSpacing);text-indent:var(--RS__paraIndent)}h1+p,h2+p,h3+p,h4+p,h5+p,h6+p,hr+p{text-indent:0}pre{font-family:var(--RS__codeFontFamily)}code,kbd,samp,tt{font-family:var(--RS__codeFontFamily)}sub,sup{position:relative;font-size:67.5%;line-height:1}sub{bottom:-.2ex}sup{bottom:0}:link{color:var(--RS__linkColor)}:visited{color:var(--RS__visitedColor)}h1{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:calc(var(--RS__flowSpacing) * 2);font-size:calc(((1em * var(--RS__typeScale)) * var(--RS__typeScale)) * var(--RS__typeScale))}h2{margin-top:calc(var(--RS__flowSpacing) * 2);margin-bottom:var(--RS__flowSpacing);font-size:calc((1em * var(--RS__typeScale)) * var(--RS__typeScale))}h3{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:calc(1em * var(--RS__typeScale))}h4{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em}h5{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing);font-size:1em;font-variant:small-caps}h6{margin-top:var(--RS__flowSpacing);margin-bottom:0;font-size:1em;text-transform:lowercase;font-variant:small-caps}dl,ol,ul{margin-top:var(--RS__flowSpacing);margin-bottom:var(--RS__flowSpacing)}table{margin:var(--RS__flowSpacing) 0;border:1px solid currentcolor;border-collapse:collapse;empty-cells:show}thead,tbody,tfoot,table>tr{vertical-align:top}th{text-align:left}th,td{padding:4px;border:1px solid currentcolor}
|
|
1211
|
+
`, et = (i, t) => URL.createObjectURL(new Blob([i], { type: t })), oA = (i) => i.replace(/\/\/.*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/\n/g, "").replace(/\s+/g, " "), Gt = (i) => i.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/url\((?!(https?:)?\/\/)("?)\/([^\)]+)/g, `url($2${window.location.origin}/$3`), Ae = (i, t) => {
|
|
1170
1212
|
const e = i.createElement("script");
|
|
1171
|
-
return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t :
|
|
1172
|
-
},
|
|
1213
|
+
return e.dataset.readium = "true", e.src = t.startsWith("blob:") ? t : et(t, "text/javascript"), e;
|
|
1214
|
+
}, Ht = (i, t) => {
|
|
1173
1215
|
const e = i.createElement("link");
|
|
1174
|
-
return e.dataset.readium = "true", e.rel = "stylesheet", e.type = "text/css", e.href = t.startsWith("blob:") ? t :
|
|
1175
|
-
},
|
|
1176
|
-
if (
|
|
1177
|
-
return
|
|
1216
|
+
return e.dataset.readium = "true", e.rel = "stylesheet", e.type = "text/css", e.href = t.startsWith("blob:") ? t : et(t, "text/css"), e;
|
|
1217
|
+
}, kt = /* @__PURE__ */ new Map(), lt = (i, t) => {
|
|
1218
|
+
if (kt.has(i))
|
|
1219
|
+
return kt.get(i);
|
|
1178
1220
|
const e = t();
|
|
1179
|
-
return
|
|
1180
|
-
},
|
|
1221
|
+
return kt.set(i, e), e;
|
|
1222
|
+
}, si = (i) => Ae(i, lt("css-selector-generator", () => et(
|
|
1181
1223
|
'!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports._readium_cssSelectorGenerator=e():t._readium_cssSelectorGenerator=e()}(self,(()=>(()=>{"use strict";var t,e,n={d:(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};function r(t){return t&&t instanceof Element}function i(t="unknown problem",...e){console.warn(`CssSelectorGenerator: ${t}`,...e)}n.r(o),n.d(o,{default:()=>z,getCssSelector:()=>U}),function(t){t.NONE="none",t.DESCENDANT="descendant",t.CHILD="child"}(t||(t={})),function(t){t.id="id",t.class="class",t.tag="tag",t.attribute="attribute",t.nthchild="nthchild",t.nthoftype="nthoftype"}(e||(e={}));const c={selectors:[e.id,e.class,e.tag,e.attribute],includeTag:!1,whitelist:[],blacklist:[],combineWithinSelector:!0,combineBetweenSelectors:!0,root:null,maxCombinations:Number.POSITIVE_INFINITY,maxCandidates:Number.POSITIVE_INFINITY};function u(t){return t instanceof RegExp}function s(t){return["string","function"].includes(typeof t)||u(t)}function l(t){return Array.isArray(t)?t.filter(s):[]}function a(t){const e=[Node.DOCUMENT_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE];return function(t){return t instanceof Node}(t)&&e.includes(t.nodeType)}function f(t,e){if(a(t))return t.contains(e)||i("element root mismatch","Provided root does not contain the element. This will most likely result in producing a fallback selector using element\'s real root node. If you plan to use the selector using provided root (e.g. `root.querySelector`), it will nto work as intended."),t;const n=e.getRootNode({composed:!1});return a(n)?(n!==document&&i("shadow root inferred","You did not provide a root and the element is a child of Shadow DOM. This will produce a selector using ShadowRoot as a root. If you plan to use the selector using document as a root (e.g. `document.querySelector`), it will not work as intended."),n):e.ownerDocument.querySelector(":root")}function d(t){return"number"==typeof t?t:Number.POSITIVE_INFINITY}function m(t=[]){const[e=[],...n]=t;return 0===n.length?e:n.reduce(((t,e)=>t.filter((t=>e.includes(t)))),e)}function p(t){return[].concat(...t)}function h(t){const e=t.map((t=>{if(u(t))return e=>t.test(e);if("function"==typeof t)return e=>{const n=t(e);return"boolean"!=typeof n?(i("pattern matcher function invalid","Provided pattern matching function does not return boolean. It\'s result will be ignored.",t),!1):n};if("string"==typeof t){const e=new RegExp("^"+t.replace(/[|\\\\{}()[\\]^$+?.]/g,"\\\\$&").replace(/\\*/g,".+")+"$");return t=>e.test(t)}return i("pattern matcher invalid","Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.",t),()=>!1}));return t=>e.some((e=>e(t)))}function g(t,e,n){const o=Array.from(f(n,t[0]).querySelectorAll(e));return o.length===t.length&&t.every((t=>o.includes(t)))}function y(t,e){e=null!=e?e:function(t){return t.ownerDocument.querySelector(":root")}(t);const n=[];let o=t;for(;r(o)&&o!==e;)n.push(o),o=o.parentElement;return n}function b(t,e){return m(t.map((t=>y(t,e))))}const N={[t.NONE]:{type:t.NONE,value:""},[t.DESCENDANT]:{type:t.DESCENDANT,value:" > "},[t.CHILD]:{type:t.CHILD,value:" "}},S=new RegExp(["^$","\\\\s"].join("|")),E=new RegExp(["^$"].join("|")),w=[e.nthoftype,e.tag,e.id,e.class,e.attribute,e.nthchild],v=h(["class","id","ng-*"]);function C({nodeName:t}){return`[${t}]`}function O({nodeName:t,nodeValue:e}){return`[${t}=\'${L(e)}\']`}function T(t){const e=Array.from(t.attributes).filter((e=>function({nodeName:t},e){const n=e.tagName.toLowerCase();return!(["input","option"].includes(n)&&"value"===t||v(t))}(e,t)));return[...e.map(C),...e.map(O)]}function I(t){return(t.getAttribute("class")||"").trim().split(/\\s+/).filter((t=>!E.test(t))).map((t=>`.${L(t)}`))}function x(t){const e=t.getAttribute("id")||"",n=`#${L(e)}`,o=t.getRootNode({composed:!1});return!S.test(e)&&g([t],n,o)?[n]:[]}function j(t){const e=t.parentNode;if(e){const n=Array.from(e.childNodes).filter(r).indexOf(t);if(n>-1)return[`:nth-child(${n+1})`]}return[]}function A(t){return[L(t.tagName.toLowerCase())]}function D(t){const e=[...new Set(p(t.map(A)))];return 0===e.length||e.length>1?[]:[e[0]]}function $(t){const e=D([t])[0],n=t.parentElement;if(n){const o=Array.from(n.children).filter((t=>t.tagName.toLowerCase()===e)),r=o.indexOf(t);if(r>-1)return[`${e}:nth-of-type(${r+1})`]}return[]}function R(t=[],{maxResults:e=Number.POSITIVE_INFINITY}={}){const n=[];let o=0,r=k(1);for(;r.length<=t.length&&o<e;)o+=1,n.push(r.map((e=>t[e]))),r=P(r,t.length-1);return n}function P(t=[],e=0){const n=t.length;if(0===n)return[];const o=[...t];o[n-1]+=1;for(let t=n-1;t>=0;t--)if(o[t]>e){if(0===t)return k(n+1);o[t-1]++,o[t]=o[t-1]+1}return o[n-1]>e?k(n+1):o}function k(t=1){return Array.from(Array(t).keys())}const _=":".charCodeAt(0).toString(16).toUpperCase(),M=/[ !"#$%&\'()\\[\\]{|}<>*+,./;=?@^`~\\\\]/;function L(t=""){var e,n;return null!==(n=null===(e=null===CSS||void 0===CSS?void 0:CSS.escape)||void 0===e?void 0:e.call(CSS,t))&&void 0!==n?n:function(t=""){return t.split("").map((t=>":"===t?`\\\\${_} `:M.test(t)?`\\\\${t}`:escape(t).replace(/%/g,"\\\\"))).join("")}(t)}const q={tag:D,id:function(t){return 0===t.length||t.length>1?[]:x(t[0])},class:function(t){return m(t.map(I))},attribute:function(t){return m(t.map(T))},nthchild:function(t){return m(t.map(j))},nthoftype:function(t){return m(t.map($))}},F={tag:A,id:x,class:I,attribute:T,nthchild:j,nthoftype:$};function V(t){return t.includes(e.tag)||t.includes(e.nthoftype)?[...t]:[...t,e.tag]}function Y(t={}){const n=[...w];return t[e.tag]&&t[e.nthoftype]&&n.splice(n.indexOf(e.tag),1),n.map((e=>{return(o=t)[n=e]?o[n].join(""):"";var n,o})).join("")}function B(t,e,n="",o){const r=function(t,e){return""===e?t:function(t,e){return[...t.map((t=>e+" "+t)),...t.map((t=>e+" > "+t))]}(t,e)}(function(t,e,n){const o=function(t,e){const{blacklist:n,whitelist:o,combineWithinSelector:r,maxCombinations:i}=e,c=h(n),u=h(o);return function(t){const{selectors:e,includeTag:n}=t,o=[].concat(e);return n&&!o.includes("tag")&&o.push("tag"),o}(e).reduce(((e,n)=>{const o=function(t,e){var n;return(null!==(n=q[e])&&void 0!==n?n:()=>[])(t)}(t,n),s=function(t=[],e,n){return t.filter((t=>n(t)||!e(t)))}(o,c,u),l=function(t=[],e){return t.sort(((t,n)=>{const o=e(t),r=e(n);return o&&!r?-1:!o&&r?1:0}))}(s,u);return e[n]=r?R(l,{maxResults:i}):l.map((t=>[t])),e}),{})}(t,n),r=function(t,e){return function(t){const{selectors:e,combineBetweenSelectors:n,includeTag:o,maxCandidates:r}=t,i=n?R(e,{maxResults:r}):e.map((t=>[t]));return o?i.map(V):i}(e).map((e=>function(t,e){const n={};return t.forEach((t=>{const o=e[t];o.length>0&&(n[t]=o)})),function(t={}){let e=[];return Object.entries(t).forEach((([t,n])=>{e=n.flatMap((n=>0===e.length?[{[t]:n}]:e.map((e=>Object.assign(Object.assign({},e),{[t]:n})))))})),e}(n).map(Y)}(e,t))).filter((t=>t.length>0))}(o,n),i=p(r);return[...new Set(i)]}(t,o.root,o),n);for(const e of r)if(g(t,e,o.root))return e;return null}function G(t){return{value:t,include:!1}}function W({selectors:t,operator:n}){let o=[...w];t[e.tag]&&t[e.nthoftype]&&(o=o.filter((t=>t!==e.tag)));let r="";return o.forEach((e=>{(t[e]||[]).forEach((({value:t,include:e})=>{e&&(r+=t)}))})),n.value+r}function H(n){return[":root",...y(n).reverse().map((n=>{const o=function(e,n,o=t.NONE){const r={};return n.forEach((t=>{Reflect.set(r,t,function(t,e){return F[e](t)}(e,t).map(G))})),{element:e,operator:N[o],selectors:r}}(n,[e.nthchild],t.DESCENDANT);return o.selectors.nthchild.forEach((t=>{t.include=!0})),o})).map(W)].join("")}function U(t,n={}){const o=function(t){const e=(Array.isArray(t)?t:[t]).filter(r);return[...new Set(e)]}(t),i=function(t,n={}){const o=Object.assign(Object.assign({},c),n);return{selectors:(r=o.selectors,Array.isArray(r)?r.filter((t=>{return n=e,o=t,Object.values(n).includes(o);var n,o})):[]),whitelist:l(o.whitelist),blacklist:l(o.blacklist),root:f(o.root,t),combineWithinSelector:!!o.combineWithinSelector,combineBetweenSelectors:!!o.combineBetweenSelectors,includeTag:!!o.includeTag,maxCombinations:d(o.maxCombinations),maxCandidates:d(o.maxCandidates)};var r}(o[0],n);let u="",s=i.root;function a(){return function(t,e,n="",o){if(0===t.length)return null;const r=[t.length>1?t:[],...b(t,e).map((t=>[t]))];for(const t of r){const e=B(t,0,n,o);if(e)return{foundElements:t,selector:e}}return null}(o,s,u,i)}let m=a();for(;m;){const{foundElements:t,selector:e}=m;if(g(o,e,i.root))return e;s=t[0],u=e,m=a()}return o.length>1?o.map((t=>U(t,i))).join(", "):function(t){return t.map(H).join(", ")}(o)}const z=U;return o})()));',
|
|
1182
1224
|
"text/javascript"
|
|
1183
|
-
))),
|
|
1225
|
+
))), oi = (i) => Ae(i, lt("JS-Before", () => et(oA(
|
|
1184
1226
|
`
|
|
1185
1227
|
window._readium_blockedEvents = [];
|
|
1186
1228
|
window._readium_blockEvents = true;
|
|
@@ -1194,7 +1236,7 @@ const ti = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(htt
|
|
|
1194
1236
|
};
|
|
1195
1237
|
window.addEventListener("DOMContentLoaded", window._readium_eventBlocker, true);
|
|
1196
1238
|
window.addEventListener("load", window._readium_eventBlocker, true);`
|
|
1197
|
-
), "text/javascript"))),
|
|
1239
|
+
), "text/javascript"))), ai = (i) => Ae(i, lt("JS-After", () => et(oA(
|
|
1198
1240
|
`
|
|
1199
1241
|
if(window.onload) window.onload = new Proxy(window.onload, {
|
|
1200
1242
|
apply: function(target, receiver, args) {
|
|
@@ -1208,7 +1250,7 @@ const ti = `@namespace url(http://www.w3.org/1999/xhtml);@namespace epub url(htt
|
|
|
1208
1250
|
}
|
|
1209
1251
|
});`
|
|
1210
1252
|
), "text/javascript")));
|
|
1211
|
-
class
|
|
1253
|
+
class aA {
|
|
1212
1254
|
constructor(t, e, A, n) {
|
|
1213
1255
|
this.pub = t, this.item = A, this.burl = A.toURL(e) || "", this.cssProperties = n;
|
|
1214
1256
|
}
|
|
@@ -1258,25 +1300,25 @@ class sA {
|
|
|
1258
1300
|
if (!t)
|
|
1259
1301
|
return "";
|
|
1260
1302
|
if (!n) {
|
|
1261
|
-
const a =
|
|
1262
|
-
t.head.firstChild ? t.head.firstChild.before(a) : t.head.appendChild(a), this.hasStyle(t) || a.after(
|
|
1303
|
+
const a = Ht(t, lt("ReadiumCSS-before", () => et(Gt(ni), "text/css")));
|
|
1304
|
+
t.head.firstChild ? t.head.firstChild.before(a) : t.head.appendChild(a), this.hasStyle(t) || a.after(Ht(t, lt("ReadiumCSS-default", () => et(Gt(ri), "text/css")))), t.head.appendChild(Ht(t, lt("ReadiumCSS-after", () => et(Gt(ii), "text/css")))), r && this.setProperties(r, t);
|
|
1263
1305
|
}
|
|
1264
1306
|
if (t.body.querySelectorAll("img").forEach((a) => {
|
|
1265
1307
|
a.setAttribute("fetchpriority", "high");
|
|
1266
1308
|
}), A.isHTML && ((o = this.pub.metadata.languages) != null && o[0])) {
|
|
1267
1309
|
const a = this.pub.metadata.languages[0];
|
|
1268
|
-
if (A ===
|
|
1310
|
+
if (A === d.XHTML) {
|
|
1269
1311
|
const l = document.documentElement.lang || document.documentElement.getAttribute("xml:lang"), h = document.body.lang || document.body.getAttribute("xml:lang");
|
|
1270
1312
|
h && !l ? (document.documentElement.lang = h, document.documentElement.setAttribute("xml:lang", h), document.body.removeAttribute("xml:lang"), document.body.removeAttribute("lang")) : l || (document.documentElement.lang = a, document.documentElement.setAttribute("xml:lang", a));
|
|
1271
1313
|
} else
|
|
1272
|
-
A ===
|
|
1314
|
+
A === d.HTML && !document.documentElement.lang && (document.documentElement.lang = a);
|
|
1273
1315
|
}
|
|
1274
1316
|
if (e !== void 0) {
|
|
1275
1317
|
const a = t.createElement("base");
|
|
1276
1318
|
a.href = e, a.dataset.readium = "true", t.head.firstChild.before(a);
|
|
1277
1319
|
}
|
|
1278
1320
|
const s = this.hasExecutable(t);
|
|
1279
|
-
return s && t.head.firstChild.before(
|
|
1321
|
+
return s && t.head.firstChild.before(oi(t)), t.head.firstChild.before(si(t)), s && t.head.appendChild(ai(t)), URL.createObjectURL(
|
|
1280
1322
|
new Blob([new XMLSerializer().serializeToString(t)], {
|
|
1281
1323
|
type: A.isHTML ? A.string : "application/xhtml+xml"
|
|
1282
1324
|
// Fallback to XHTML
|
|
@@ -1284,8 +1326,8 @@ class sA {
|
|
|
1284
1326
|
);
|
|
1285
1327
|
}
|
|
1286
1328
|
}
|
|
1287
|
-
const
|
|
1288
|
-
class
|
|
1329
|
+
const li = Math.pow(2, 32), Ee = () => Math.round(Math.random() * li).toString(36), Ot = () => `${Math.round(performance.now())}-${Ee()}-${Ee()}`, ot = 1;
|
|
1330
|
+
class hi {
|
|
1289
1331
|
constructor(t) {
|
|
1290
1332
|
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);
|
|
1291
1333
|
}
|
|
@@ -1298,8 +1340,8 @@ class oi {
|
|
|
1298
1340
|
if (!(!("_readium" in e) || !e._readium || e._readium <= 0)) {
|
|
1299
1341
|
if (e.key === "_ping") {
|
|
1300
1342
|
if (!this.destination) {
|
|
1301
|
-
if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !==
|
|
1302
|
-
e._readium >
|
|
1343
|
+
if (this.destination = t.source, this.origin = t.origin, this.channelId = e._channel, e._readium !== ot) {
|
|
1344
|
+
e._readium > ot ? this.send("error", `received comms version ${e._readium} higher than ${ot}`) : this.send("error", `received comms version ${e._readium} lower than ${ot}`), this.destination = null, this.origin = "", this.channelId = "";
|
|
1303
1345
|
return;
|
|
1304
1346
|
}
|
|
1305
1347
|
this.send("_pong", void 0), this.preLog.forEach((A) => this.send("log", A)), this.preLog = [];
|
|
@@ -1362,7 +1404,7 @@ class oi {
|
|
|
1362
1404
|
if (!this.destination)
|
|
1363
1405
|
throw Error("Attempted to send comms message before destination has been initialized");
|
|
1364
1406
|
const r = {
|
|
1365
|
-
_readium:
|
|
1407
|
+
_readium: ot,
|
|
1366
1408
|
_channel: this.channelId,
|
|
1367
1409
|
id: A ?? Ot(),
|
|
1368
1410
|
// scrict,
|
|
@@ -1381,7 +1423,48 @@ class oi {
|
|
|
1381
1423
|
}
|
|
1382
1424
|
}
|
|
1383
1425
|
}
|
|
1384
|
-
class
|
|
1426
|
+
const K = class at {
|
|
1427
|
+
constructor(t) {
|
|
1428
|
+
if (typeof t == "string") {
|
|
1429
|
+
if (!at.VALID_MODES.has(t.toLowerCase()))
|
|
1430
|
+
return;
|
|
1431
|
+
this.value = t.toLowerCase();
|
|
1432
|
+
} else {
|
|
1433
|
+
const e = t.filter(
|
|
1434
|
+
(A) => at.VALID_MODES.has(A.toLowerCase())
|
|
1435
|
+
);
|
|
1436
|
+
if (e.length === 0)
|
|
1437
|
+
return;
|
|
1438
|
+
this.value = Array.from(new Set(e));
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Parses a [PrimaryAccessMode] from its RWPM JSON representation.
|
|
1443
|
+
*/
|
|
1444
|
+
static deserialize(t) {
|
|
1445
|
+
if (!t)
|
|
1446
|
+
return;
|
|
1447
|
+
if (typeof t == "string")
|
|
1448
|
+
return new at(t);
|
|
1449
|
+
if (!Array.isArray(t))
|
|
1450
|
+
return;
|
|
1451
|
+
const e = t.filter((A) => A ? at.VALID_MODES.has(A.toLowerCase()) : !1);
|
|
1452
|
+
if (e.length !== 0)
|
|
1453
|
+
return new at(e);
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* Serializes a [PrimaryAccessMode] to its RWPM JSON representation.
|
|
1457
|
+
*/
|
|
1458
|
+
serialize() {
|
|
1459
|
+
return this.value;
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
K.VALID_MODES = /* @__PURE__ */ new Set(["auditory", "tactile", "textual", "visual"]);
|
|
1463
|
+
K.AUDITORY = new K("auditory");
|
|
1464
|
+
K.TACTILE = new K("tactile");
|
|
1465
|
+
K.TEXTUAL = new K("textual");
|
|
1466
|
+
K.VISUAL = new K("visual");
|
|
1467
|
+
class ie {
|
|
1385
1468
|
/**
|
|
1386
1469
|
* Creates a [Encryption].
|
|
1387
1470
|
*/
|
|
@@ -1393,7 +1476,7 @@ class ne {
|
|
|
1393
1476
|
*/
|
|
1394
1477
|
static deserialize(t) {
|
|
1395
1478
|
if (t && t.algorithm)
|
|
1396
|
-
return new
|
|
1479
|
+
return new ie({
|
|
1397
1480
|
algorithm: t.algorithm,
|
|
1398
1481
|
compression: t.compression,
|
|
1399
1482
|
originalLength: t.originalLength,
|
|
@@ -1409,7 +1492,7 @@ class ne {
|
|
|
1409
1492
|
return this.compression !== void 0 && (t.compression = this.compression), this.originalLength !== void 0 && (t.originalLength = this.originalLength), this.profile !== void 0 && (t.profile = this.profile), this.scheme !== void 0 && (t.scheme = this.scheme), t;
|
|
1410
1493
|
}
|
|
1411
1494
|
}
|
|
1412
|
-
class
|
|
1495
|
+
class V {
|
|
1413
1496
|
constructor(t) {
|
|
1414
1497
|
this.otherProperties = t;
|
|
1415
1498
|
}
|
|
@@ -1421,7 +1504,7 @@ class j {
|
|
|
1421
1504
|
*/
|
|
1422
1505
|
static deserialize(t) {
|
|
1423
1506
|
if (t)
|
|
1424
|
-
return new
|
|
1507
|
+
return new V(t);
|
|
1425
1508
|
}
|
|
1426
1509
|
/**
|
|
1427
1510
|
* Serializes a [Properties] to its RWPM JSON representation.
|
|
@@ -1436,34 +1519,34 @@ class j {
|
|
|
1436
1519
|
const e = Object.assign({}, this.otherProperties);
|
|
1437
1520
|
for (const A in t)
|
|
1438
1521
|
e[A] = t[A];
|
|
1439
|
-
return new
|
|
1522
|
+
return new V(e);
|
|
1440
1523
|
}
|
|
1441
1524
|
}
|
|
1442
|
-
Object.defineProperty(
|
|
1525
|
+
Object.defineProperty(V.prototype, "encryption", {
|
|
1443
1526
|
get: function() {
|
|
1444
|
-
return
|
|
1527
|
+
return ie.deserialize(this.otherProperties.encrypted);
|
|
1445
1528
|
}
|
|
1446
1529
|
});
|
|
1447
|
-
function
|
|
1530
|
+
function ci(i) {
|
|
1448
1531
|
return i && i instanceof Array ? i : void 0;
|
|
1449
1532
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return i && typeof i == "string" ? [i] :
|
|
1533
|
+
function lA(i) {
|
|
1534
|
+
return i && typeof i == "string" ? [i] : ci(i);
|
|
1452
1535
|
}
|
|
1453
1536
|
function we(i) {
|
|
1454
1537
|
return typeof i == "string" ? new Date(i) : void 0;
|
|
1455
1538
|
}
|
|
1456
|
-
function
|
|
1539
|
+
function Ct(i) {
|
|
1457
1540
|
return isNaN(i) ? void 0 : i;
|
|
1458
1541
|
}
|
|
1459
1542
|
function x(i) {
|
|
1460
|
-
return
|
|
1543
|
+
return Ct(i) !== void 0 && Math.sign(i) >= 0 ? i : void 0;
|
|
1461
1544
|
}
|
|
1462
|
-
function
|
|
1545
|
+
function gi(i) {
|
|
1463
1546
|
const t = new Array();
|
|
1464
1547
|
return i.forEach((e) => t.push(e)), t;
|
|
1465
1548
|
}
|
|
1466
|
-
class
|
|
1549
|
+
class u {
|
|
1467
1550
|
/** Creates a MediaType object. */
|
|
1468
1551
|
constructor(t) {
|
|
1469
1552
|
let e, A, n = t.mediaType.replace(/\s/g, "").split(";");
|
|
@@ -1492,7 +1575,7 @@ class d {
|
|
|
1492
1575
|
this.string = h, this.type = e, this.subtype = A, this.parameters = o, this.encoding = c, this.name = t.name, this.fileExtension = t.fileExtension;
|
|
1493
1576
|
}
|
|
1494
1577
|
static parse(t) {
|
|
1495
|
-
return new
|
|
1578
|
+
return new u(t);
|
|
1496
1579
|
}
|
|
1497
1580
|
/** Structured syntax suffix, e.g. `+zip` in `application/epub+zip`.
|
|
1498
1581
|
* Gives a hint on the underlying structure of this media type.
|
|
@@ -1522,7 +1605,7 @@ class d {
|
|
|
1522
1605
|
* - Wildcards are supported, meaning that `image/*` contains `image/png`
|
|
1523
1606
|
*/
|
|
1524
1607
|
contains(t) {
|
|
1525
|
-
const e = typeof t == "string" ?
|
|
1608
|
+
const e = typeof t == "string" ? u.parse({ mediaType: t }) : t;
|
|
1526
1609
|
if (!((this.type === "*" || this.type === e.type) && (this.subtype === "*" || this.subtype === e.subtype)))
|
|
1527
1610
|
return !1;
|
|
1528
1611
|
const A = new Set(
|
|
@@ -1541,7 +1624,7 @@ class d {
|
|
|
1541
1624
|
* doesn't. This is basically like `contains`, but working in both direction.
|
|
1542
1625
|
*/
|
|
1543
1626
|
matches(t) {
|
|
1544
|
-
const e = typeof t == "string" ?
|
|
1627
|
+
const e = typeof t == "string" ? u.parse({ mediaType: t }) : t;
|
|
1545
1628
|
return this.contains(e) || e.contains(this);
|
|
1546
1629
|
}
|
|
1547
1630
|
/**
|
|
@@ -1560,38 +1643,38 @@ class d {
|
|
|
1560
1643
|
/** Returns whether this media type is structured as a ZIP archive. */
|
|
1561
1644
|
get isZIP() {
|
|
1562
1645
|
return this.matchesAny(
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1646
|
+
u.ZIP,
|
|
1647
|
+
u.LCP_PROTECTED_AUDIOBOOK,
|
|
1648
|
+
u.LCP_PROTECTED_PDF
|
|
1566
1649
|
) || this.structuredSyntaxSuffix === "+zip";
|
|
1567
1650
|
}
|
|
1568
1651
|
/** Returns whether this media type is structured as a JSON file. */
|
|
1569
1652
|
get isJSON() {
|
|
1570
|
-
return this.matchesAny(
|
|
1653
|
+
return this.matchesAny(u.JSON) || this.structuredSyntaxSuffix === "+json";
|
|
1571
1654
|
}
|
|
1572
1655
|
/** Returns whether this media type is of an OPDS feed. */
|
|
1573
1656
|
get isOPDS() {
|
|
1574
1657
|
return this.matchesAny(
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1658
|
+
u.OPDS1,
|
|
1659
|
+
u.OPDS1_ENTRY,
|
|
1660
|
+
u.OPDS2,
|
|
1661
|
+
u.OPDS2_PUBLICATION,
|
|
1662
|
+
u.OPDS_AUTHENTICATION
|
|
1580
1663
|
) || this.structuredSyntaxSuffix === "+json";
|
|
1581
1664
|
}
|
|
1582
1665
|
/** Returns whether this media type is of an HTML document. */
|
|
1583
1666
|
get isHTML() {
|
|
1584
|
-
return this.matchesAny(
|
|
1667
|
+
return this.matchesAny(u.HTML, u.XHTML);
|
|
1585
1668
|
}
|
|
1586
1669
|
/** Returns whether this media type is of a bitmap image, so excluding vectorial formats. */
|
|
1587
1670
|
get isBitmap() {
|
|
1588
1671
|
return this.matchesAny(
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1672
|
+
u.BMP,
|
|
1673
|
+
u.GIF,
|
|
1674
|
+
u.JPEG,
|
|
1675
|
+
u.PNG,
|
|
1676
|
+
u.TIFF,
|
|
1677
|
+
u.WEBP
|
|
1595
1678
|
);
|
|
1596
1679
|
}
|
|
1597
1680
|
/** Returns whether this media type is of an audio clip. */
|
|
@@ -1605,314 +1688,314 @@ class d {
|
|
|
1605
1688
|
/** Returns whether this media type is of a Readium Web Publication Manifest. */
|
|
1606
1689
|
get isRWPM() {
|
|
1607
1690
|
return this.matchesAny(
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1691
|
+
u.READIUM_AUDIOBOOK_MANIFEST,
|
|
1692
|
+
u.DIVINA_MANIFEST,
|
|
1693
|
+
u.READIUM_WEBPUB_MANIFEST
|
|
1611
1694
|
);
|
|
1612
1695
|
}
|
|
1613
1696
|
/** Returns whether this media type is of a publication file. */
|
|
1614
1697
|
get isPublication() {
|
|
1615
1698
|
return this.matchesAny(
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1699
|
+
u.READIUM_AUDIOBOOK,
|
|
1700
|
+
u.READIUM_AUDIOBOOK_MANIFEST,
|
|
1701
|
+
u.CBZ,
|
|
1702
|
+
u.DIVINA,
|
|
1703
|
+
u.DIVINA_MANIFEST,
|
|
1704
|
+
u.EPUB,
|
|
1705
|
+
u.LCP_PROTECTED_AUDIOBOOK,
|
|
1706
|
+
u.LCP_PROTECTED_PDF,
|
|
1707
|
+
u.LPF,
|
|
1708
|
+
u.PDF,
|
|
1709
|
+
u.W3C_WPUB_MANIFEST,
|
|
1710
|
+
u.READIUM_WEBPUB,
|
|
1711
|
+
u.READIUM_WEBPUB_MANIFEST,
|
|
1712
|
+
u.ZAB
|
|
1630
1713
|
);
|
|
1631
1714
|
}
|
|
1632
1715
|
// Known Media Types
|
|
1633
1716
|
static get AAC() {
|
|
1634
|
-
return
|
|
1717
|
+
return u.parse({ mediaType: "audio/aac", fileExtension: "aac" });
|
|
1635
1718
|
}
|
|
1636
1719
|
static get ACSM() {
|
|
1637
|
-
return
|
|
1720
|
+
return u.parse({
|
|
1638
1721
|
mediaType: "application/vnd.adobe.adept+xml",
|
|
1639
1722
|
name: "Adobe Content Server Message",
|
|
1640
1723
|
fileExtension: "acsm"
|
|
1641
1724
|
});
|
|
1642
1725
|
}
|
|
1643
1726
|
static get AIFF() {
|
|
1644
|
-
return
|
|
1727
|
+
return u.parse({ mediaType: "audio/aiff", fileExtension: "aiff" });
|
|
1645
1728
|
}
|
|
1646
1729
|
static get AVI() {
|
|
1647
|
-
return
|
|
1730
|
+
return u.parse({
|
|
1648
1731
|
mediaType: "video/x-msvideo",
|
|
1649
1732
|
fileExtension: "avi"
|
|
1650
1733
|
});
|
|
1651
1734
|
}
|
|
1652
1735
|
static get BINARY() {
|
|
1653
|
-
return
|
|
1736
|
+
return u.parse({ mediaType: "application/octet-stream" });
|
|
1654
1737
|
}
|
|
1655
1738
|
static get BMP() {
|
|
1656
|
-
return
|
|
1739
|
+
return u.parse({ mediaType: "image/bmp", fileExtension: "bmp" });
|
|
1657
1740
|
}
|
|
1658
1741
|
static get CBZ() {
|
|
1659
|
-
return
|
|
1742
|
+
return u.parse({
|
|
1660
1743
|
mediaType: "application/vnd.comicbook+zip",
|
|
1661
1744
|
name: "Comic Book Archive",
|
|
1662
1745
|
fileExtension: "cbz"
|
|
1663
1746
|
});
|
|
1664
1747
|
}
|
|
1665
1748
|
static get CSS() {
|
|
1666
|
-
return
|
|
1749
|
+
return u.parse({ mediaType: "text/css", fileExtension: "css" });
|
|
1667
1750
|
}
|
|
1668
1751
|
static get DIVINA() {
|
|
1669
|
-
return
|
|
1752
|
+
return u.parse({
|
|
1670
1753
|
mediaType: "application/divina+zip",
|
|
1671
1754
|
name: "Digital Visual Narratives",
|
|
1672
1755
|
fileExtension: "divina"
|
|
1673
1756
|
});
|
|
1674
1757
|
}
|
|
1675
1758
|
static get DIVINA_MANIFEST() {
|
|
1676
|
-
return
|
|
1759
|
+
return u.parse({
|
|
1677
1760
|
mediaType: "application/divina+json",
|
|
1678
1761
|
name: "Digital Visual Narratives",
|
|
1679
1762
|
fileExtension: "json"
|
|
1680
1763
|
});
|
|
1681
1764
|
}
|
|
1682
1765
|
static get EPUB() {
|
|
1683
|
-
return
|
|
1766
|
+
return u.parse({
|
|
1684
1767
|
mediaType: "application/epub+zip",
|
|
1685
1768
|
name: "EPUB",
|
|
1686
1769
|
fileExtension: "epub"
|
|
1687
1770
|
});
|
|
1688
1771
|
}
|
|
1689
1772
|
static get GIF() {
|
|
1690
|
-
return
|
|
1773
|
+
return u.parse({ mediaType: "image/gif", fileExtension: "gif" });
|
|
1691
1774
|
}
|
|
1692
1775
|
static get GZ() {
|
|
1693
|
-
return
|
|
1776
|
+
return u.parse({
|
|
1694
1777
|
mediaType: "application/gzip",
|
|
1695
1778
|
fileExtension: "gz"
|
|
1696
1779
|
});
|
|
1697
1780
|
}
|
|
1698
1781
|
static get HTML() {
|
|
1699
|
-
return
|
|
1782
|
+
return u.parse({ mediaType: "text/html", fileExtension: "html" });
|
|
1700
1783
|
}
|
|
1701
1784
|
static get JAVASCRIPT() {
|
|
1702
|
-
return
|
|
1785
|
+
return u.parse({
|
|
1703
1786
|
mediaType: "text/javascript",
|
|
1704
1787
|
fileExtension: "js"
|
|
1705
1788
|
});
|
|
1706
1789
|
}
|
|
1707
1790
|
static get JPEG() {
|
|
1708
|
-
return
|
|
1791
|
+
return u.parse({ mediaType: "image/jpeg", fileExtension: "jpeg" });
|
|
1709
1792
|
}
|
|
1710
1793
|
static get JSON() {
|
|
1711
|
-
return
|
|
1794
|
+
return u.parse({ mediaType: "application/json" });
|
|
1712
1795
|
}
|
|
1713
1796
|
static get LCP_LICENSE_DOCUMENT() {
|
|
1714
|
-
return
|
|
1797
|
+
return u.parse({
|
|
1715
1798
|
mediaType: "application/vnd.readium.lcp.license.v1.0+json",
|
|
1716
1799
|
name: "LCP License",
|
|
1717
1800
|
fileExtension: "lcpl"
|
|
1718
1801
|
});
|
|
1719
1802
|
}
|
|
1720
1803
|
static get LCP_PROTECTED_AUDIOBOOK() {
|
|
1721
|
-
return
|
|
1804
|
+
return u.parse({
|
|
1722
1805
|
mediaType: "application/audiobook+lcp",
|
|
1723
1806
|
name: "LCP Protected Audiobook",
|
|
1724
1807
|
fileExtension: "lcpa"
|
|
1725
1808
|
});
|
|
1726
1809
|
}
|
|
1727
1810
|
static get LCP_PROTECTED_PDF() {
|
|
1728
|
-
return
|
|
1811
|
+
return u.parse({
|
|
1729
1812
|
mediaType: "application/pdf+lcp",
|
|
1730
1813
|
name: "LCP Protected PDF",
|
|
1731
1814
|
fileExtension: "lcpdf"
|
|
1732
1815
|
});
|
|
1733
1816
|
}
|
|
1734
1817
|
static get LCP_STATUS_DOCUMENT() {
|
|
1735
|
-
return
|
|
1818
|
+
return u.parse({
|
|
1736
1819
|
mediaType: "application/vnd.readium.license.status.v1.0+json"
|
|
1737
1820
|
});
|
|
1738
1821
|
}
|
|
1739
1822
|
static get LPF() {
|
|
1740
|
-
return
|
|
1823
|
+
return u.parse({
|
|
1741
1824
|
mediaType: "application/lpf+zip",
|
|
1742
1825
|
fileExtension: "lpf"
|
|
1743
1826
|
});
|
|
1744
1827
|
}
|
|
1745
1828
|
static get MP3() {
|
|
1746
|
-
return
|
|
1829
|
+
return u.parse({ mediaType: "audio/mpeg", fileExtension: "mp3" });
|
|
1747
1830
|
}
|
|
1748
1831
|
static get MPEG() {
|
|
1749
|
-
return
|
|
1832
|
+
return u.parse({ mediaType: "video/mpeg", fileExtension: "mpeg" });
|
|
1750
1833
|
}
|
|
1751
1834
|
static get NCX() {
|
|
1752
|
-
return
|
|
1835
|
+
return u.parse({
|
|
1753
1836
|
mediaType: "application/x-dtbncx+xml",
|
|
1754
1837
|
fileExtension: "ncx"
|
|
1755
1838
|
});
|
|
1756
1839
|
}
|
|
1757
1840
|
static get OGG() {
|
|
1758
|
-
return
|
|
1841
|
+
return u.parse({ mediaType: "audio/ogg", fileExtension: "oga" });
|
|
1759
1842
|
}
|
|
1760
1843
|
static get OGV() {
|
|
1761
|
-
return
|
|
1844
|
+
return u.parse({ mediaType: "video/ogg", fileExtension: "ogv" });
|
|
1762
1845
|
}
|
|
1763
1846
|
static get OPDS1() {
|
|
1764
|
-
return
|
|
1847
|
+
return u.parse({
|
|
1765
1848
|
mediaType: "application/atom+xml;profile=opds-catalog"
|
|
1766
1849
|
});
|
|
1767
1850
|
}
|
|
1768
1851
|
static get OPDS1_ENTRY() {
|
|
1769
|
-
return
|
|
1852
|
+
return u.parse({
|
|
1770
1853
|
mediaType: "application/atom+xml;type=entry;profile=opds-catalog"
|
|
1771
1854
|
});
|
|
1772
1855
|
}
|
|
1773
1856
|
static get OPDS2() {
|
|
1774
|
-
return
|
|
1857
|
+
return u.parse({ mediaType: "application/opds+json" });
|
|
1775
1858
|
}
|
|
1776
1859
|
static get OPDS2_PUBLICATION() {
|
|
1777
|
-
return
|
|
1860
|
+
return u.parse({ mediaType: "application/opds-publication+json" });
|
|
1778
1861
|
}
|
|
1779
1862
|
static get OPDS_AUTHENTICATION() {
|
|
1780
|
-
return
|
|
1863
|
+
return u.parse({
|
|
1781
1864
|
mediaType: "application/opds-authentication+json"
|
|
1782
1865
|
});
|
|
1783
1866
|
}
|
|
1784
1867
|
static get OPUS() {
|
|
1785
|
-
return
|
|
1868
|
+
return u.parse({ mediaType: "audio/opus", fileExtension: "opus" });
|
|
1786
1869
|
}
|
|
1787
1870
|
static get OTF() {
|
|
1788
|
-
return
|
|
1871
|
+
return u.parse({ mediaType: "font/otf", fileExtension: "otf" });
|
|
1789
1872
|
}
|
|
1790
1873
|
static get PDF() {
|
|
1791
|
-
return
|
|
1874
|
+
return u.parse({
|
|
1792
1875
|
mediaType: "application/pdf",
|
|
1793
1876
|
name: "PDF",
|
|
1794
1877
|
fileExtension: "pdf"
|
|
1795
1878
|
});
|
|
1796
1879
|
}
|
|
1797
1880
|
static get PNG() {
|
|
1798
|
-
return
|
|
1881
|
+
return u.parse({ mediaType: "image/png", fileExtension: "png" });
|
|
1799
1882
|
}
|
|
1800
1883
|
static get READIUM_AUDIOBOOK() {
|
|
1801
|
-
return
|
|
1884
|
+
return u.parse({
|
|
1802
1885
|
mediaType: "application/audiobook+zip",
|
|
1803
1886
|
name: "Readium Audiobook",
|
|
1804
1887
|
fileExtension: "audiobook"
|
|
1805
1888
|
});
|
|
1806
1889
|
}
|
|
1807
1890
|
static get READIUM_AUDIOBOOK_MANIFEST() {
|
|
1808
|
-
return
|
|
1891
|
+
return u.parse({
|
|
1809
1892
|
mediaType: "application/audiobook+json",
|
|
1810
1893
|
name: "Readium Audiobook",
|
|
1811
1894
|
fileExtension: "json"
|
|
1812
1895
|
});
|
|
1813
1896
|
}
|
|
1814
1897
|
static get READIUM_CONTENT_DOCUMENT() {
|
|
1815
|
-
return
|
|
1898
|
+
return u.parse({
|
|
1816
1899
|
mediaType: "application/vnd.readium.content+json",
|
|
1817
1900
|
name: "Readium Content Document",
|
|
1818
1901
|
fileExtension: "json"
|
|
1819
1902
|
});
|
|
1820
1903
|
}
|
|
1821
1904
|
static get READIUM_GUIDED_NAVIGATION_DOCUMENT() {
|
|
1822
|
-
return
|
|
1905
|
+
return u.parse({
|
|
1823
1906
|
mediaType: "application/guided-navigation+json",
|
|
1824
1907
|
name: "Readium Guided Navigation Document",
|
|
1825
1908
|
fileExtension: "json"
|
|
1826
1909
|
});
|
|
1827
1910
|
}
|
|
1828
1911
|
static get READIUM_POSITION_LIST() {
|
|
1829
|
-
return
|
|
1912
|
+
return u.parse({
|
|
1830
1913
|
mediaType: "application/vnd.readium.position-list+json",
|
|
1831
1914
|
name: "Readium Position List",
|
|
1832
1915
|
fileExtension: "json"
|
|
1833
1916
|
});
|
|
1834
1917
|
}
|
|
1835
1918
|
static get READIUM_WEBPUB() {
|
|
1836
|
-
return
|
|
1919
|
+
return u.parse({
|
|
1837
1920
|
mediaType: "application/webpub+zip",
|
|
1838
1921
|
name: "Readium Web Publication",
|
|
1839
1922
|
fileExtension: "webpub"
|
|
1840
1923
|
});
|
|
1841
1924
|
}
|
|
1842
1925
|
static get READIUM_WEBPUB_MANIFEST() {
|
|
1843
|
-
return
|
|
1926
|
+
return u.parse({
|
|
1844
1927
|
mediaType: "application/webpub+json",
|
|
1845
1928
|
name: "Readium Web Publication",
|
|
1846
1929
|
fileExtension: "json"
|
|
1847
1930
|
});
|
|
1848
1931
|
}
|
|
1849
1932
|
static get SMIL() {
|
|
1850
|
-
return
|
|
1933
|
+
return u.parse({
|
|
1851
1934
|
mediaType: "application/smil+xml",
|
|
1852
1935
|
fileExtension: "smil"
|
|
1853
1936
|
});
|
|
1854
1937
|
}
|
|
1855
1938
|
static get SVG() {
|
|
1856
|
-
return
|
|
1939
|
+
return u.parse({
|
|
1857
1940
|
mediaType: "image/svg+xml",
|
|
1858
1941
|
fileExtension: "svg"
|
|
1859
1942
|
});
|
|
1860
1943
|
}
|
|
1861
1944
|
static get TEXT() {
|
|
1862
|
-
return
|
|
1945
|
+
return u.parse({ mediaType: "text/plain", fileExtension: "txt" });
|
|
1863
1946
|
}
|
|
1864
1947
|
static get TIFF() {
|
|
1865
|
-
return
|
|
1948
|
+
return u.parse({ mediaType: "image/tiff", fileExtension: "tiff" });
|
|
1866
1949
|
}
|
|
1867
1950
|
static get TTF() {
|
|
1868
|
-
return
|
|
1951
|
+
return u.parse({ mediaType: "font/ttf", fileExtension: "ttf" });
|
|
1869
1952
|
}
|
|
1870
1953
|
static get W3C_WPUB_MANIFEST() {
|
|
1871
|
-
return
|
|
1954
|
+
return u.parse({
|
|
1872
1955
|
mediaType: "application/x.readium.w3c.wpub+json",
|
|
1873
1956
|
name: "Web Publication",
|
|
1874
1957
|
fileExtension: "json"
|
|
1875
1958
|
});
|
|
1876
1959
|
}
|
|
1877
1960
|
static get WAV() {
|
|
1878
|
-
return
|
|
1961
|
+
return u.parse({ mediaType: "audio/wav", fileExtension: "wav" });
|
|
1879
1962
|
}
|
|
1880
1963
|
static get WEBM_AUDIO() {
|
|
1881
|
-
return
|
|
1964
|
+
return u.parse({ mediaType: "audio/webm", fileExtension: "webm" });
|
|
1882
1965
|
}
|
|
1883
1966
|
static get WEBM_VIDEO() {
|
|
1884
|
-
return
|
|
1967
|
+
return u.parse({ mediaType: "video/webm", fileExtension: "webm" });
|
|
1885
1968
|
}
|
|
1886
1969
|
static get WEBP() {
|
|
1887
|
-
return
|
|
1970
|
+
return u.parse({ mediaType: "image/webp", fileExtension: "webp" });
|
|
1888
1971
|
}
|
|
1889
1972
|
static get WOFF() {
|
|
1890
|
-
return
|
|
1973
|
+
return u.parse({ mediaType: "font/woff", fileExtension: "woff" });
|
|
1891
1974
|
}
|
|
1892
1975
|
static get WOFF2() {
|
|
1893
|
-
return
|
|
1976
|
+
return u.parse({ mediaType: "font/woff2", fileExtension: "woff2" });
|
|
1894
1977
|
}
|
|
1895
1978
|
static get XHTML() {
|
|
1896
|
-
return
|
|
1979
|
+
return u.parse({
|
|
1897
1980
|
mediaType: "application/xhtml+xml",
|
|
1898
1981
|
fileExtension: "xhtml"
|
|
1899
1982
|
});
|
|
1900
1983
|
}
|
|
1901
1984
|
static get XML() {
|
|
1902
|
-
return
|
|
1985
|
+
return u.parse({
|
|
1903
1986
|
mediaType: "application/xml",
|
|
1904
1987
|
fileExtension: "xml"
|
|
1905
1988
|
});
|
|
1906
1989
|
}
|
|
1907
1990
|
static get ZAB() {
|
|
1908
|
-
return
|
|
1991
|
+
return u.parse({
|
|
1909
1992
|
mediaType: "application/x.readium.zab+zip",
|
|
1910
1993
|
name: "Zipped Audio Book",
|
|
1911
1994
|
fileExtension: "zab"
|
|
1912
1995
|
});
|
|
1913
1996
|
}
|
|
1914
1997
|
static get ZIP() {
|
|
1915
|
-
return
|
|
1998
|
+
return u.parse({
|
|
1916
1999
|
mediaType: "application/zip",
|
|
1917
2000
|
fileExtension: "zip"
|
|
1918
2001
|
});
|
|
@@ -1959,7 +2042,7 @@ class y {
|
|
|
1959
2042
|
static deserialize(t) {
|
|
1960
2043
|
if (!t)
|
|
1961
2044
|
return;
|
|
1962
|
-
const e =
|
|
2045
|
+
const e = Ct(t.progression), A = Ct(t.totalProgression), n = Ct(t.position), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set([
|
|
1963
2046
|
"fragment",
|
|
1964
2047
|
"fragments",
|
|
1965
2048
|
"progression",
|
|
@@ -1969,7 +2052,7 @@ class y {
|
|
|
1969
2052
|
return Object.entries(t).forEach(([o, a]) => {
|
|
1970
2053
|
s.has(o) || r.set(o, a);
|
|
1971
2054
|
}), new y({
|
|
1972
|
-
fragments:
|
|
2055
|
+
fragments: lA(t.fragments || t.fragment),
|
|
1973
2056
|
progression: e !== void 0 && e >= 0 && e <= 1 ? e : void 0,
|
|
1974
2057
|
totalProgression: A !== void 0 && A >= 0 && A <= 1 ? A : void 0,
|
|
1975
2058
|
position: n !== void 0 && n > 0 ? n : void 0,
|
|
@@ -1984,7 +2067,7 @@ class y {
|
|
|
1984
2067
|
return this.fragments && (t.fragments = this.fragments), this.progression !== void 0 && (t.progression = this.progression), this.totalProgression !== void 0 && (t.totalProgression = this.totalProgression), this.position !== void 0 && (t.position = this.position), this.otherLocations && this.otherLocations.forEach((e, A) => t[A] = e), t;
|
|
1985
2068
|
}
|
|
1986
2069
|
}
|
|
1987
|
-
class
|
|
2070
|
+
class mt {
|
|
1988
2071
|
/**
|
|
1989
2072
|
* Creates a [Text].
|
|
1990
2073
|
*/
|
|
@@ -1996,7 +2079,7 @@ class ht {
|
|
|
1996
2079
|
*/
|
|
1997
2080
|
static deserialize(t) {
|
|
1998
2081
|
if (t)
|
|
1999
|
-
return new
|
|
2082
|
+
return new mt({
|
|
2000
2083
|
after: t.after,
|
|
2001
2084
|
before: t.before,
|
|
2002
2085
|
highlight: t.highlight
|
|
@@ -2010,7 +2093,7 @@ class ht {
|
|
|
2010
2093
|
return this.after !== void 0 && (t.after = this.after), this.before !== void 0 && (t.before = this.before), this.highlight !== void 0 && (t.highlight = this.highlight), t;
|
|
2011
2094
|
}
|
|
2012
2095
|
}
|
|
2013
|
-
class
|
|
2096
|
+
class At {
|
|
2014
2097
|
/**
|
|
2015
2098
|
* Creates a [Locator].
|
|
2016
2099
|
*/
|
|
@@ -2022,12 +2105,12 @@ class tt {
|
|
|
2022
2105
|
*/
|
|
2023
2106
|
static deserialize(t) {
|
|
2024
2107
|
if (t && t.href && t.type)
|
|
2025
|
-
return new
|
|
2108
|
+
return new At({
|
|
2026
2109
|
href: t.href,
|
|
2027
2110
|
type: t.type,
|
|
2028
2111
|
title: t.title,
|
|
2029
2112
|
locations: y.deserialize(t.locations),
|
|
2030
|
-
text:
|
|
2113
|
+
text: mt.deserialize(t.text)
|
|
2031
2114
|
});
|
|
2032
2115
|
}
|
|
2033
2116
|
/**
|
|
@@ -2041,7 +2124,7 @@ class tt {
|
|
|
2041
2124
|
* Shortcut to get a copy of the [Locator] with different [Locations] sub-properties.
|
|
2042
2125
|
*/
|
|
2043
2126
|
copyWithLocations(t) {
|
|
2044
|
-
return new
|
|
2127
|
+
return new At({
|
|
2045
2128
|
href: this.href,
|
|
2046
2129
|
type: this.type,
|
|
2047
2130
|
title: this.title,
|
|
@@ -2050,7 +2133,7 @@ class tt {
|
|
|
2050
2133
|
});
|
|
2051
2134
|
}
|
|
2052
2135
|
}
|
|
2053
|
-
class
|
|
2136
|
+
class ht {
|
|
2054
2137
|
/**
|
|
2055
2138
|
* Creates a [Link].
|
|
2056
2139
|
*/
|
|
@@ -2062,21 +2145,21 @@ class st {
|
|
|
2062
2145
|
*/
|
|
2063
2146
|
static deserialize(t) {
|
|
2064
2147
|
if (!(!t || typeof t.href != "string"))
|
|
2065
|
-
return new
|
|
2148
|
+
return new ht({
|
|
2066
2149
|
href: t.href,
|
|
2067
2150
|
templated: t.templated,
|
|
2068
2151
|
type: t.type,
|
|
2069
2152
|
title: t.title,
|
|
2070
2153
|
rels: t.rel ? t.rel instanceof Array ? new Set(t.rel) : /* @__PURE__ */ new Set([t.rel]) : void 0,
|
|
2071
|
-
properties:
|
|
2154
|
+
properties: V.deserialize(t.properties),
|
|
2072
2155
|
height: x(t.height),
|
|
2073
2156
|
width: x(t.width),
|
|
2074
2157
|
size: x(t.size),
|
|
2075
2158
|
duration: x(t.duration),
|
|
2076
2159
|
bitrate: x(t.bitrate),
|
|
2077
|
-
languages:
|
|
2078
|
-
alternates:
|
|
2079
|
-
children:
|
|
2160
|
+
languages: lA(t.language),
|
|
2161
|
+
alternates: Qt.deserialize(t.alternate),
|
|
2162
|
+
children: Qt.deserialize(t.children)
|
|
2080
2163
|
});
|
|
2081
2164
|
}
|
|
2082
2165
|
/**
|
|
@@ -2084,11 +2167,11 @@ class st {
|
|
|
2084
2167
|
*/
|
|
2085
2168
|
serialize() {
|
|
2086
2169
|
const t = { href: this.href };
|
|
2087
|
-
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 =
|
|
2170
|
+
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 = gi(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;
|
|
2088
2171
|
}
|
|
2089
2172
|
/** MediaType of the linked resource. */
|
|
2090
2173
|
get mediaType() {
|
|
2091
|
-
return this.type !== void 0 ?
|
|
2174
|
+
return this.type !== void 0 ? u.parse({ mediaType: this.type }) : u.BINARY;
|
|
2092
2175
|
}
|
|
2093
2176
|
/** Computes an absolute URL to the link, relative to the given `baseURL`.
|
|
2094
2177
|
* If the link's `href` is already absolute, the `baseURL` is ignored.
|
|
@@ -2108,7 +2191,7 @@ class st {
|
|
|
2108
2191
|
* See RFC 6570 on URI template: https://tools.ietf.org/html/rfc6570
|
|
2109
2192
|
*/
|
|
2110
2193
|
expandTemplate(t) {
|
|
2111
|
-
return new
|
|
2194
|
+
return new ht({
|
|
2112
2195
|
href: new Ie(this.href).expand(t),
|
|
2113
2196
|
templated: !1
|
|
2114
2197
|
});
|
|
@@ -2118,15 +2201,15 @@ class st {
|
|
|
2118
2201
|
*/
|
|
2119
2202
|
addProperties(t) {
|
|
2120
2203
|
var e;
|
|
2121
|
-
const A =
|
|
2122
|
-
return A.properties = A.properties ? (e = A.properties) == null ? void 0 : e.add(t) : new
|
|
2204
|
+
const A = ht.deserialize(this.serialize());
|
|
2205
|
+
return A.properties = A.properties ? (e = A.properties) == null ? void 0 : e.add(t) : new V(t), A;
|
|
2123
2206
|
}
|
|
2124
2207
|
/**
|
|
2125
2208
|
* Creates a [Locator] from a reading order [Link].
|
|
2126
2209
|
*/
|
|
2127
2210
|
get locator() {
|
|
2128
2211
|
let t = this.href.split("#");
|
|
2129
|
-
return new
|
|
2212
|
+
return new At({
|
|
2130
2213
|
href: t.length > 0 && t[0] !== void 0 ? t[0] : this.href,
|
|
2131
2214
|
type: this.type ?? "",
|
|
2132
2215
|
title: this.title,
|
|
@@ -2136,7 +2219,7 @@ class st {
|
|
|
2136
2219
|
});
|
|
2137
2220
|
}
|
|
2138
2221
|
}
|
|
2139
|
-
class
|
|
2222
|
+
class Qt {
|
|
2140
2223
|
/**
|
|
2141
2224
|
* Creates a [Links].
|
|
2142
2225
|
*/
|
|
@@ -2148,8 +2231,8 @@ class Ct {
|
|
|
2148
2231
|
*/
|
|
2149
2232
|
static deserialize(t) {
|
|
2150
2233
|
if (t && t instanceof Array)
|
|
2151
|
-
return new
|
|
2152
|
-
t.map((e) =>
|
|
2234
|
+
return new Qt(
|
|
2235
|
+
t.map((e) => ht.deserialize(e)).filter((e) => e !== void 0)
|
|
2153
2236
|
);
|
|
2154
2237
|
}
|
|
2155
2238
|
/**
|
|
@@ -2230,10 +2313,10 @@ class Ct {
|
|
|
2230
2313
|
return this.items.filter((t) => t.type);
|
|
2231
2314
|
}
|
|
2232
2315
|
}
|
|
2233
|
-
|
|
2316
|
+
V.prototype.getContains = function() {
|
|
2234
2317
|
return new Set(this.otherProperties.contains || []);
|
|
2235
2318
|
};
|
|
2236
|
-
class
|
|
2319
|
+
class zt {
|
|
2237
2320
|
/**
|
|
2238
2321
|
* Creates a [DomRange].
|
|
2239
2322
|
*/
|
|
@@ -2250,7 +2333,7 @@ class yt {
|
|
|
2250
2333
|
if (e === void 0)
|
|
2251
2334
|
return;
|
|
2252
2335
|
let A = x(t.charOffset);
|
|
2253
|
-
return A === void 0 && (A = x(t.offset)), new
|
|
2336
|
+
return A === void 0 && (A = x(t.offset)), new zt({
|
|
2254
2337
|
cssSelector: t.cssSelector,
|
|
2255
2338
|
textNodeIndex: e,
|
|
2256
2339
|
charOffset: A
|
|
@@ -2267,7 +2350,7 @@ class yt {
|
|
|
2267
2350
|
return this.charOffset !== void 0 && (t.charOffset = this.charOffset), t;
|
|
2268
2351
|
}
|
|
2269
2352
|
}
|
|
2270
|
-
class
|
|
2353
|
+
class ne {
|
|
2271
2354
|
/**
|
|
2272
2355
|
* Creates a [DomRange].
|
|
2273
2356
|
*/
|
|
@@ -2280,11 +2363,11 @@ class re {
|
|
|
2280
2363
|
static deserialize(t) {
|
|
2281
2364
|
if (!t)
|
|
2282
2365
|
return;
|
|
2283
|
-
let e =
|
|
2366
|
+
let e = zt.deserialize(t.start);
|
|
2284
2367
|
if (e)
|
|
2285
|
-
return new
|
|
2368
|
+
return new ne({
|
|
2286
2369
|
start: e,
|
|
2287
|
-
end:
|
|
2370
|
+
end: zt.deserialize(t.end)
|
|
2288
2371
|
});
|
|
2289
2372
|
}
|
|
2290
2373
|
/**
|
|
@@ -2305,7 +2388,7 @@ y.prototype.getPartialCfi = function() {
|
|
|
2305
2388
|
};
|
|
2306
2389
|
y.prototype.getDomRange = function() {
|
|
2307
2390
|
var i;
|
|
2308
|
-
return
|
|
2391
|
+
return ne.deserialize((i = this.otherLocations) == null ? void 0 : i.get("domRange"));
|
|
2309
2392
|
};
|
|
2310
2393
|
y.prototype.fragmentParameters = function() {
|
|
2311
2394
|
return new Map(
|
|
@@ -2343,7 +2426,7 @@ y.prototype.space = function() {
|
|
|
2343
2426
|
if (t.length === 4 && !t.some(isNaN))
|
|
2344
2427
|
return t;
|
|
2345
2428
|
};
|
|
2346
|
-
class
|
|
2429
|
+
class re {
|
|
2347
2430
|
/** Creates a [Price]. */
|
|
2348
2431
|
constructor(t) {
|
|
2349
2432
|
this.currency = t.currency, this.value = t.value;
|
|
@@ -2359,7 +2442,7 @@ class se {
|
|
|
2359
2442
|
return;
|
|
2360
2443
|
let A = x(t.value);
|
|
2361
2444
|
if (A !== void 0)
|
|
2362
|
-
return new
|
|
2445
|
+
return new re({ currency: e, value: A });
|
|
2363
2446
|
}
|
|
2364
2447
|
/**
|
|
2365
2448
|
* Serializes a [Price] to its RWPM JSON representation.
|
|
@@ -2368,7 +2451,7 @@ class se {
|
|
|
2368
2451
|
return { currency: this.currency, value: this.value };
|
|
2369
2452
|
}
|
|
2370
2453
|
}
|
|
2371
|
-
class
|
|
2454
|
+
class ft {
|
|
2372
2455
|
/** Creates a [Acquisition]. */
|
|
2373
2456
|
constructor(t) {
|
|
2374
2457
|
this.type = t.type, this.children = t.children;
|
|
@@ -2378,14 +2461,14 @@ class gt {
|
|
|
2378
2461
|
*/
|
|
2379
2462
|
static deserialize(t) {
|
|
2380
2463
|
if (t && t.type)
|
|
2381
|
-
return new
|
|
2464
|
+
return new ft({
|
|
2382
2465
|
type: t.type,
|
|
2383
|
-
children:
|
|
2466
|
+
children: ft.deserializeArray(t.children)
|
|
2384
2467
|
});
|
|
2385
2468
|
}
|
|
2386
2469
|
static deserializeArray(t) {
|
|
2387
2470
|
if (t instanceof Array)
|
|
2388
|
-
return t.map((e) =>
|
|
2471
|
+
return t.map((e) => ft.deserialize(e)).filter((e) => e !== void 0);
|
|
2389
2472
|
}
|
|
2390
2473
|
/**
|
|
2391
2474
|
* Serializes a [Acquisition] to its RWPM JSON representation.
|
|
@@ -2395,7 +2478,7 @@ class gt {
|
|
|
2395
2478
|
return this.children && (t.children = this.children.map((e) => e.serialize())), t;
|
|
2396
2479
|
}
|
|
2397
2480
|
}
|
|
2398
|
-
class
|
|
2481
|
+
class se {
|
|
2399
2482
|
/** Creates a [Price]. */
|
|
2400
2483
|
constructor(t) {
|
|
2401
2484
|
this.total = t.total, this.position = t.position;
|
|
@@ -2405,7 +2488,7 @@ class oe {
|
|
|
2405
2488
|
*/
|
|
2406
2489
|
static deserialize(t) {
|
|
2407
2490
|
if (t)
|
|
2408
|
-
return new
|
|
2491
|
+
return new se({
|
|
2409
2492
|
total: x(t.total),
|
|
2410
2493
|
position: x(t.position)
|
|
2411
2494
|
});
|
|
@@ -2418,7 +2501,7 @@ class oe {
|
|
|
2418
2501
|
return this.total !== void 0 && (t.total = this.total), this.position !== void 0 && (t.position = this.position), t;
|
|
2419
2502
|
}
|
|
2420
2503
|
}
|
|
2421
|
-
class
|
|
2504
|
+
class oe {
|
|
2422
2505
|
/** Creates a [Copies]. */
|
|
2423
2506
|
constructor(t) {
|
|
2424
2507
|
this.total = t.total, this.available = t.available;
|
|
@@ -2428,7 +2511,7 @@ class ae {
|
|
|
2428
2511
|
*/
|
|
2429
2512
|
static deserialize(t) {
|
|
2430
2513
|
if (t)
|
|
2431
|
-
return new
|
|
2514
|
+
return new oe({
|
|
2432
2515
|
total: x(t.total),
|
|
2433
2516
|
available: x(t.available)
|
|
2434
2517
|
});
|
|
@@ -2441,7 +2524,7 @@ class ae {
|
|
|
2441
2524
|
return this.total !== void 0 && (t.total = this.total), this.available !== void 0 && (t.available = this.available), t;
|
|
2442
2525
|
}
|
|
2443
2526
|
}
|
|
2444
|
-
class
|
|
2527
|
+
class ae {
|
|
2445
2528
|
/** Creates a [Availability]. */
|
|
2446
2529
|
constructor(t) {
|
|
2447
2530
|
this.state = t.state, this.since = t.since, this.until = t.until;
|
|
@@ -2451,7 +2534,7 @@ class le {
|
|
|
2451
2534
|
*/
|
|
2452
2535
|
static deserialize(t) {
|
|
2453
2536
|
if (t && t.state)
|
|
2454
|
-
return new
|
|
2537
|
+
return new ae({
|
|
2455
2538
|
state: t.state,
|
|
2456
2539
|
since: we(t.since),
|
|
2457
2540
|
until: we(t.until)
|
|
@@ -2465,51 +2548,51 @@ class le {
|
|
|
2465
2548
|
return this.since !== void 0 && (t.since = this.since.toISOString()), this.until !== void 0 && (t.until = this.until.toISOString()), t;
|
|
2466
2549
|
}
|
|
2467
2550
|
}
|
|
2468
|
-
|
|
2551
|
+
V.prototype.getNumberOfItems = function() {
|
|
2469
2552
|
return x(this.otherProperties.numberOfItems);
|
|
2470
2553
|
};
|
|
2471
|
-
|
|
2472
|
-
return
|
|
2554
|
+
V.prototype.getPrice = function() {
|
|
2555
|
+
return re.deserialize(this.otherProperties.price);
|
|
2473
2556
|
};
|
|
2474
|
-
|
|
2557
|
+
V.prototype.getIndirectAcquisitions = function() {
|
|
2475
2558
|
const i = this.otherProperties.indirectAcquisition;
|
|
2476
2559
|
if (i && i instanceof Array)
|
|
2477
|
-
return i.map((t) =>
|
|
2560
|
+
return i.map((t) => ft.deserialize(t)).filter((t) => t !== void 0);
|
|
2478
2561
|
};
|
|
2479
|
-
|
|
2480
|
-
return
|
|
2562
|
+
V.prototype.getHolds = function() {
|
|
2563
|
+
return se.deserialize(this.otherProperties.holds);
|
|
2481
2564
|
};
|
|
2482
|
-
|
|
2483
|
-
return
|
|
2565
|
+
V.prototype.getCopies = function() {
|
|
2566
|
+
return oe.deserialize(this.otherProperties.copies);
|
|
2484
2567
|
};
|
|
2485
|
-
|
|
2486
|
-
return
|
|
2568
|
+
V.prototype.getAvailability = function() {
|
|
2569
|
+
return ae.deserialize(this.otherProperties.availability);
|
|
2487
2570
|
};
|
|
2488
|
-
|
|
2489
|
-
return
|
|
2571
|
+
V.prototype.getAuthenticate = function() {
|
|
2572
|
+
return ht.deserialize(this.otherProperties.authenticate);
|
|
2490
2573
|
};
|
|
2491
|
-
var
|
|
2574
|
+
var $;
|
|
2492
2575
|
(function(i) {
|
|
2493
2576
|
i.NONE = "none", i.DESCENDANT = "descendant", i.CHILD = "child";
|
|
2494
|
-
})(
|
|
2495
|
-
var
|
|
2577
|
+
})($ || ($ = {}));
|
|
2578
|
+
var G;
|
|
2496
2579
|
(function(i) {
|
|
2497
2580
|
i.id = "id", i.class = "class", i.tag = "tag", i.attribute = "attribute", i.nthchild = "nthchild", i.nthoftype = "nthoftype";
|
|
2498
|
-
})(
|
|
2499
|
-
const
|
|
2581
|
+
})(G || (G = {}));
|
|
2582
|
+
const di = "CssSelectorGenerator";
|
|
2500
2583
|
function Fe(i = "unknown problem", ...t) {
|
|
2501
|
-
console.warn(`${
|
|
2584
|
+
console.warn(`${di}: ${i}`, ...t);
|
|
2502
2585
|
}
|
|
2503
|
-
|
|
2504
|
-
function
|
|
2586
|
+
G.id, G.class, G.tag, G.attribute;
|
|
2587
|
+
function ui(i) {
|
|
2505
2588
|
return i instanceof RegExp;
|
|
2506
2589
|
}
|
|
2507
|
-
function
|
|
2590
|
+
function mi(i) {
|
|
2508
2591
|
return i.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".+");
|
|
2509
2592
|
}
|
|
2510
|
-
function
|
|
2593
|
+
function Mi(i) {
|
|
2511
2594
|
const t = i.map((e) => {
|
|
2512
|
-
if (
|
|
2595
|
+
if (ui(e))
|
|
2513
2596
|
return (A) => e.test(A);
|
|
2514
2597
|
if (typeof e == "function")
|
|
2515
2598
|
return (A) => {
|
|
@@ -2517,48 +2600,48 @@ function di(i) {
|
|
|
2517
2600
|
return typeof n != "boolean" ? (Fe("pattern matcher function invalid", "Provided pattern matching function does not return boolean. It's result will be ignored.", e), !1) : n;
|
|
2518
2601
|
};
|
|
2519
2602
|
if (typeof e == "string") {
|
|
2520
|
-
const A = new RegExp("^" +
|
|
2603
|
+
const A = new RegExp("^" + mi(e) + "$");
|
|
2521
2604
|
return (n) => A.test(n);
|
|
2522
2605
|
}
|
|
2523
2606
|
return Fe("pattern matcher invalid", "Pattern matching only accepts strings, regular expressions and/or functions. This item is invalid and will be ignored.", e), () => !1;
|
|
2524
2607
|
});
|
|
2525
2608
|
return (e) => t.some((A) => A(e));
|
|
2526
2609
|
}
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2610
|
+
$.NONE + "", $.NONE, $.DESCENDANT + "", $.DESCENDANT, $.CHILD + "", $.CHILD;
|
|
2611
|
+
G.nthoftype, G.tag, G.id, G.class, G.attribute, G.nthchild;
|
|
2612
|
+
Mi([
|
|
2530
2613
|
"class",
|
|
2531
2614
|
"id",
|
|
2532
2615
|
// Angular attributes
|
|
2533
2616
|
"ng-*"
|
|
2534
2617
|
]);
|
|
2535
|
-
class
|
|
2618
|
+
class Pt {
|
|
2536
2619
|
}
|
|
2537
2620
|
function Ue(i) {
|
|
2538
2621
|
return i.split("").reverse().join("");
|
|
2539
2622
|
}
|
|
2540
|
-
function
|
|
2623
|
+
function fi(i, t, e) {
|
|
2541
2624
|
const A = Ue(t);
|
|
2542
2625
|
return e.map((n) => {
|
|
2543
2626
|
const r = Math.max(0, n.end - t.length - n.errors), s = Ue(i.slice(r, n.end));
|
|
2544
2627
|
return {
|
|
2545
|
-
start:
|
|
2628
|
+
start: hA(s, A, n.errors).reduce((o, a) => n.end - a.end < o ? n.end - a.end : o, n.end),
|
|
2546
2629
|
end: n.end,
|
|
2547
2630
|
errors: n.errors
|
|
2548
2631
|
};
|
|
2549
2632
|
});
|
|
2550
2633
|
}
|
|
2551
|
-
function
|
|
2634
|
+
function Jt(i) {
|
|
2552
2635
|
return (i | -i) >> 31 & 1;
|
|
2553
2636
|
}
|
|
2554
2637
|
function Ce(i, t, e, A) {
|
|
2555
2638
|
let n = i.P[e], r = i.M[e];
|
|
2556
2639
|
const s = A >>> 31, o = t[e] | s, a = o | r, l = (o & n) + n ^ n | o;
|
|
2557
2640
|
let h = r | ~(l | n), c = n & l;
|
|
2558
|
-
const g =
|
|
2559
|
-
return h <<= 1, c <<= 1, c |= s, h |=
|
|
2641
|
+
const g = Jt(h & i.lastRowMask[e]) - Jt(c & i.lastRowMask[e]);
|
|
2642
|
+
return h <<= 1, c <<= 1, c |= s, h |= Jt(A) - s, n = c | ~(a | h), r = h & a, i.P[e] = n, i.M[e] = r, g;
|
|
2560
2643
|
}
|
|
2561
|
-
function
|
|
2644
|
+
function hA(i, t, e) {
|
|
2562
2645
|
if (t.length === 0)
|
|
2563
2646
|
return [];
|
|
2564
2647
|
e = Math.min(e, t.length);
|
|
@@ -2619,11 +2702,11 @@ function aA(i, t, e) {
|
|
|
2619
2702
|
}
|
|
2620
2703
|
return A;
|
|
2621
2704
|
}
|
|
2622
|
-
function
|
|
2623
|
-
const A =
|
|
2624
|
-
return
|
|
2705
|
+
function pi(i, t, e) {
|
|
2706
|
+
const A = hA(i, t, e);
|
|
2707
|
+
return fi(i, t, A);
|
|
2625
2708
|
}
|
|
2626
|
-
function
|
|
2709
|
+
function cA(i, t, e) {
|
|
2627
2710
|
let A = 0;
|
|
2628
2711
|
const n = [];
|
|
2629
2712
|
for (; A !== -1; )
|
|
@@ -2632,15 +2715,15 @@ function lA(i, t, e) {
|
|
|
2632
2715
|
end: A + t.length,
|
|
2633
2716
|
errors: 0
|
|
2634
2717
|
}), A += 1);
|
|
2635
|
-
return n.length > 0 ? n :
|
|
2718
|
+
return n.length > 0 ? n : pi(i, t, e);
|
|
2636
2719
|
}
|
|
2637
2720
|
function ye(i, t) {
|
|
2638
|
-
return t.length === 0 || i.length === 0 ? 0 : 1 -
|
|
2721
|
+
return t.length === 0 || i.length === 0 ? 0 : 1 - cA(i, t, t.length)[0].errors / t.length;
|
|
2639
2722
|
}
|
|
2640
|
-
function
|
|
2723
|
+
function Bi(i, t, e = {}) {
|
|
2641
2724
|
if (t.length === 0)
|
|
2642
2725
|
return null;
|
|
2643
|
-
const A = Math.min(256, t.length / 2), n =
|
|
2726
|
+
const A = Math.min(256, t.length / 2), n = cA(i, t, A);
|
|
2644
2727
|
if (n.length === 0)
|
|
2645
2728
|
return null;
|
|
2646
2729
|
const r = (o) => {
|
|
@@ -2697,7 +2780,7 @@ function Re(i, t) {
|
|
|
2697
2780
|
return { node: r, offset: s };
|
|
2698
2781
|
throw new RangeError("No text nodes with non-whitespace text found in range");
|
|
2699
2782
|
}
|
|
2700
|
-
function
|
|
2783
|
+
function Ei(i) {
|
|
2701
2784
|
if (!i.toString().trim().length)
|
|
2702
2785
|
throw new RangeError("Range contains no non-whitespace text");
|
|
2703
2786
|
if (i.startContainer.nodeType !== Node.TEXT_NODE)
|
|
@@ -2740,7 +2823,7 @@ function fi(i) {
|
|
|
2740
2823
|
}
|
|
2741
2824
|
return t;
|
|
2742
2825
|
}
|
|
2743
|
-
function
|
|
2826
|
+
function gA(i) {
|
|
2744
2827
|
var t;
|
|
2745
2828
|
switch (i.nodeType) {
|
|
2746
2829
|
case Node.ELEMENT_NODE:
|
|
@@ -2753,10 +2836,10 @@ function hA(i) {
|
|
|
2753
2836
|
function Qe(i) {
|
|
2754
2837
|
let t = i.previousSibling, e = 0;
|
|
2755
2838
|
for (; t; )
|
|
2756
|
-
e +=
|
|
2839
|
+
e += gA(t), t = t.previousSibling;
|
|
2757
2840
|
return e;
|
|
2758
2841
|
}
|
|
2759
|
-
function
|
|
2842
|
+
function dA(i, ...t) {
|
|
2760
2843
|
let e = t.shift();
|
|
2761
2844
|
const A = i.ownerDocument.createNodeIterator(
|
|
2762
2845
|
i,
|
|
@@ -2810,7 +2893,7 @@ class L {
|
|
|
2810
2893
|
*/
|
|
2811
2894
|
resolve(t = {}) {
|
|
2812
2895
|
try {
|
|
2813
|
-
return
|
|
2896
|
+
return dA(this.element, this.offset)[0];
|
|
2814
2897
|
} catch (e) {
|
|
2815
2898
|
if (this.offset === 0 && t.direction !== void 0) {
|
|
2816
2899
|
const A = document.createTreeWalker(
|
|
@@ -2861,7 +2944,7 @@ class L {
|
|
|
2861
2944
|
throw new Error("Child node offset is out of range");
|
|
2862
2945
|
let A = 0;
|
|
2863
2946
|
for (let n = 0; n < e; n++)
|
|
2864
|
-
A +=
|
|
2947
|
+
A += gA(t.childNodes[n]);
|
|
2865
2948
|
return new L(t, A);
|
|
2866
2949
|
}
|
|
2867
2950
|
default:
|
|
@@ -2869,7 +2952,7 @@ class L {
|
|
|
2869
2952
|
}
|
|
2870
2953
|
}
|
|
2871
2954
|
}
|
|
2872
|
-
class
|
|
2955
|
+
class tt {
|
|
2873
2956
|
constructor(t, e) {
|
|
2874
2957
|
this.start = t, this.end = e;
|
|
2875
2958
|
}
|
|
@@ -2879,7 +2962,7 @@ class _ {
|
|
|
2879
2962
|
* `end.element`.
|
|
2880
2963
|
*/
|
|
2881
2964
|
relativeTo(t) {
|
|
2882
|
-
return new
|
|
2965
|
+
return new tt(
|
|
2883
2966
|
this.start.relativeTo(t),
|
|
2884
2967
|
this.end.relativeTo(t)
|
|
2885
2968
|
);
|
|
@@ -2895,7 +2978,7 @@ class _ {
|
|
|
2895
2978
|
*/
|
|
2896
2979
|
toRange() {
|
|
2897
2980
|
let t, e;
|
|
2898
|
-
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] =
|
|
2981
|
+
this.start.element === this.end.element && this.start.offset <= this.end.offset ? [t, e] = dA(
|
|
2899
2982
|
this.start.element,
|
|
2900
2983
|
this.start.offset,
|
|
2901
2984
|
this.end.offset
|
|
@@ -2917,14 +3000,14 @@ class _ {
|
|
|
2917
3000
|
t.startContainer,
|
|
2918
3001
|
t.startOffset
|
|
2919
3002
|
), A = L.fromPoint(t.endContainer, t.endOffset);
|
|
2920
|
-
return new
|
|
3003
|
+
return new tt(e, A);
|
|
2921
3004
|
}
|
|
2922
3005
|
/**
|
|
2923
3006
|
* Create a TextRange representing the `start`th to `end`th characters in
|
|
2924
3007
|
* `root`
|
|
2925
3008
|
*/
|
|
2926
3009
|
static fromOffsets(t, e, A) {
|
|
2927
|
-
return new
|
|
3010
|
+
return new tt(
|
|
2928
3011
|
new L(t, e),
|
|
2929
3012
|
new L(t, A)
|
|
2930
3013
|
);
|
|
@@ -2934,23 +3017,23 @@ class _ {
|
|
|
2934
3017
|
* whitespace
|
|
2935
3018
|
*/
|
|
2936
3019
|
static trimmedRange(t) {
|
|
2937
|
-
return
|
|
3020
|
+
return Ei(tt.fromRange(t).toRange());
|
|
2938
3021
|
}
|
|
2939
3022
|
}
|
|
2940
|
-
class
|
|
3023
|
+
class Yt {
|
|
2941
3024
|
constructor(t, e, A) {
|
|
2942
3025
|
this.root = t, this.start = e, this.end = A;
|
|
2943
3026
|
}
|
|
2944
3027
|
static fromRange(t, e) {
|
|
2945
|
-
const A =
|
|
2946
|
-
return new
|
|
3028
|
+
const A = tt.fromRange(e).relativeTo(t);
|
|
3029
|
+
return new Yt(
|
|
2947
3030
|
t,
|
|
2948
3031
|
A.start.offset,
|
|
2949
3032
|
A.end.offset
|
|
2950
3033
|
);
|
|
2951
3034
|
}
|
|
2952
3035
|
static fromSelector(t, e) {
|
|
2953
|
-
return new
|
|
3036
|
+
return new Yt(t, e.start, e.end);
|
|
2954
3037
|
}
|
|
2955
3038
|
toSelector() {
|
|
2956
3039
|
return {
|
|
@@ -2960,10 +3043,10 @@ class Rt {
|
|
|
2960
3043
|
};
|
|
2961
3044
|
}
|
|
2962
3045
|
toRange() {
|
|
2963
|
-
return
|
|
3046
|
+
return tt.fromOffsets(this.root, this.start, this.end).toRange();
|
|
2964
3047
|
}
|
|
2965
3048
|
}
|
|
2966
|
-
class
|
|
3049
|
+
class Nt {
|
|
2967
3050
|
/**
|
|
2968
3051
|
* @param root - A root element from which to anchor.
|
|
2969
3052
|
*/
|
|
@@ -2976,15 +3059,15 @@ class Qt {
|
|
|
2976
3059
|
* Will throw if `range` does not contain any text nodes.
|
|
2977
3060
|
*/
|
|
2978
3061
|
static fromRange(t, e) {
|
|
2979
|
-
const A = t.textContent, n =
|
|
2980
|
-
return new
|
|
3062
|
+
const A = t.textContent, n = tt.fromRange(e).relativeTo(t), r = n.start.offset, s = n.end.offset, o = 32;
|
|
3063
|
+
return new Nt(t, A.slice(r, s), {
|
|
2981
3064
|
prefix: A.slice(Math.max(0, r - o), r),
|
|
2982
3065
|
suffix: A.slice(s, Math.min(A.length, s + o))
|
|
2983
3066
|
});
|
|
2984
3067
|
}
|
|
2985
3068
|
static fromSelector(t, e) {
|
|
2986
3069
|
const { prefix: A, suffix: n } = e;
|
|
2987
|
-
return new
|
|
3070
|
+
return new Nt(t, e.exact, { prefix: A, suffix: n });
|
|
2988
3071
|
}
|
|
2989
3072
|
toSelector() {
|
|
2990
3073
|
return {
|
|
@@ -2998,26 +3081,26 @@ class Qt {
|
|
|
2998
3081
|
return this.toPositionAnchor(t).toRange();
|
|
2999
3082
|
}
|
|
3000
3083
|
toPositionAnchor(t = {}) {
|
|
3001
|
-
const e = this.root.textContent, A =
|
|
3084
|
+
const e = this.root.textContent, A = Bi(e, this.exact, {
|
|
3002
3085
|
...this.context,
|
|
3003
3086
|
hint: t.hint
|
|
3004
3087
|
});
|
|
3005
3088
|
if (!A)
|
|
3006
3089
|
throw new Error("Quote not found");
|
|
3007
|
-
return new
|
|
3090
|
+
return new Yt(this.root, A.start, A.end);
|
|
3008
3091
|
}
|
|
3009
3092
|
}
|
|
3010
|
-
function
|
|
3093
|
+
function wi(i) {
|
|
3011
3094
|
const t = i.tagName.toUpperCase();
|
|
3012
3095
|
return t === "IMG" || t === "VIDEO" || t === "AUDIO" || t === "IFRAME" || t === "OBJECT" || t === "EMBED" || t === "CANVAS";
|
|
3013
3096
|
}
|
|
3014
|
-
function
|
|
3097
|
+
function le(i, t) {
|
|
3015
3098
|
try {
|
|
3016
3099
|
const e = t.locations, A = t.text;
|
|
3017
3100
|
if (A && A.highlight) {
|
|
3018
3101
|
let n;
|
|
3019
3102
|
e && e.getCssSelector() && (n = i.querySelector(e.getCssSelector())), n || (n = i.body);
|
|
3020
|
-
const r = new
|
|
3103
|
+
const r = new Nt(n, A.highlight, {
|
|
3021
3104
|
prefix: A.before,
|
|
3022
3105
|
suffix: A.after
|
|
3023
3106
|
});
|
|
@@ -3036,7 +3119,7 @@ function he(i, t) {
|
|
|
3036
3119
|
}
|
|
3037
3120
|
if (n) {
|
|
3038
3121
|
const r = i.createRange();
|
|
3039
|
-
return n.childNodes.length === 0 ||
|
|
3122
|
+
return n.childNodes.length === 0 || wi(n) ? (r.selectNode(n), r) : (r.setStartBefore(n), r.setEndAfter(n), r);
|
|
3040
3123
|
}
|
|
3041
3124
|
}
|
|
3042
3125
|
} catch (e) {
|
|
@@ -3044,7 +3127,7 @@ function he(i, t) {
|
|
|
3044
3127
|
}
|
|
3045
3128
|
return null;
|
|
3046
3129
|
}
|
|
3047
|
-
function
|
|
3130
|
+
function Ii(i, t) {
|
|
3048
3131
|
let e = i.getClientRects();
|
|
3049
3132
|
e.length || i.commonAncestorContainer.nodeType === Node.ELEMENT_NODE && (e = i.commonAncestorContainer.getClientRects());
|
|
3050
3133
|
const A = 1, n = [];
|
|
@@ -3057,11 +3140,11 @@ function Bi(i, t) {
|
|
|
3057
3140
|
top: l.top,
|
|
3058
3141
|
width: l.width
|
|
3059
3142
|
});
|
|
3060
|
-
const r =
|
|
3143
|
+
const r = uA(
|
|
3061
3144
|
n,
|
|
3062
3145
|
A,
|
|
3063
3146
|
t
|
|
3064
|
-
), s =
|
|
3147
|
+
), s = Ui(r, A), o = mA(s), a = 2 * 2;
|
|
3065
3148
|
for (let l = o.length - 1; l >= 0; l--) {
|
|
3066
3149
|
const h = o[l];
|
|
3067
3150
|
if (!(h.width * h.height > a))
|
|
@@ -3072,16 +3155,16 @@ function Bi(i, t) {
|
|
|
3072
3155
|
}
|
|
3073
3156
|
return o;
|
|
3074
3157
|
}
|
|
3075
|
-
function
|
|
3158
|
+
function uA(i, t, e) {
|
|
3076
3159
|
for (let A = 0; A < i.length; A++)
|
|
3077
3160
|
for (let n = A + 1; n < i.length; n++) {
|
|
3078
3161
|
const r = i[A], s = i[n];
|
|
3079
3162
|
if (r === s)
|
|
3080
3163
|
continue;
|
|
3081
|
-
const o =
|
|
3082
|
-
if ((a && !e || o && !a) &&
|
|
3083
|
-
const l = i.filter((c) => c !== r && c !== s), h =
|
|
3084
|
-
return l.push(h),
|
|
3164
|
+
const o = H(r.top, s.top, t) && H(r.bottom, s.bottom, t), a = H(r.left, s.left, t) && H(r.right, s.right, t);
|
|
3165
|
+
if ((a && !e || o && !a) && MA(r, s, t)) {
|
|
3166
|
+
const l = i.filter((c) => c !== r && c !== s), h = Fi(r, s);
|
|
3167
|
+
return l.push(h), uA(
|
|
3085
3168
|
l,
|
|
3086
3169
|
t,
|
|
3087
3170
|
e
|
|
@@ -3090,7 +3173,7 @@ function gA(i, t, e) {
|
|
|
3090
3173
|
}
|
|
3091
3174
|
return i;
|
|
3092
3175
|
}
|
|
3093
|
-
function
|
|
3176
|
+
function Fi(i, t) {
|
|
3094
3177
|
const e = Math.min(i.left, t.left), A = Math.max(i.right, t.right), n = Math.min(i.top, t.top), r = Math.max(i.bottom, t.bottom);
|
|
3095
3178
|
return {
|
|
3096
3179
|
bottom: r,
|
|
@@ -3101,7 +3184,7 @@ function Ei(i, t) {
|
|
|
3101
3184
|
width: A - e
|
|
3102
3185
|
};
|
|
3103
3186
|
}
|
|
3104
|
-
function
|
|
3187
|
+
function Ui(i, t) {
|
|
3105
3188
|
const e = new Set(i);
|
|
3106
3189
|
for (const A of i) {
|
|
3107
3190
|
if (!(A.width > 1 && A.height > 1)) {
|
|
@@ -3109,24 +3192,24 @@ function wi(i, t) {
|
|
|
3109
3192
|
continue;
|
|
3110
3193
|
}
|
|
3111
3194
|
for (const n of i)
|
|
3112
|
-
if (A !== n && e.has(n) &&
|
|
3195
|
+
if (A !== n && e.has(n) && Ci(n, A, t)) {
|
|
3113
3196
|
e.delete(A);
|
|
3114
3197
|
break;
|
|
3115
3198
|
}
|
|
3116
3199
|
}
|
|
3117
3200
|
return Array.from(e);
|
|
3118
3201
|
}
|
|
3119
|
-
function
|
|
3120
|
-
return
|
|
3202
|
+
function Ci(i, t, e) {
|
|
3203
|
+
return It(i, t.left, t.top, e) && It(i, t.right, t.top, e) && It(i, t.left, t.bottom, e) && It(i, t.right, t.bottom, e);
|
|
3121
3204
|
}
|
|
3122
|
-
function
|
|
3123
|
-
return (i.left < t ||
|
|
3205
|
+
function It(i, t, e, A) {
|
|
3206
|
+
return (i.left < t || H(i.left, t, A)) && (i.right > t || H(i.right, t, A)) && (i.top < e || H(i.top, e, A)) && (i.bottom > e || H(i.bottom, e, A));
|
|
3124
3207
|
}
|
|
3125
|
-
function
|
|
3208
|
+
function mA(i) {
|
|
3126
3209
|
for (let t = 0; t < i.length; t++)
|
|
3127
3210
|
for (let e = t + 1; e < i.length; e++) {
|
|
3128
3211
|
const A = i[t], n = i[e];
|
|
3129
|
-
if (A !== n &&
|
|
3212
|
+
if (A !== n && MA(A, n, -1)) {
|
|
3130
3213
|
let r = [], s;
|
|
3131
3214
|
const o = ze(A, n);
|
|
3132
3215
|
if (o.length === 1)
|
|
@@ -3136,13 +3219,13 @@ function dA(i) {
|
|
|
3136
3219
|
o.length < l.length ? (r = o, s = A) : (r = l, s = n);
|
|
3137
3220
|
}
|
|
3138
3221
|
const a = i.filter((l) => l !== s);
|
|
3139
|
-
return Array.prototype.push.apply(a, r),
|
|
3222
|
+
return Array.prototype.push.apply(a, r), mA(a);
|
|
3140
3223
|
}
|
|
3141
3224
|
}
|
|
3142
3225
|
return i;
|
|
3143
3226
|
}
|
|
3144
3227
|
function ze(i, t) {
|
|
3145
|
-
const e =
|
|
3228
|
+
const e = yi(t, i);
|
|
3146
3229
|
if (e.height === 0 || e.width === 0)
|
|
3147
3230
|
return [i];
|
|
3148
3231
|
const A = [];
|
|
@@ -3192,7 +3275,7 @@ function ze(i, t) {
|
|
|
3192
3275
|
}
|
|
3193
3276
|
return A;
|
|
3194
3277
|
}
|
|
3195
|
-
function
|
|
3278
|
+
function yi(i, t) {
|
|
3196
3279
|
const e = Math.max(i.left, t.left), A = Math.min(i.right, t.right), n = Math.max(i.top, t.top), r = Math.min(i.bottom, t.bottom);
|
|
3197
3280
|
return {
|
|
3198
3281
|
bottom: r,
|
|
@@ -3203,36 +3286,36 @@ function Fi(i, t) {
|
|
|
3203
3286
|
width: Math.max(0, A - e)
|
|
3204
3287
|
};
|
|
3205
3288
|
}
|
|
3206
|
-
function
|
|
3207
|
-
return (i.left < t.right || e >= 0 &&
|
|
3289
|
+
function MA(i, t, e) {
|
|
3290
|
+
return (i.left < t.right || e >= 0 && H(i.left, t.right, e)) && (t.left < i.right || e >= 0 && H(t.left, i.right, e)) && (i.top < t.bottom || e >= 0 && H(i.top, t.bottom, e)) && (t.top < i.bottom || e >= 0 && H(t.top, i.bottom, e));
|
|
3208
3291
|
}
|
|
3209
|
-
function
|
|
3292
|
+
function H(i, t, e) {
|
|
3210
3293
|
return Math.abs(i - t) <= e;
|
|
3211
3294
|
}
|
|
3212
|
-
function
|
|
3295
|
+
function fA(i) {
|
|
3213
3296
|
const t = {}, e = i.document.documentElement.style;
|
|
3214
3297
|
for (const A in i.document.documentElement.style)
|
|
3215
3298
|
Object.hasOwn(e, A) && !Number.isNaN(Number.parseInt(A)) && (t[e[A]] = e.getPropertyValue(e[A]));
|
|
3216
3299
|
return t;
|
|
3217
3300
|
}
|
|
3218
|
-
function
|
|
3219
|
-
const e =
|
|
3301
|
+
function Ri(i, t) {
|
|
3302
|
+
const e = fA(i);
|
|
3220
3303
|
Object.keys(e).forEach((A) => {
|
|
3221
|
-
t.hasOwnProperty(A) ||
|
|
3304
|
+
t.hasOwnProperty(A) || he(i, A);
|
|
3222
3305
|
}), Object.entries(t).forEach(([A, n]) => {
|
|
3223
|
-
e[A] !== n &&
|
|
3306
|
+
e[A] !== n && St(i, A, n);
|
|
3224
3307
|
});
|
|
3225
3308
|
}
|
|
3226
3309
|
function Ye(i, t) {
|
|
3227
3310
|
return i.document.documentElement.style.getPropertyValue(t);
|
|
3228
3311
|
}
|
|
3229
|
-
function
|
|
3312
|
+
function St(i, t, e) {
|
|
3230
3313
|
i.document.documentElement.style.setProperty(t, e);
|
|
3231
3314
|
}
|
|
3232
|
-
function
|
|
3315
|
+
function he(i, t) {
|
|
3233
3316
|
i.document.documentElement.style.removeProperty(t);
|
|
3234
3317
|
}
|
|
3235
|
-
const
|
|
3318
|
+
const Qi = (i) => {
|
|
3236
3319
|
if (i.startsWith("rgb")) {
|
|
3237
3320
|
const t = i.match(/rgb\((\d+),\s(\d+),\s(\d+)(?:,\s(\d+))?\)/);
|
|
3238
3321
|
if (t)
|
|
@@ -3260,18 +3343,18 @@ const Ci = (i) => {
|
|
|
3260
3343
|
};
|
|
3261
3344
|
}
|
|
3262
3345
|
return { r: 0, g: 0, b: 0, a: 1 };
|
|
3263
|
-
},
|
|
3264
|
-
const t =
|
|
3265
|
-
return
|
|
3266
|
-
},
|
|
3267
|
-
class
|
|
3346
|
+
}, zi = (i) => 0.2126 * i.r * i.a + 0.7152 * i.g * i.a + 0.0722 * i.b * i.a, Yi = (i) => {
|
|
3347
|
+
const t = Qi(i);
|
|
3348
|
+
return zi(t) < 128;
|
|
3349
|
+
}, Ni = () => "Highlight" in window, Ne = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
3350
|
+
class Si {
|
|
3268
3351
|
/**
|
|
3269
3352
|
* Creates a DecorationGroup object
|
|
3270
3353
|
* @param id Unique HTML ID-adhering name of the group
|
|
3271
3354
|
* @param name Human-readable name of the group
|
|
3272
3355
|
*/
|
|
3273
3356
|
constructor(t, e, A, n) {
|
|
3274
|
-
this.wnd = t, this.comms = e, this.id = A, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0,
|
|
3357
|
+
this.wnd = t, this.comms = e, this.id = A, this.name = n, this.items = [], this.lastItemId = 0, this.container = void 0, this.activateable = !1, this.experimentalHighlights = !1, this.currentRender = 0, Ni() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map());
|
|
3275
3358
|
}
|
|
3276
3359
|
get activeable() {
|
|
3277
3360
|
return this.activateable;
|
|
@@ -3285,7 +3368,7 @@ class zi {
|
|
|
3285
3368
|
*/
|
|
3286
3369
|
add(t) {
|
|
3287
3370
|
var e, A, n, r;
|
|
3288
|
-
const s = `${this.id}-${this.lastItemId++}`, o =
|
|
3371
|
+
const s = `${this.id}-${this.lastItemId++}`, o = le(this.wnd.document, t.locator);
|
|
3289
3372
|
if (!o) {
|
|
3290
3373
|
this.comms.log("Can't locate DOM range for decoration", t);
|
|
3291
3374
|
return;
|
|
@@ -3359,23 +3442,23 @@ class zi {
|
|
|
3359
3442
|
getComputedStyle(this.wnd.document.documentElement).getPropertyValue(
|
|
3360
3443
|
"column-count"
|
|
3361
3444
|
)
|
|
3362
|
-
), h = a / (l || 1), c = this.wnd.document.scrollingElement, g = c.scrollLeft, m = c.scrollTop, M = (E, I,
|
|
3363
|
-
var Mt,
|
|
3364
|
-
if (E.style.position = "absolute", ((
|
|
3445
|
+
), h = a / (l || 1), c = this.wnd.document.scrollingElement, g = c.scrollLeft, m = c.scrollTop, M = (E, I, D) => {
|
|
3446
|
+
var wt, Mt, ce, ge, de, ue;
|
|
3447
|
+
if (E.style.position = "absolute", ((Mt = (wt = t.decoration) == null ? void 0 : wt.style) == null ? void 0 : Mt.width) === "viewport") {
|
|
3365
3448
|
E.style.width = `${a}px`, E.style.height = `${I.height}px`;
|
|
3366
|
-
let
|
|
3367
|
-
E.style.left = `${
|
|
3368
|
-
} else if (((
|
|
3369
|
-
E.style.width = `${
|
|
3370
|
-
else if (((
|
|
3449
|
+
let bt = Math.floor(I.left / a) * a;
|
|
3450
|
+
E.style.left = `${bt + g}px`, E.style.top = `${I.top + m}px`;
|
|
3451
|
+
} else if (((ge = (ce = t.decoration) == null ? void 0 : ce.style) == null ? void 0 : ge.width) === "bounds")
|
|
3452
|
+
E.style.width = `${D.width}px`, E.style.height = `${I.height}px`, E.style.left = `${D.left + g}px`, E.style.top = `${I.top + m}px`;
|
|
3453
|
+
else if (((ue = (de = t.decoration) == null ? void 0 : de.style) == null ? void 0 : ue.width) === "page") {
|
|
3371
3454
|
E.style.width = `${h}px`, E.style.height = `${I.height}px`;
|
|
3372
|
-
let
|
|
3373
|
-
E.style.left = `${
|
|
3455
|
+
let bt = Math.floor(I.left / h) * h;
|
|
3456
|
+
E.style.left = `${bt + g}px`, E.style.top = `${I.top + m}px`;
|
|
3374
3457
|
} else
|
|
3375
3458
|
E.style.width = `${I.width}px`, E.style.height = `${I.height}px`, E.style.left = `${I.left + g}px`, E.style.top = `${I.top + m}px`;
|
|
3376
3459
|
}, B = t.range.getBoundingClientRect();
|
|
3377
3460
|
let f = this.wnd.document.createElement("template");
|
|
3378
|
-
const w = Ye(this.wnd, "--USER__appearance") === "readium-night-on" ||
|
|
3461
|
+
const w = Ye(this.wnd, "--USER__appearance") === "readium-night-on" || Yi(Ye(this.wnd, "--USER__backgroundColor"));
|
|
3379
3462
|
f.innerHTML = `
|
|
3380
3463
|
<div
|
|
3381
3464
|
class="r2-highlight-0"
|
|
@@ -3394,15 +3477,15 @@ class zi {
|
|
|
3394
3477
|
const E = U.cloneNode(!0);
|
|
3395
3478
|
E.style.setProperty("pointer-events", "none"), M(E, B, B), o.append(E);
|
|
3396
3479
|
} else {
|
|
3397
|
-
let E =
|
|
3480
|
+
let E = Ii(
|
|
3398
3481
|
t.range,
|
|
3399
3482
|
!0
|
|
3400
3483
|
// doNotMergeHorizontallyAlignedRects
|
|
3401
3484
|
);
|
|
3402
|
-
E = E.sort((I,
|
|
3485
|
+
E = E.sort((I, D) => I.top < D.top ? -1 : I.top > D.top ? 1 : 0);
|
|
3403
3486
|
for (let I of E) {
|
|
3404
|
-
const
|
|
3405
|
-
|
|
3487
|
+
const D = U.cloneNode(!0);
|
|
3488
|
+
D.style.setProperty("pointer-events", "none"), M(D, I, B), o.append(D);
|
|
3406
3489
|
}
|
|
3407
3490
|
}
|
|
3408
3491
|
t.container = o, t.clickableElements = Array.from(
|
|
@@ -3437,7 +3520,7 @@ class zi {
|
|
|
3437
3520
|
this.experimentalHighlights && this.wnd.CSS.highlights.delete(this.id), this.container && (this.container.remove(), this.container = void 0);
|
|
3438
3521
|
}
|
|
3439
3522
|
}
|
|
3440
|
-
const
|
|
3523
|
+
const pA = class Zt extends Pt {
|
|
3441
3524
|
constructor() {
|
|
3442
3525
|
super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
|
|
3443
3526
|
}
|
|
@@ -3454,7 +3537,7 @@ const MA = class Zt extends jt {
|
|
|
3454
3537
|
mount(t, e) {
|
|
3455
3538
|
return this.wnd = t, e.register("decorate", Zt.moduleName, (A, n) => {
|
|
3456
3539
|
const r = A;
|
|
3457
|
-
r.decoration && r.decoration.locator && (r.decoration.locator =
|
|
3540
|
+
r.decoration && r.decoration.locator && (r.decoration.locator = At.deserialize(r.decoration.locator)), this.groups.has(r.group) || this.groups.set(r.group, new Si(
|
|
3458
3541
|
t,
|
|
3459
3542
|
e,
|
|
3460
3543
|
`readium-decoration-${this.lastGroupId++}`,
|
|
@@ -3482,9 +3565,9 @@ const MA = class Zt extends jt {
|
|
|
3482
3565
|
return t.removeEventListener("orientationchange", this.handleResizer), t.removeEventListener("resize", this.handleResizer), e.unregisterAll(Zt.moduleName), this.resizeObserver.disconnect(), this.cleanup(), e.log("Decorator Unmounted"), !0;
|
|
3483
3566
|
}
|
|
3484
3567
|
};
|
|
3485
|
-
|
|
3486
|
-
let
|
|
3487
|
-
const Se = "readium-snapper-style",
|
|
3568
|
+
pA.moduleName = "decorator";
|
|
3569
|
+
let xi = pA;
|
|
3570
|
+
const Se = "readium-snapper-style", BA = class Kt extends Pt {
|
|
3488
3571
|
constructor() {
|
|
3489
3572
|
super(...arguments), this.protected = !1;
|
|
3490
3573
|
}
|
|
@@ -3508,24 +3591,24 @@ const Se = "readium-snapper-style", fA = class Kt extends jt {
|
|
|
3508
3591
|
return (A = t.document.getElementById(Se)) == null || A.remove(), e.log("Snapper Unmounted"), !0;
|
|
3509
3592
|
}
|
|
3510
3593
|
};
|
|
3511
|
-
|
|
3512
|
-
let
|
|
3513
|
-
function
|
|
3594
|
+
BA.moduleName = "snapper";
|
|
3595
|
+
let EA = BA;
|
|
3596
|
+
function it(i) {
|
|
3514
3597
|
return i.document.body.dir.toLowerCase() === "rtl";
|
|
3515
3598
|
}
|
|
3516
|
-
function
|
|
3599
|
+
function wA(i) {
|
|
3517
3600
|
return parseInt(
|
|
3518
3601
|
i.getComputedStyle(
|
|
3519
3602
|
i.document.documentElement
|
|
3520
3603
|
).getPropertyValue("column-count")
|
|
3521
3604
|
);
|
|
3522
3605
|
}
|
|
3523
|
-
function
|
|
3606
|
+
function Ti(i) {
|
|
3524
3607
|
const t = getComputedStyle(i), e = parseFloat(t.paddingTop || "0"), A = parseFloat(t.paddingBottom || "0");
|
|
3525
3608
|
return i.clientHeight - e - A;
|
|
3526
3609
|
}
|
|
3527
3610
|
function xe(i) {
|
|
3528
|
-
const t =
|
|
3611
|
+
const t = wA(i);
|
|
3529
3612
|
if (!t)
|
|
3530
3613
|
return !1;
|
|
3531
3614
|
const e = i.document.querySelectorAll("div[id^='readium-virtual-page']");
|
|
@@ -3535,22 +3618,22 @@ function xe(i) {
|
|
|
3535
3618
|
if (o > 0)
|
|
3536
3619
|
for (let a = 0; a < o; a++) {
|
|
3537
3620
|
const l = i.document.createElement("div");
|
|
3538
|
-
l.setAttribute("id", `readium-virtual-page-${a}`), l.dataset.readium = "true", CSS.supports("break-before", "column") ? l.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (l.style.breakInside = "avoid-column"), l.style.height =
|
|
3621
|
+
l.setAttribute("id", `readium-virtual-page-${a}`), l.dataset.readium = "true", CSS.supports("break-before", "column") ? l.style.breakBefore = "column" : (CSS.supports("break-inside", "avoid-column") && (l.style.breakInside = "avoid-column"), l.style.height = Ti(i.document.documentElement) + "px"), l.innerHTML = "​", i.document.body.appendChild(l);
|
|
3539
3622
|
}
|
|
3540
3623
|
return A !== o;
|
|
3541
3624
|
}
|
|
3542
|
-
function
|
|
3625
|
+
function ji(i) {
|
|
3543
3626
|
const t = i.document.createElement("style");
|
|
3544
3627
|
t.appendChild(i.document.createTextNode("*{}")), i.document.body.appendChild(t), i.document.body.removeChild(t);
|
|
3545
3628
|
}
|
|
3546
|
-
function
|
|
3629
|
+
function Vi(i) {
|
|
3547
3630
|
return i < 0.5 ? 2 * i * i : -1 + (4 - 2 * i) * i;
|
|
3548
3631
|
}
|
|
3549
3632
|
function Y(i) {
|
|
3550
3633
|
const t = i.getSelection();
|
|
3551
3634
|
t && t.removeAllRanges();
|
|
3552
3635
|
}
|
|
3553
|
-
const
|
|
3636
|
+
const Di = [
|
|
3554
3637
|
"a",
|
|
3555
3638
|
"audio",
|
|
3556
3639
|
"button",
|
|
@@ -3564,15 +3647,15 @@ const Ti = [
|
|
|
3564
3647
|
"textarea",
|
|
3565
3648
|
"video"
|
|
3566
3649
|
];
|
|
3567
|
-
function
|
|
3650
|
+
function IA(i) {
|
|
3568
3651
|
var t;
|
|
3569
|
-
return
|
|
3652
|
+
return Di.indexOf(i.nodeName.toLowerCase()) !== -1 || i.hasAttribute("contenteditable") && ((t = i.getAttribute("contenteditable")) == null ? void 0 : t.toLowerCase()) !== "false" ? i : i.parentElement ? IA(i.parentElement) : null;
|
|
3570
3653
|
}
|
|
3571
|
-
function
|
|
3572
|
-
const e =
|
|
3654
|
+
function FA(i, t) {
|
|
3655
|
+
const e = UA(i, i.document.body, t), A = i._readium_cssSelectorGenerator.getCssSelector(e, {
|
|
3573
3656
|
selectors: ["tag", "id", "class", "nthchild", "nthoftype", "attribute"]
|
|
3574
3657
|
});
|
|
3575
|
-
return new
|
|
3658
|
+
return new At({
|
|
3576
3659
|
href: "#",
|
|
3577
3660
|
type: "application/xhtml+xml",
|
|
3578
3661
|
locations: new y({
|
|
@@ -3580,20 +3663,20 @@ function wA(i, t) {
|
|
|
3580
3663
|
["cssSelector", A]
|
|
3581
3664
|
])
|
|
3582
3665
|
}),
|
|
3583
|
-
text: new
|
|
3666
|
+
text: new mt({
|
|
3584
3667
|
highlight: e.textContent || void 0
|
|
3585
3668
|
})
|
|
3586
3669
|
});
|
|
3587
3670
|
}
|
|
3588
|
-
function
|
|
3671
|
+
function UA(i, t, e) {
|
|
3589
3672
|
for (var A = 0; A < t.children.length; A++) {
|
|
3590
3673
|
const n = t.children[A];
|
|
3591
|
-
if (!
|
|
3592
|
-
return
|
|
3674
|
+
if (!bi(n) && Pi(i, n, e))
|
|
3675
|
+
return vi(i, n) ? n : UA(i, n, e);
|
|
3593
3676
|
}
|
|
3594
3677
|
return t;
|
|
3595
3678
|
}
|
|
3596
|
-
function
|
|
3679
|
+
function Pi(i, t, e) {
|
|
3597
3680
|
if (t === document.body || t === document.documentElement)
|
|
3598
3681
|
return !0;
|
|
3599
3682
|
if (!document || !document.documentElement || !document.body)
|
|
@@ -3601,11 +3684,11 @@ function ji(i, t, e) {
|
|
|
3601
3684
|
const A = t.getBoundingClientRect();
|
|
3602
3685
|
return e ? A.bottom > 0 && A.top < i.innerHeight : A.right > 0 && A.left < i.innerWidth;
|
|
3603
3686
|
}
|
|
3604
|
-
function
|
|
3687
|
+
function vi(i, t) {
|
|
3605
3688
|
const e = t.getBoundingClientRect();
|
|
3606
3689
|
return e.top >= 0 && e.left >= 0 && e.bottom <= i.innerHeight && e.right <= i.innerWidth;
|
|
3607
3690
|
}
|
|
3608
|
-
function
|
|
3691
|
+
function bi(i) {
|
|
3609
3692
|
const t = getComputedStyle(i);
|
|
3610
3693
|
if (t) {
|
|
3611
3694
|
const e = t.getPropertyValue("display");
|
|
@@ -3614,7 +3697,7 @@ function Di(i) {
|
|
|
3614
3697
|
}
|
|
3615
3698
|
return !1;
|
|
3616
3699
|
}
|
|
3617
|
-
const Te = "readium-column-snapper-style",
|
|
3700
|
+
const Te = "readium-column-snapper-style", Gi = 200, CA = class P extends EA {
|
|
3618
3701
|
constructor() {
|
|
3619
3702
|
super(...arguments), this.shakeTimeout = 0, this.snappingCancelled = !1, this.alreadyScrollLeft = 0, this.overscroll = 0, this.cachedScrollWidth = 0, this.touchState = 0, this.startingX = void 0, this.endingX = void 0, this.onTouchStarter = this.onTouchStart.bind(this), this.onTouchEnder = this.onTouchEnd.bind(this), this.onWidthChanger = this.onWidthChange.bind(this), this.onTouchMover = this.onTouchMove.bind(this);
|
|
3620
3703
|
}
|
|
@@ -3625,7 +3708,7 @@ const Te = "readium-column-snapper-style", Pi = 200, FA = class D extends pA {
|
|
|
3625
3708
|
return this.doc().scrollLeft > 0 ? this.doc().scrollLeft : this.alreadyScrollLeft;
|
|
3626
3709
|
}
|
|
3627
3710
|
snapOffset(t) {
|
|
3628
|
-
const e = t + (
|
|
3711
|
+
const e = t + (it(this.wnd) ? -1 : 1);
|
|
3629
3712
|
return e - e % this.wnd.innerWidth;
|
|
3630
3713
|
}
|
|
3631
3714
|
reportProgress() {
|
|
@@ -3639,7 +3722,7 @@ const Te = "readium-column-snapper-style", Pi = 200, FA = class D extends pA {
|
|
|
3639
3722
|
if (this.overscroll !== 0 || this.shakeTimeout !== 0)
|
|
3640
3723
|
return;
|
|
3641
3724
|
const t = this.doc();
|
|
3642
|
-
t.classList.add(
|
|
3725
|
+
t.classList.add(it(this.wnd) ? "readium-bounce-l" : "readium-bounce-r");
|
|
3643
3726
|
const e = this.scrollOffset();
|
|
3644
3727
|
this.shakeTimeout = this.wnd.setTimeout(() => {
|
|
3645
3728
|
t.classList.remove("readium-bounce-l"), t.classList.remove("readium-bounce-r"), this.shakeTimeout = 0, this.doc().scrollLeft = e;
|
|
@@ -3654,15 +3737,15 @@ const Te = "readium-column-snapper-style", Pi = 200, FA = class D extends pA {
|
|
|
3654
3737
|
}
|
|
3655
3738
|
// Snaps the current offset to the page width.
|
|
3656
3739
|
snapCurrentOffset(t = !1, e = !1) {
|
|
3657
|
-
const A = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), s =
|
|
3740
|
+
const A = this.wnd.scrollX > 0 ? this.wnd.scrollX : this.alreadyScrollLeft, n = this.doc(), r = this.dragOffset(), s = wA(this.wnd), o = Math.min(Math.max(0, A), this.cachedScrollWidth), a = it(this.wnd) ? -1 : 1, l = (
|
|
3658
3741
|
// The hurdle to overcome in order to change pages
|
|
3659
3742
|
a * (this.wnd.innerWidth / 3) * (a * r > 0 ? 2 : 1)
|
|
3660
3743
|
), h = this.snapOffset(o + l);
|
|
3661
3744
|
if (t && h !== this.scrollOffset()) {
|
|
3662
3745
|
this.snappingCancelled = !1;
|
|
3663
|
-
const c = (B, f, w, U) => w > U ? f : B + (f - B) *
|
|
3746
|
+
const c = (B, f, w, U) => w > U ? f : B + (f - B) * Vi(w / U), g = (
|
|
3664
3747
|
/*Math.abs(startX - (this.useTransform ? currentOffset : 0)) < 10 ? 1 : */
|
|
3665
|
-
|
|
3748
|
+
Gi * s
|
|
3666
3749
|
);
|
|
3667
3750
|
let m;
|
|
3668
3751
|
const M = (B) => {
|
|
@@ -3772,7 +3855,7 @@ const Te = "readium-column-snapper-style", Pi = 200, FA = class D extends pA {
|
|
|
3772
3855
|
const s = this.doc().scrollLeft;
|
|
3773
3856
|
return this.doc().scrollLeft = this.snapOffset(r), s !== this.doc().scrollLeft;
|
|
3774
3857
|
};
|
|
3775
|
-
return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression",
|
|
3858
|
+
return t.addEventListener("orientationchange", this.onWidthChanger), t.addEventListener("resize", this.onWidthChanger), t.requestAnimationFrame(() => this.cachedScrollWidth = this.doc().scrollWidth), e.register("go_progression", P.moduleName, (r, s) => {
|
|
3776
3859
|
const o = r;
|
|
3777
3860
|
if (o < 0 || o > 1) {
|
|
3778
3861
|
e.send("error", {
|
|
@@ -3782,10 +3865,10 @@ const Te = "readium-column-snapper-style", Pi = 200, FA = class D extends pA {
|
|
|
3782
3865
|
}
|
|
3783
3866
|
this.wnd.requestAnimationFrame(() => {
|
|
3784
3867
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
3785
|
-
const a = this.cachedScrollWidth, l =
|
|
3868
|
+
const a = this.cachedScrollWidth, l = it(t) ? -1 : 1, h = a * o * l;
|
|
3786
3869
|
this.doc().scrollLeft = this.snapOffset(h), this.reportProgress(), Y(this.wnd), s(!0);
|
|
3787
3870
|
});
|
|
3788
|
-
}), e.register("go_id",
|
|
3871
|
+
}), e.register("go_id", P.moduleName, (r, s) => {
|
|
3789
3872
|
const o = t.document.getElementById(r);
|
|
3790
3873
|
if (!o) {
|
|
3791
3874
|
s(!1);
|
|
@@ -3794,10 +3877,10 @@ const Te = "readium-column-snapper-style", Pi = 200, FA = class D extends pA {
|
|
|
3794
3877
|
this.wnd.requestAnimationFrame(() => {
|
|
3795
3878
|
this.doc().scrollLeft = this.snapOffset(o.getBoundingClientRect().left + t.scrollX), this.reportProgress(), Y(this.wnd), s(!0);
|
|
3796
3879
|
});
|
|
3797
|
-
}), e.register("go_text",
|
|
3880
|
+
}), e.register("go_text", P.moduleName, (r, s) => {
|
|
3798
3881
|
let o;
|
|
3799
3882
|
Array.isArray(r) && (r.length > 1 && (o = r[1]), r = r[0]);
|
|
3800
|
-
const a =
|
|
3883
|
+
const a = mt.deserialize(r), l = le(this.wnd.document, new At({
|
|
3801
3884
|
href: t.location.href,
|
|
3802
3885
|
type: "text/html",
|
|
3803
3886
|
text: a,
|
|
@@ -3814,8 +3897,8 @@ const Te = "readium-column-snapper-style", Pi = 200, FA = class D extends pA {
|
|
|
3814
3897
|
this.wnd.requestAnimationFrame(() => {
|
|
3815
3898
|
this.doc().scrollLeft = this.snapOffset(l.getBoundingClientRect().left + t.scrollX), this.reportProgress(), Y(this.wnd), s(!0);
|
|
3816
3899
|
});
|
|
3817
|
-
}), e.register("go_end",
|
|
3818
|
-
const o =
|
|
3900
|
+
}), e.register("go_end", P.moduleName, (r, s) => {
|
|
3901
|
+
const o = it(t) ? -1 : 1;
|
|
3819
3902
|
this.wnd.requestAnimationFrame(() => {
|
|
3820
3903
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
3821
3904
|
const a = this.cachedScrollWidth * o;
|
|
@@ -3823,46 +3906,46 @@ const Te = "readium-column-snapper-style", Pi = 200, FA = class D extends pA {
|
|
|
3823
3906
|
return s(!1);
|
|
3824
3907
|
this.doc().scrollLeft = this.snapOffset(a), this.reportProgress(), Y(this.wnd), s(!0);
|
|
3825
3908
|
});
|
|
3826
|
-
}), e.register("go_start",
|
|
3909
|
+
}), e.register("go_start", P.moduleName, (r, s) => {
|
|
3827
3910
|
this.wnd.requestAnimationFrame(() => {
|
|
3828
3911
|
if (this.doc().scrollLeft === 0)
|
|
3829
3912
|
return s(!1);
|
|
3830
3913
|
this.doc().scrollLeft = 0, this.reportProgress(), Y(this.wnd), s(!0);
|
|
3831
3914
|
});
|
|
3832
|
-
}), e.register("go_prev",
|
|
3915
|
+
}), e.register("go_prev", P.moduleName, (r, s) => {
|
|
3833
3916
|
this.wnd.requestAnimationFrame(() => {
|
|
3834
3917
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
3835
|
-
const o = t.scrollX - t.innerWidth, a =
|
|
3918
|
+
const o = t.scrollX - t.innerWidth, a = it(t) ? -(this.cachedScrollWidth - t.innerWidth) : 0, l = n(Math.max(o, a));
|
|
3836
3919
|
l && (this.reportProgress(), Y(this.wnd)), s(l);
|
|
3837
3920
|
});
|
|
3838
|
-
}), e.register("go_next",
|
|
3921
|
+
}), e.register("go_next", P.moduleName, (r, s) => {
|
|
3839
3922
|
this.wnd.requestAnimationFrame(() => {
|
|
3840
3923
|
this.cachedScrollWidth = this.doc().scrollWidth;
|
|
3841
|
-
const o = t.scrollX + t.innerWidth, a =
|
|
3924
|
+
const o = t.scrollX + t.innerWidth, a = it(t) ? 0 : this.cachedScrollWidth - t.innerWidth, l = n(Math.min(o, a));
|
|
3842
3925
|
l && (this.reportProgress(), Y(this.wnd)), s(l);
|
|
3843
3926
|
});
|
|
3844
|
-
}), e.register("unfocus",
|
|
3927
|
+
}), e.register("unfocus", P.moduleName, (r, s) => {
|
|
3845
3928
|
this.snappingCancelled = !0, Y(this.wnd), s(!0);
|
|
3846
|
-
}), e.register("shake",
|
|
3929
|
+
}), e.register("shake", P.moduleName, (r, s) => {
|
|
3847
3930
|
this.shake(), s(!0);
|
|
3848
|
-
}), e.register("focus",
|
|
3931
|
+
}), e.register("focus", P.moduleName, (r, s) => {
|
|
3849
3932
|
this.wnd.requestAnimationFrame(() => {
|
|
3850
3933
|
this.cachedScrollWidth = this.doc().scrollWidth, this.snapCurrentOffset(!1, !0), this.reportProgress(), s(!0);
|
|
3851
3934
|
});
|
|
3852
|
-
}), e.register("first_visible_locator",
|
|
3853
|
-
const o =
|
|
3935
|
+
}), e.register("first_visible_locator", P.moduleName, (r, s) => {
|
|
3936
|
+
const o = FA(t, !1);
|
|
3854
3937
|
this.comms.send("first_visible_locator", o.serialize()), s(!0);
|
|
3855
3938
|
}), t.addEventListener("touchstart", this.onTouchStarter, { passive: !0 }), t.addEventListener("touchend", this.onTouchEnder, { passive: !0 }), t.addEventListener("touchmove", this.onTouchMover, { passive: !0 }), t.document.addEventListener("touchstart", () => {
|
|
3856
3939
|
}), e.log("ColumnSnapper Mounted"), !0;
|
|
3857
3940
|
}
|
|
3858
3941
|
unmount(t, e) {
|
|
3859
3942
|
var A;
|
|
3860
|
-
return this.snappingCancelled = !0, e.unregisterAll(
|
|
3943
|
+
return this.snappingCancelled = !0, e.unregisterAll(P.moduleName), this.resizeObserver.disconnect(), this.mutationObserver.disconnect(), t.removeEventListener("touchstart", this.onTouchStarter), t.removeEventListener("touchend", this.onTouchEnder), t.removeEventListener("touchmove", this.onTouchMover), t.removeEventListener("orientationchange", this.onWidthChanger), t.removeEventListener("resize", this.onWidthChanger), (A = t.document.getElementById(Te)) == null || A.remove(), e.log("ColumnSnapper Unmounted"), super.unmount(t, e);
|
|
3861
3944
|
}
|
|
3862
3945
|
};
|
|
3863
|
-
|
|
3864
|
-
let
|
|
3865
|
-
const je = "readium-scroll-snapper-style",
|
|
3946
|
+
CA.moduleName = "column_snapper";
|
|
3947
|
+
let Hi = CA;
|
|
3948
|
+
const je = "readium-scroll-snapper-style", yA = class v extends EA {
|
|
3866
3949
|
constructor() {
|
|
3867
3950
|
super(...arguments), this.initialScrollHandled = !1, this.isScrolling = !1, this.lastScrollTop = 0, this.isResizing = !1, this.resizeDebounce = null, this.handleScroll = () => {
|
|
3868
3951
|
if (this.comms.ready && !this.isResizing) {
|
|
@@ -3905,11 +3988,11 @@ const je = "readium-scroll-snapper-style", UA = class P extends pA {
|
|
|
3905
3988
|
this.resizeDebounce && this.wnd.clearTimeout(this.resizeDebounce), this.isResizing = !0, this.resizeDebounce = this.wnd.setTimeout(() => {
|
|
3906
3989
|
this.isResizing = !1, this.resizeDebounce = null, this.reportProgress();
|
|
3907
3990
|
}, 50);
|
|
3908
|
-
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc",
|
|
3909
|
-
|
|
3991
|
+
}), this.resizeObserver.observe(t.document.body), t.addEventListener("scroll", this.handleScroll, { passive: !0 }), e.register("force_webkit_recalc", v.moduleName, () => {
|
|
3992
|
+
ji(this.wnd);
|
|
3910
3993
|
const n = this.doc().scrollTop;
|
|
3911
3994
|
n > 1 ? this.doc().scrollTop = n - 1 : this.doc().scrollTop = n + 1, this.doc().scrollTop = n;
|
|
3912
|
-
}), e.register("go_progression",
|
|
3995
|
+
}), e.register("go_progression", v.moduleName, (n, r) => {
|
|
3913
3996
|
const s = n;
|
|
3914
3997
|
if (s < 0 || s > 1) {
|
|
3915
3998
|
e.send("error", {
|
|
@@ -3920,7 +4003,7 @@ const je = "readium-scroll-snapper-style", UA = class P extends pA {
|
|
|
3920
4003
|
this.wnd.requestAnimationFrame(() => {
|
|
3921
4004
|
this.doc().scrollTop = this.doc().offsetHeight * s, this.reportProgress(), Y(this.wnd), r(!0);
|
|
3922
4005
|
});
|
|
3923
|
-
}), e.register("go_id",
|
|
4006
|
+
}), e.register("go_id", v.moduleName, (n, r) => {
|
|
3924
4007
|
const s = t.document.getElementById(n);
|
|
3925
4008
|
if (!s) {
|
|
3926
4009
|
r(!1);
|
|
@@ -3929,10 +4012,10 @@ const je = "readium-scroll-snapper-style", UA = class P extends pA {
|
|
|
3929
4012
|
this.wnd.requestAnimationFrame(() => {
|
|
3930
4013
|
this.doc().scrollTop = s.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), Y(this.wnd), r(!0);
|
|
3931
4014
|
});
|
|
3932
|
-
}), e.register("go_text",
|
|
4015
|
+
}), e.register("go_text", v.moduleName, (n, r) => {
|
|
3933
4016
|
let s;
|
|
3934
4017
|
Array.isArray(n) && (n.length > 1 && (s = n[1]), n = n[0]);
|
|
3935
|
-
const o =
|
|
4018
|
+
const o = mt.deserialize(n), a = le(this.wnd.document, new At({
|
|
3936
4019
|
href: t.location.href,
|
|
3937
4020
|
type: "text/html",
|
|
3938
4021
|
text: o,
|
|
@@ -3949,34 +4032,34 @@ const je = "readium-scroll-snapper-style", UA = class P extends pA {
|
|
|
3949
4032
|
this.wnd.requestAnimationFrame(() => {
|
|
3950
4033
|
this.doc().scrollTop = a.getBoundingClientRect().top + t.scrollY - t.innerHeight / 2, this.reportProgress(), Y(this.wnd), r(!0);
|
|
3951
4034
|
});
|
|
3952
|
-
}), e.register("go_start",
|
|
4035
|
+
}), e.register("go_start", v.moduleName, (n, r) => {
|
|
3953
4036
|
if (this.doc().scrollTop === 0)
|
|
3954
4037
|
return r(!1);
|
|
3955
4038
|
this.doc().scrollTop = 0, this.reportProgress(), r(!0);
|
|
3956
|
-
}), e.register("go_end",
|
|
4039
|
+
}), e.register("go_end", v.moduleName, (n, r) => {
|
|
3957
4040
|
if (this.doc().scrollTop === this.doc().scrollHeight - this.doc().offsetHeight)
|
|
3958
4041
|
return r(!1);
|
|
3959
4042
|
this.doc().scrollTop = this.doc().scrollHeight - this.doc().offsetHeight, this.reportProgress(), r(!0);
|
|
3960
|
-
}), e.register("unfocus",
|
|
4043
|
+
}), e.register("unfocus", v.moduleName, (n, r) => {
|
|
3961
4044
|
Y(this.wnd), r(!0);
|
|
3962
4045
|
}), e.register([
|
|
3963
4046
|
"go_next",
|
|
3964
4047
|
"go_prev"
|
|
3965
|
-
],
|
|
4048
|
+
], v.moduleName, (n, r) => r(!1)), e.register("focus", v.moduleName, (n, r) => {
|
|
3966
4049
|
this.reportProgress(), r(!0);
|
|
3967
|
-
}), e.register("first_visible_locator",
|
|
3968
|
-
const s =
|
|
4050
|
+
}), e.register("first_visible_locator", v.moduleName, (n, r) => {
|
|
4051
|
+
const s = FA(t, !0);
|
|
3969
4052
|
this.comms.send("first_visible_locator", s.serialize()), r(!0);
|
|
3970
4053
|
}), e.log("ScrollSnapper Mounted"), !0;
|
|
3971
4054
|
}
|
|
3972
4055
|
unmount(t, e) {
|
|
3973
4056
|
var A;
|
|
3974
|
-
return e.unregisterAll(
|
|
4057
|
+
return e.unregisterAll(v.moduleName), this.resizeObserver.disconnect(), this.handleScroll && t.removeEventListener("scroll", this.handleScroll), (A = t.document.getElementById(je)) == null || A.remove(), e.log("ScrollSnapper Unmounted"), !0;
|
|
3975
4058
|
}
|
|
3976
4059
|
};
|
|
3977
|
-
|
|
3978
|
-
let
|
|
3979
|
-
class
|
|
4060
|
+
yA.moduleName = "scroll_snapper";
|
|
4061
|
+
let ki = yA;
|
|
4062
|
+
class RA extends Pt {
|
|
3980
4063
|
constructor() {
|
|
3981
4064
|
super(...arguments), this.pointerMoved = !1, this.onPointerUp = this.onPointUp.bind(this), this.onPointerMove = this.onPointMove.bind(this), this.onPointerDown = this.onPointDown.bind(this), this.onContextMenu = this.onContext.bind(this), this.onClicker = this.onClick.bind(this);
|
|
3982
4065
|
}
|
|
@@ -4010,7 +4093,7 @@ class CA extends jt {
|
|
|
4010
4093
|
y: t.clientY * a,
|
|
4011
4094
|
targetFrameSrc: this.wnd.location.href,
|
|
4012
4095
|
targetElement: t.target.outerHTML,
|
|
4013
|
-
interactiveElement: (s =
|
|
4096
|
+
interactiveElement: (s = IA(t.target)) == null ? void 0 : s.outerHTML,
|
|
4014
4097
|
cssSelector: this.wnd._readium_cssSelectorGenerator.getCssSelector(t.target)
|
|
4015
4098
|
}), this.pointerMoved = !1;
|
|
4016
4099
|
}
|
|
@@ -4046,8 +4129,8 @@ class CA extends jt {
|
|
|
4046
4129
|
return t.document.removeEventListener("pointerdown", this.onPointerDown), t.document.removeEventListener("pointerup", this.onPointerUp), t.document.removeEventListener("contextmenu", this.onContextMenu), t.document.removeEventListener("pointermove", this.onPointerMove), t.document.removeEventListener("click", this.onClicker), e.log("Peripherals Unmounted"), !0;
|
|
4047
4130
|
}
|
|
4048
4131
|
}
|
|
4049
|
-
|
|
4050
|
-
const
|
|
4132
|
+
RA.moduleName = "peripherals";
|
|
4133
|
+
const QA = class qt extends Pt {
|
|
4051
4134
|
constructor() {
|
|
4052
4135
|
super(...arguments), this.mediaPlayingCount = 0, this.allAnimations = /* @__PURE__ */ new Set();
|
|
4053
4136
|
}
|
|
@@ -4101,7 +4184,7 @@ const yA = class qt extends jt {
|
|
|
4101
4184
|
), Reflect.defineProperty(t.navigator, "epubReadingSystem", {
|
|
4102
4185
|
value: {
|
|
4103
4186
|
name: "readium-ts-toolkit",
|
|
4104
|
-
version: "2.
|
|
4187
|
+
version: "2.1.0",
|
|
4105
4188
|
hasFeature: (n, r = "") => {
|
|
4106
4189
|
switch (n) {
|
|
4107
4190
|
case "dom-manipulation":
|
|
@@ -4148,12 +4231,12 @@ const yA = class qt extends jt {
|
|
|
4148
4231
|
return t.removeEventListener("error", this.wndOnErr), t.removeEventListener("play", this.onMediaPlayEvent), t.removeEventListener("pause", this.onMediaPauseEvent), this.allAnimations.forEach((A) => A.cancel()), this.allAnimations.clear(), e.log("Setup Unmounted"), !0;
|
|
4149
4232
|
}
|
|
4150
4233
|
};
|
|
4151
|
-
|
|
4152
|
-
let
|
|
4153
|
-
const Ve = "readium-viewport",
|
|
4234
|
+
QA.moduleName = "setup";
|
|
4235
|
+
let zA = QA;
|
|
4236
|
+
const Ve = "readium-viewport", YA = class nt extends zA {
|
|
4154
4237
|
onViewportWidthChanged(t) {
|
|
4155
4238
|
const e = t.target;
|
|
4156
|
-
|
|
4239
|
+
St(e, "--RS__viewportWidth", `${e.innerWidth}px`);
|
|
4157
4240
|
}
|
|
4158
4241
|
mount(t, e) {
|
|
4159
4242
|
if (!super.mount(t, e))
|
|
@@ -4164,27 +4247,27 @@ const Ve = "readium-viewport", QA = class At extends RA {
|
|
|
4164
4247
|
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
|
|
4165
4248
|
), t.document.head.appendChild(A), t.addEventListener("orientationchange", this.onViewportWidthChanged), t.addEventListener("resize", this.onViewportWidthChanged), this.onViewportWidthChanged({
|
|
4166
4249
|
target: t
|
|
4167
|
-
}), e.register("get_properties",
|
|
4168
|
-
|
|
4169
|
-
}), e.register("update_properties",
|
|
4170
|
-
n["--RS__viewportWidth"] = `${t.innerWidth}px`,
|
|
4171
|
-
}), e.register("set_property",
|
|
4250
|
+
}), e.register("get_properties", nt.moduleName, (n, r) => {
|
|
4251
|
+
fA(t), r(!0);
|
|
4252
|
+
}), e.register("update_properties", nt.moduleName, (n, r) => {
|
|
4253
|
+
n["--RS__viewportWidth"] = `${t.innerWidth}px`, Ri(t, n), r(!0);
|
|
4254
|
+
}), e.register("set_property", nt.moduleName, (n, r) => {
|
|
4172
4255
|
const s = n;
|
|
4173
|
-
|
|
4174
|
-
}), e.register("remove_property",
|
|
4175
|
-
|
|
4176
|
-
}), e.register("activate",
|
|
4256
|
+
St(t, s[0], s[1]), r(!0);
|
|
4257
|
+
}), e.register("remove_property", nt.moduleName, (n, r) => {
|
|
4258
|
+
he(t, n), r(!0);
|
|
4259
|
+
}), e.register("activate", nt.moduleName, (n, r) => {
|
|
4177
4260
|
this.unblock(t), r(!0);
|
|
4178
4261
|
}), e.log("ReflowableSetup Mounted"), !0;
|
|
4179
4262
|
}
|
|
4180
4263
|
unmount(t, e) {
|
|
4181
4264
|
var A;
|
|
4182
|
-
return e.unregisterAll(
|
|
4265
|
+
return e.unregisterAll(nt.moduleName), (A = t.document.head.querySelector(`#${Ve}`)) == null || A.remove(), t.removeEventListener("orientationchange", this.onViewportWidthChanged), e.log("ReflowableSetup Unmounted"), super.unmount(t, e);
|
|
4183
4266
|
}
|
|
4184
4267
|
};
|
|
4185
|
-
|
|
4186
|
-
let
|
|
4187
|
-
const De = "readium-fixed-style",
|
|
4268
|
+
YA.moduleName = "reflowable_setup";
|
|
4269
|
+
let Ji = YA;
|
|
4270
|
+
const De = "readium-fixed-style", NA = class q extends zA {
|
|
4188
4271
|
mount(t, e) {
|
|
4189
4272
|
if (!super.mount(t, e))
|
|
4190
4273
|
return !1;
|
|
@@ -4202,12 +4285,12 @@ const De = "readium-fixed-style", zA = class Z extends RA {
|
|
|
4202
4285
|
min-height: 100%;
|
|
4203
4286
|
|
|
4204
4287
|
/*cursor: var() TODO*/
|
|
4205
|
-
}`, t.document.head.appendChild(A), e.register("set_property",
|
|
4288
|
+
}`, t.document.head.appendChild(A), e.register("set_property", q.moduleName, (n, r) => {
|
|
4206
4289
|
const s = n;
|
|
4207
|
-
|
|
4208
|
-
}), e.register("remove_property",
|
|
4209
|
-
|
|
4210
|
-
}), e.register("first_visible_locator",
|
|
4290
|
+
St(t, s[0], s[1]), r(!0);
|
|
4291
|
+
}), e.register("remove_property", q.moduleName, (n, r) => {
|
|
4292
|
+
he(t, n), r(!0);
|
|
4293
|
+
}), e.register("first_visible_locator", q.moduleName, (n, r) => r(!1)), e.register("unfocus", q.moduleName, (n, r) => {
|
|
4211
4294
|
Y(t), r(!0);
|
|
4212
4295
|
}), e.register([
|
|
4213
4296
|
"focus",
|
|
@@ -4218,22 +4301,22 @@ const De = "readium-fixed-style", zA = class Z extends RA {
|
|
|
4218
4301
|
"go_start",
|
|
4219
4302
|
"go_text",
|
|
4220
4303
|
"go_progression"
|
|
4221
|
-
],
|
|
4304
|
+
], q.moduleName, (n, r) => r(!0)), e.register("activate", q.moduleName, (n, r) => {
|
|
4222
4305
|
this.unblock(t), r(!0);
|
|
4223
4306
|
}), e.log("FixedSetup Mounted"), !0;
|
|
4224
4307
|
}
|
|
4225
4308
|
unmount(t, e) {
|
|
4226
4309
|
var A;
|
|
4227
|
-
return e.unregisterAll(
|
|
4310
|
+
return e.unregisterAll(q.moduleName), (A = t.document.getElementById(De)) == null || A.remove(), e.log("FixedSetup Unmounted"), super.unmount(t, e);
|
|
4228
4311
|
}
|
|
4229
4312
|
};
|
|
4230
|
-
|
|
4231
|
-
let
|
|
4232
|
-
const
|
|
4313
|
+
NA.moduleName = "fixed_setup";
|
|
4314
|
+
let Wi = NA;
|
|
4315
|
+
const Li = [
|
|
4233
4316
|
"fixed_setup",
|
|
4234
4317
|
"decorator",
|
|
4235
4318
|
"peripherals"
|
|
4236
|
-
],
|
|
4319
|
+
], Oi = [
|
|
4237
4320
|
"reflowable_setup",
|
|
4238
4321
|
"decorator",
|
|
4239
4322
|
"peripherals",
|
|
@@ -4241,20 +4324,20 @@ const ki = [
|
|
|
4241
4324
|
"scroll_snapper"
|
|
4242
4325
|
], _t = new Map([
|
|
4243
4326
|
// All modules go here
|
|
4327
|
+
Wi,
|
|
4328
|
+
Ji,
|
|
4329
|
+
RA,
|
|
4330
|
+
xi,
|
|
4244
4331
|
Hi,
|
|
4245
|
-
|
|
4246
|
-
CA,
|
|
4247
|
-
Yi,
|
|
4248
|
-
vi,
|
|
4249
|
-
bi
|
|
4332
|
+
ki
|
|
4250
4333
|
].map((i) => [i.moduleName, i]));
|
|
4251
|
-
class
|
|
4334
|
+
class xt {
|
|
4252
4335
|
/**
|
|
4253
4336
|
* @param wnd Window instance to operate on
|
|
4254
4337
|
* @param initialModules List of initial modules to load
|
|
4255
4338
|
*/
|
|
4256
4339
|
constructor(t = window, e = []) {
|
|
4257
|
-
this.loadedModules = [], this.wnd = t, this.comms = new
|
|
4340
|
+
this.loadedModules = [], this.wnd = t, this.comms = new hi(t);
|
|
4258
4341
|
const A = [...new Set(e)];
|
|
4259
4342
|
if (A.length) {
|
|
4260
4343
|
if (typeof t > "u")
|
|
@@ -4298,7 +4381,7 @@ class Yt {
|
|
|
4298
4381
|
this.comms.destroy(), this.loadedModules.forEach((t) => t.unmount(this.wnd, this.comms)), this.loadedModules = [];
|
|
4299
4382
|
}
|
|
4300
4383
|
}
|
|
4301
|
-
const
|
|
4384
|
+
const Xi = 1e4;
|
|
4302
4385
|
class $t {
|
|
4303
4386
|
constructor(t, e) {
|
|
4304
4387
|
this.registry = /* @__PURE__ */ new Map(), this._ready = !1, this.listenerBuffer = [], this.handler = this.handle.bind(this), this.wnd = t, this.origin = e;
|
|
@@ -4309,7 +4392,7 @@ class $t {
|
|
|
4309
4392
|
}
|
|
4310
4393
|
this.gc = setInterval(() => {
|
|
4311
4394
|
this.registry.forEach((A, n) => {
|
|
4312
|
-
performance.now() - A.time >
|
|
4395
|
+
performance.now() - A.time > Xi && (console.warn(n, "event for", A.key, "was never handled!"), this.registry.delete(n));
|
|
4313
4396
|
});
|
|
4314
4397
|
}, 5e3), window.addEventListener("message", this.handler), this.send("_ping", void 0);
|
|
4315
4398
|
}
|
|
@@ -4367,7 +4450,7 @@ class $t {
|
|
|
4367
4450
|
key: t
|
|
4368
4451
|
}), this.wnd.postMessage(
|
|
4369
4452
|
{
|
|
4370
|
-
_readium:
|
|
4453
|
+
_readium: ot,
|
|
4371
4454
|
_channel: this.channelId,
|
|
4372
4455
|
id: s,
|
|
4373
4456
|
data: e,
|
|
@@ -4380,16 +4463,16 @@ class $t {
|
|
|
4380
4463
|
), s;
|
|
4381
4464
|
}
|
|
4382
4465
|
}
|
|
4383
|
-
const
|
|
4384
|
-
RS__oldStyleTf:
|
|
4385
|
-
RS__modernTf:
|
|
4386
|
-
RS__sansTf:
|
|
4387
|
-
RS__humanistTf:
|
|
4388
|
-
RS__monospaceTf:
|
|
4389
|
-
},
|
|
4390
|
-
class
|
|
4466
|
+
const Zi = "'Iowan Old Style', Sitka, 'Sitka Text', Palatino, 'Book Antiqua', 'URW Palladio L', P052, serif", Ki = "Athelas, Constantia, Charter, 'Bitstream Charter', Cambria, 'Georgia Pro', Georgia, serif", qi = "-ui-sans-serif, -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI Variable', 'Segoe UI', Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Liberation Sans', Arial, sans-serif", _i = "Seravek, Calibri, 'Gill Sans Nova', Roboto, Ubuntu, 'DejaVu Sans', source-sans-pro, sans-serif", $i = "ui-monospace, 'Andale Mono', 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace", tn = {
|
|
4467
|
+
RS__oldStyleTf: Zi,
|
|
4468
|
+
RS__modernTf: Ki,
|
|
4469
|
+
RS__sansTf: qi,
|
|
4470
|
+
RS__humanistTf: _i,
|
|
4471
|
+
RS__monospaceTf: $i
|
|
4472
|
+
}, en = 16, Pe = tn.RS__oldStyleTf;
|
|
4473
|
+
class pt {
|
|
4391
4474
|
constructor(t) {
|
|
4392
|
-
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize ||
|
|
4475
|
+
this._optimalLineLength = null, this._canvas = document.createElement("canvas"), this._optimalChars = t.optimalChars, this._minChars = t.minChars, this._maxChars = t.maxChars, this._baseFontSize = t.baseFontSize || en, this._fontFace = t.fontFace || Pe, this._sample = t.sample || null, this._pageGutter = t.pageGutter || 0, this._letterSpacing = t.letterSpacing ? Math.round(t.letterSpacing * this._baseFontSize) : 0, this._wordSpacing = t.wordSpacing ? Math.round(t.wordSpacing * this._baseFontSize) : 0, this._isCJK = t.isCJK || !1, this._getRelative = t.getRelative || !1, this._padding = this._pageGutter * 2, this._minDivider = this._minChars && this._minChars < this._optimalChars ? this._optimalChars / this._minChars : this._minChars === null ? null : 1, this._maxMultiplier = this._maxChars && this._maxChars > this._optimalChars ? this._maxChars / this._optimalChars : this._maxChars === null ? null : 1, this._approximatedWordSpaces = pt.approximateWordSpaces(this._optimalChars, this._sample);
|
|
4393
4476
|
}
|
|
4394
4477
|
updateMultipliers() {
|
|
4395
4478
|
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;
|
|
@@ -4398,7 +4481,7 @@ class dt {
|
|
|
4398
4481
|
// Not filtering because pretty much everything can
|
|
4399
4482
|
// trigger a recomputation anyway.
|
|
4400
4483
|
update(t) {
|
|
4401
|
-
t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || Pe), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.pageGutter && (this._pageGutter = t.pageGutter), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces =
|
|
4484
|
+
t.optimalChars && (this._optimalChars = t.optimalChars), t.minChars !== void 0 && (this._minChars = t.minChars), t.maxChars !== void 0 && (this._maxChars = t.maxChars), t.baseFontSize && (this._baseFontSize = t.baseFontSize), t.fontFace !== void 0 && (this._fontFace = t.fontFace || Pe), t.letterSpacing && (this._letterSpacing = t.letterSpacing), t.wordSpacing && (this._wordSpacing = t.wordSpacing), t.isCJK != null && (this._isCJK = t.isCJK), t.pageGutter && (this._pageGutter = t.pageGutter), t.getRelative && (this._getRelative = t.getRelative), t.sample && (this._sample = t.sample, this._approximatedWordSpaces = pt.approximateWordSpaces(this._optimalChars, this._sample)), this.updateMultipliers(), this._optimalLineLength = this.getOptimalLineLength();
|
|
4402
4485
|
}
|
|
4403
4486
|
get baseFontSize() {
|
|
4404
4487
|
return this._baseFontSize;
|
|
@@ -4454,7 +4537,7 @@ class dt {
|
|
|
4454
4537
|
if (e.font = `${this._baseFontSize}px ${t}`, this._sample && this._sample.length >= this._optimalChars && (A = this._sample.slice(0, this._optimalChars)), Object.hasOwn(e, "letterSpacing") && Object.hasOwn(e, "wordSpacing"))
|
|
4455
4538
|
return e.letterSpacing = this._letterSpacing.toString() + "px", e.wordSpacing = this._wordSpacing.toString() + "px", e.measureText(A).width;
|
|
4456
4539
|
{
|
|
4457
|
-
const n = this._letterSpacing * (this._optimalChars - 1), r = this._wordSpacing *
|
|
4540
|
+
const n = this._letterSpacing * (this._optimalChars - 1), r = this._wordSpacing * pt.approximateWordSpaces(this._optimalChars, this._sample);
|
|
4458
4541
|
return e.measureText(A).width + n + r;
|
|
4459
4542
|
}
|
|
4460
4543
|
} else
|
|
@@ -4471,10 +4554,10 @@ class dt {
|
|
|
4471
4554
|
* Portions of this code come from the sML library
|
|
4472
4555
|
* Current version: 1.0.36
|
|
4473
4556
|
*/
|
|
4474
|
-
const
|
|
4475
|
-
class
|
|
4557
|
+
const SA = () => typeof navigator > "u" ? "" : navigator.userAgent || "", xA = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
|
|
4558
|
+
class TA {
|
|
4476
4559
|
constructor() {
|
|
4477
|
-
const t =
|
|
4560
|
+
const t = xA(), e = SA(), A = (r) => (typeof r == "string" || typeof r == "number") && r ? String(r).replace(/_/g, ".").split(".").map((s) => parseInt(s) || 0) : [], n = (r = "") => {
|
|
4478
4561
|
if (!r)
|
|
4479
4562
|
return [];
|
|
4480
4563
|
const s = new RegExp("^.*" + r + "[ :\\/]?(\\d+([\\._]\\d+)*).*$");
|
|
@@ -4515,17 +4598,17 @@ class SA {
|
|
|
4515
4598
|
}, []) };
|
|
4516
4599
|
}
|
|
4517
4600
|
}
|
|
4518
|
-
class
|
|
4601
|
+
class An extends TA {
|
|
4519
4602
|
get iOSRequest() {
|
|
4520
|
-
const t =
|
|
4603
|
+
const t = xA(), e = SA();
|
|
4521
4604
|
if (this.OS.iOS && !this.OS.iPadOS)
|
|
4522
4605
|
return "mobile";
|
|
4523
4606
|
if (this.OS.iPadOS)
|
|
4524
4607
|
return /\(iPad;/.test(e) || t && /^iPad(OS)?$/.test(t.platform) ? "mobile" : "desktop";
|
|
4525
4608
|
}
|
|
4526
4609
|
}
|
|
4527
|
-
const
|
|
4528
|
-
class
|
|
4610
|
+
const yt = new TA(), O = new An();
|
|
4611
|
+
class nn {
|
|
4529
4612
|
constructor(t) {
|
|
4530
4613
|
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.source = t;
|
|
4531
4614
|
}
|
|
@@ -4541,7 +4624,7 @@ class tn {
|
|
|
4541
4624
|
}
|
|
4542
4625
|
return;
|
|
4543
4626
|
}
|
|
4544
|
-
(n = this.comms) == null || n.halt(), this.loader.destroy(), this.loader = new
|
|
4627
|
+
(n = this.comms) == null || n.halt(), this.loader.destroy(), this.loader = new xt(r, t), this.currModules = t, this.comms = void 0;
|
|
4545
4628
|
try {
|
|
4546
4629
|
e(r);
|
|
4547
4630
|
} catch {
|
|
@@ -4550,7 +4633,7 @@ class tn {
|
|
|
4550
4633
|
}
|
|
4551
4634
|
this.frame.onload = () => {
|
|
4552
4635
|
const r = this.frame.contentWindow;
|
|
4553
|
-
this.loader = new
|
|
4636
|
+
this.loader = new xt(r, t), this.currModules = t;
|
|
4554
4637
|
try {
|
|
4555
4638
|
e(r);
|
|
4556
4639
|
} catch {
|
|
@@ -4594,7 +4677,7 @@ class tn {
|
|
|
4594
4677
|
var o;
|
|
4595
4678
|
const s = () => {
|
|
4596
4679
|
var a;
|
|
4597
|
-
this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("aria-hidden"), this.frame.style.removeProperty("opacity"), this.frame.style.removeProperty("pointer-events"), this.hidden = !1,
|
|
4680
|
+
this.frame.style.removeProperty("visibility"), this.frame.style.removeProperty("aria-hidden"), this.frame.style.removeProperty("opacity"), this.frame.style.removeProperty("pointer-events"), this.hidden = !1, yt.UA.WebKit && ((a = this.comms) == null || a.send("force_webkit_recalc", void 0)), e();
|
|
4598
4681
|
};
|
|
4599
4682
|
t !== void 0 ? (o = this.comms) == null || o.send("go_progression", t, s) : s();
|
|
4600
4683
|
});
|
|
@@ -4634,7 +4717,7 @@ class tn {
|
|
|
4634
4717
|
}
|
|
4635
4718
|
}
|
|
4636
4719
|
const ve = 5, be = 3;
|
|
4637
|
-
class
|
|
4720
|
+
class rn {
|
|
4638
4721
|
constructor(t, e, A) {
|
|
4639
4722
|
this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.pendingUpdates = /* @__PURE__ */ new Map(), this.container = t, this.positions = e, this.currentCssProperties = A;
|
|
4640
4723
|
}
|
|
@@ -4685,10 +4768,10 @@ class en {
|
|
|
4685
4768
|
if (!w)
|
|
4686
4769
|
return;
|
|
4687
4770
|
if (!this.blobs.has(f)) {
|
|
4688
|
-
const
|
|
4689
|
-
this.blobs.set(f,
|
|
4771
|
+
const D = await new aA(t, this.currentBaseURL || "", w, this.currentCssProperties).build();
|
|
4772
|
+
this.blobs.set(f, D);
|
|
4690
4773
|
}
|
|
4691
|
-
const U = new
|
|
4774
|
+
const U = new nn(this.blobs.get(f));
|
|
4692
4775
|
f !== s && await U.hide(), this.container.appendChild(U.iframe), await U.load(A), this.pool.set(f, U);
|
|
4693
4776
|
};
|
|
4694
4777
|
try {
|
|
@@ -4743,7 +4826,7 @@ class en {
|
|
|
4743
4826
|
}), t;
|
|
4744
4827
|
}
|
|
4745
4828
|
}
|
|
4746
|
-
class
|
|
4829
|
+
class sn {
|
|
4747
4830
|
constructor(t, e, A) {
|
|
4748
4831
|
this.currModules = [], this.cachedPage = void 0, this.peripherals = t, this.debugHref = A, this.frame = document.createElement("iframe"), 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 = A, this.source = "about:blank", this.wrapper = document.createElement("div"), this.wrapper.style.position = "relative", this.wrapper.style.float = this.wrapper.style.cssFloat = e === R.rtl ? "right" : "left", this.wrapper.appendChild(this.frame);
|
|
4749
4832
|
}
|
|
@@ -4759,7 +4842,7 @@ class An {
|
|
|
4759
4842
|
}
|
|
4760
4843
|
return;
|
|
4761
4844
|
}
|
|
4762
|
-
(r = this.comms) == null || r.halt(), this.loader.destroy(), this.loader = new
|
|
4845
|
+
(r = this.comms) == null || r.halt(), this.loader.destroy(), this.loader = new xt(s, t), this.currModules = t, this.comms = void 0;
|
|
4763
4846
|
try {
|
|
4764
4847
|
A(s), this.loadPromise = void 0;
|
|
4765
4848
|
} catch {
|
|
@@ -4768,7 +4851,7 @@ class An {
|
|
|
4768
4851
|
}
|
|
4769
4852
|
this.frame.addEventListener("load", () => {
|
|
4770
4853
|
const s = this.frame.contentWindow;
|
|
4771
|
-
this.loader = new
|
|
4854
|
+
this.loader = new xt(s, t), this.currModules = t, this.peripherals.observe(this.wrapper), this.peripherals.observe(s);
|
|
4772
4855
|
try {
|
|
4773
4856
|
A(s);
|
|
4774
4857
|
} catch {
|
|
@@ -4807,10 +4890,10 @@ class An {
|
|
|
4807
4890
|
const A = Math.min(this.wrapper.clientWidth / e.width, this.wrapper.clientHeight / e.height);
|
|
4808
4891
|
this.frame.style.transform = `scale(${A})`;
|
|
4809
4892
|
const n = this.frame.getBoundingClientRect(), r = this.wrapper.clientHeight - n.height;
|
|
4810
|
-
if (this.frame.style.top = `${r / 2}px`, t ===
|
|
4893
|
+
if (this.frame.style.top = `${r / 2}px`, t === J.left) {
|
|
4811
4894
|
const s = this.wrapper.clientWidth - n.width;
|
|
4812
4895
|
this.frame.style.left = `${s}px`;
|
|
4813
|
-
} else if (t ===
|
|
4896
|
+
} else if (t === J.center) {
|
|
4814
4897
|
const s = this.wrapper.clientWidth - n.width;
|
|
4815
4898
|
this.frame.style.left = `${s / 2}px`;
|
|
4816
4899
|
} else
|
|
@@ -4917,13 +5000,13 @@ class An {
|
|
|
4917
5000
|
return this.loader;
|
|
4918
5001
|
}
|
|
4919
5002
|
}
|
|
4920
|
-
var
|
|
4921
|
-
class
|
|
5003
|
+
var on = /* @__PURE__ */ ((i) => (i[i.Left = 0] = "Left", i[i.Center = 1] = "Center", i[i.Right = 2] = "Right", i))(on || {}), an = /* @__PURE__ */ ((i) => (i[i.Top = 0] = "Top", i[i.Middle = 1] = "Middle", i[i.Bottom = 2] = "Bottom", i))(an || {});
|
|
5004
|
+
class ln {
|
|
4922
5005
|
constructor() {
|
|
4923
5006
|
this.outerWidth = 0, this.outerHeight = 0, this.HTML = document.documentElement, this.Head = document.head, this.Body = document.body;
|
|
4924
5007
|
}
|
|
4925
5008
|
refreshOuterPixels(t) {
|
|
4926
|
-
|
|
5009
|
+
yt.OS.iOS || (this.outerHeight = window.outerHeight - window.innerHeight, yt.OS.Android && yt.UA.Chrome && window.screen.height > window.innerHeight && (this.outerHeight = (window.screen.height - window.innerHeight) / 1.5), this.outerWidth = window.outerWidth - window.innerWidth);
|
|
4927
5010
|
}
|
|
4928
5011
|
getBibiEventCoord(t, e = 0) {
|
|
4929
5012
|
var n;
|
|
@@ -4970,7 +5053,7 @@ class sn {
|
|
|
4970
5053
|
};
|
|
4971
5054
|
}
|
|
4972
5055
|
}
|
|
4973
|
-
class
|
|
5056
|
+
class hn {
|
|
4974
5057
|
constructor() {
|
|
4975
5058
|
this._DOM = {
|
|
4976
5059
|
show: !1,
|
|
@@ -4988,8 +5071,8 @@ class on {
|
|
|
4988
5071
|
return this._DOM;
|
|
4989
5072
|
}
|
|
4990
5073
|
}
|
|
4991
|
-
const Ge = 6,
|
|
4992
|
-
class
|
|
5074
|
+
const Ge = 6, Wt = 1.02, He = 50;
|
|
5075
|
+
class cn {
|
|
4993
5076
|
constructor(t, e = !1) {
|
|
4994
5077
|
this.dragState = 0, this.minimumMoved = !1, this.pan = {
|
|
4995
5078
|
startX: 0,
|
|
@@ -5008,14 +5091,14 @@ class an {
|
|
|
5008
5091
|
target: { X: 0, Y: 0 },
|
|
5009
5092
|
touchN: 0,
|
|
5010
5093
|
startTranslate: { X: 0, Y: 0 }
|
|
5011
|
-
}, 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
|
|
5094
|
+
}, 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 ln(), this.attachEvents(), e && (this.debugger = new hn());
|
|
5012
5095
|
}
|
|
5013
5096
|
get scale() {
|
|
5014
5097
|
return this._scale;
|
|
5015
5098
|
}
|
|
5016
5099
|
set scale(t) {
|
|
5017
5100
|
isNaN(t) && (t = 1), window.clearTimeout(this.scaleDebouncer), this.scaleDebouncer = window.setTimeout(() => {
|
|
5018
|
-
this.dragState === 0 && this.scale <
|
|
5101
|
+
this.dragState === 0 && this.scale < Wt && (this.pan.translateX = 0, this.pan.translateY = 0, this.clearPan(), this.manager.updateBookStyle()), this.manager.listener("zoom", t);
|
|
5019
5102
|
}, 100), this._scale = t;
|
|
5020
5103
|
}
|
|
5021
5104
|
/**
|
|
@@ -5111,7 +5194,7 @@ class an {
|
|
|
5111
5194
|
this.pan.startX = n.X, this.pan.startY = n.Y;
|
|
5112
5195
|
}
|
|
5113
5196
|
window.setTimeout(() => {
|
|
5114
|
-
this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale <
|
|
5197
|
+
this.manager.updateBookStyle(!0), this.dragState === 0 && (this.scale < Wt && (this.pan.translateX = 0, this.pan.translateY = 0), this.clearPan()), this.manager.updateBookStyle(!0);
|
|
5115
5198
|
}, 50);
|
|
5116
5199
|
}
|
|
5117
5200
|
/**
|
|
@@ -5129,7 +5212,7 @@ class an {
|
|
|
5129
5212
|
if (this.pinch.touchN++, this.pinch.touchN < 4)
|
|
5130
5213
|
return;
|
|
5131
5214
|
let c = A / this.pinch.startDistance * this.scale;
|
|
5132
|
-
c >= Ge && (c = Ge), c <=
|
|
5215
|
+
c >= Ge && (c = Ge), c <= Wt && (c = 1), this.scale = c, this.pinch.startDistance = A, n = !0;
|
|
5133
5216
|
}
|
|
5134
5217
|
if (this.pan.letItGo === !1 && (this.pan.letItGo = Math.abs(this.pan.startY - e.Y) < Math.abs(this.pan.startX - e.X)), (o = this.debugger) != null && o.show && (this.debugger.DOM.touch1.style.top = `${e.Y - 10}px`, this.debugger.DOM.touch1.style.left = `${e.X - 10}px`, this.debugger.DOM.touch1.innerText = `${e.X.toFixed(2)},${e.Y.toFixed(2)}`), this.dragState > 0 && this.isScaled || this.dragState > 1) {
|
|
5135
5218
|
if (this.dragState === 1) {
|
|
@@ -5212,7 +5295,7 @@ Overscroll: ${this.pan.overscrollX.toFixed(2)},${this.pan.overscrollY.toFixed(2)
|
|
|
5212
5295
|
}
|
|
5213
5296
|
}
|
|
5214
5297
|
var te = /* @__PURE__ */ ((i) => (i.auto = "auto", i.landscape = "landscape", i.portrait = "portrait", i))(te || {}), ee = /* @__PURE__ */ ((i) => (i.auto = "auto", i.both = "both", i.none = "none", i.landscape = "landscape", i))(ee || {});
|
|
5215
|
-
class
|
|
5298
|
+
class gn {
|
|
5216
5299
|
// TODO getter
|
|
5217
5300
|
constructor(t) {
|
|
5218
5301
|
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`);
|
|
@@ -5243,14 +5326,14 @@ class ln {
|
|
|
5243
5326
|
if (A.length > 1)
|
|
5244
5327
|
return;
|
|
5245
5328
|
const r = A[0], s = (o = r.properties) == null ? void 0 : o.otherProperties.orientation;
|
|
5246
|
-
n === 0 && (s === "landscape" || s !== "portrait" && ((r.width || 0) > (r.height || 0) || ((a = r.properties) == null ? void 0 : a.otherProperties.spread) === "both")) && (this.shift = !1), e && ((l = r.properties) == null ? void 0 : l.page) ===
|
|
5329
|
+
n === 0 && (s === "landscape" || s !== "portrait" && ((r.width || 0) > (r.height || 0) || ((a = r.properties) == null ? void 0 : a.otherProperties.spread) === "both")) && (this.shift = !1), e && ((l = r.properties) == null ? void 0 : l.page) === J.center && this.spreads[n - 1][0].addProperties({ addBlank: !0 }), s === "portrait" && ((h = r.properties) == null ? void 0 : h.page) !== "center" && ((c = r.properties) == null ? void 0 : c.otherProperties.number) > 1 ? e = !0 : e = !1;
|
|
5247
5330
|
}), this.shift || this.index(t, !0);
|
|
5248
5331
|
}
|
|
5249
5332
|
buildSpreads(t) {
|
|
5250
5333
|
let e = [];
|
|
5251
5334
|
t.items.forEach((A, n) => {
|
|
5252
5335
|
var r;
|
|
5253
|
-
!n && this.shift ? this.spreads.push([A]) : ((r = A.properties) == null ? void 0 : r.page) ===
|
|
5336
|
+
!n && this.shift ? this.spreads.push([A]) : ((r = A.properties) == null ? void 0 : r.page) === J.center ? (e.length > 0 && this.spreads.push(e), this.spreads.push([A]), e = []) : e.length >= 2 ? (this.spreads.push(e), e = [A]) : e.push(A);
|
|
5254
5337
|
}), e.length > 0 && this.spreads.push(e);
|
|
5255
5338
|
}
|
|
5256
5339
|
currentSpread(t, e) {
|
|
@@ -5260,15 +5343,15 @@ class ln {
|
|
|
5260
5343
|
return this.spreads.find((e) => e.includes(t)) || void 0;
|
|
5261
5344
|
}
|
|
5262
5345
|
}
|
|
5263
|
-
const ke = 8, Je = 5,
|
|
5264
|
-
class
|
|
5346
|
+
const ke = 8, Je = 5, dn = 300, un = 15e3, mn = 250, Mn = 150, fn = 500;
|
|
5347
|
+
class pn {
|
|
5265
5348
|
constructor(t, e, A) {
|
|
5266
5349
|
var n;
|
|
5267
5350
|
if (this.pool = /* @__PURE__ */ new Map(), this.blobs = /* @__PURE__ */ new Map(), this.inprogress = /* @__PURE__ */ new Map(), this.delayedShow = /* @__PURE__ */ new Map(), this.delayedTimeout = /* @__PURE__ */ new Map(), this.previousFrames = [], this.width = 0, this.height = 0, this.transform = "", this.currentSlide = 0, this.spread = !0, this.orientationInternal = -1, this.container = t, this.positions = e, this.pub = A, this.spreadPresentation = ((n = A.metadata.otherMetadata) == null ? void 0 : n.spread) || ee.auto, this.pub.metadata.effectiveReadingProgression !== R.rtl && this.pub.metadata.effectiveReadingProgression !== R.ltr)
|
|
5268
5351
|
throw Error("Unsupported reading progression for EPUB");
|
|
5269
|
-
this.spreader = new
|
|
5352
|
+
this.spreader = new gn(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 cn(this), this.pub.readingOrder.items.forEach((r) => {
|
|
5270
5353
|
var o, a;
|
|
5271
|
-
const s = new
|
|
5354
|
+
const s = new sn(this.peripherals, this.pub.metadata.effectiveReadingProgression, r.href);
|
|
5272
5355
|
this.spineElement.appendChild(s.element), this.pool.set(r.href, s), s.width = 100 / this.length * (((o = r.properties) == null ? void 0 : o.otherProperties.orientation) === te.landscape || (a = r.properties) != null && a.otherProperties.addBlank ? this.perPage : 1), s.height = this.height;
|
|
5273
5356
|
});
|
|
5274
5357
|
}
|
|
@@ -5295,7 +5378,7 @@ class mn {
|
|
|
5295
5378
|
const o = this.spreader.findByLink(s);
|
|
5296
5379
|
A.update(this.spreadPosition(o, s));
|
|
5297
5380
|
});
|
|
5298
|
-
},
|
|
5381
|
+
}, mn);
|
|
5299
5382
|
}
|
|
5300
5383
|
/**
|
|
5301
5384
|
* It is important that these values be cached to avoid spamming them on redraws, they are expensive.
|
|
@@ -5322,7 +5405,7 @@ class mn {
|
|
|
5322
5405
|
let A = "0";
|
|
5323
5406
|
this.updateDimensions(), this.perPage > 1 && (A = `${this.width / 2}px`);
|
|
5324
5407
|
const n = {
|
|
5325
|
-
transition: t ? `all ${e ?
|
|
5408
|
+
transition: t ? `all ${e ? Mn : fn}ms ease-out` : "all 0ms ease-out",
|
|
5326
5409
|
marginRight: this.rtl ? A : "0",
|
|
5327
5410
|
marginLeft: this.rtl ? "0" : A,
|
|
5328
5411
|
width: `${this.width / this.perPage * this.length}px`,
|
|
@@ -5459,7 +5542,7 @@ class mn {
|
|
|
5459
5542
|
return t % 2 && !this.single && t++, t;
|
|
5460
5543
|
}
|
|
5461
5544
|
spreadPosition(t, e) {
|
|
5462
|
-
return this.perPage < 2 || t.length < 2 ?
|
|
5545
|
+
return this.perPage < 2 || t.length < 2 ? J.center : e.href === t[0].href ? this.rtl ? J.right : J.left : this.rtl ? J.left : J.right;
|
|
5463
5546
|
}
|
|
5464
5547
|
async waitForItem(t) {
|
|
5465
5548
|
if (this.inprogress.has(t) && await this.inprogress.get(t), this.delayedShow.has(t)) {
|
|
@@ -5494,19 +5577,19 @@ class mn {
|
|
|
5494
5577
|
const B = t.readingOrder.findIndexWithHref(M), f = t.readingOrder.items[B];
|
|
5495
5578
|
if (f) {
|
|
5496
5579
|
if (!this.blobs.has(M)) {
|
|
5497
|
-
const U = await new
|
|
5580
|
+
const U = await new aA(t, this.currentBaseURL || "", f).build(!0);
|
|
5498
5581
|
this.blobs.set(M, U);
|
|
5499
5582
|
}
|
|
5500
5583
|
this.delayedShow.has(M) || this.delayedShow.set(M, new Promise((w, U) => {
|
|
5501
5584
|
let E = !1;
|
|
5502
5585
|
const I = window.setTimeout(async () => {
|
|
5503
5586
|
this.delayedTimeout.set(M, 0);
|
|
5504
|
-
const
|
|
5505
|
-
await
|
|
5506
|
-
},
|
|
5587
|
+
const D = this.makeSpread(this.reAlign(B)), wt = this.spreadPosition(D, f), Mt = this.pool.get(M);
|
|
5588
|
+
await Mt.load(A, this.blobs.get(M)), this.peripherals.isScaled || await Mt.show(wt), this.delayedShow.delete(M), E = !0, w();
|
|
5589
|
+
}, dn);
|
|
5507
5590
|
setTimeout(() => {
|
|
5508
5591
|
!E && this.delayedShow.has(M) && U(`Offscreen load timeout: ${M}`);
|
|
5509
|
-
},
|
|
5592
|
+
}, un), this.delayedTimeout.set(M, I);
|
|
5510
5593
|
}));
|
|
5511
5594
|
}
|
|
5512
5595
|
};
|
|
@@ -5622,11 +5705,11 @@ function We(i, t) {
|
|
|
5622
5705
|
}
|
|
5623
5706
|
return e;
|
|
5624
5707
|
}
|
|
5625
|
-
function
|
|
5708
|
+
function Bn(i, t) {
|
|
5626
5709
|
var e = t.dir || t.root, A = t.base || (t.name || "") + (t.ext || "");
|
|
5627
5710
|
return e ? e === t.root ? e + A : e + i + A : A;
|
|
5628
5711
|
}
|
|
5629
|
-
var
|
|
5712
|
+
var ct = {
|
|
5630
5713
|
// path.resolve([from ...], to)
|
|
5631
5714
|
resolve: function() {
|
|
5632
5715
|
for (var t = "", e = !1, A, n = arguments.length - 1; n >= -1 && !e; n--) {
|
|
@@ -5651,10 +5734,10 @@ var ot = {
|
|
|
5651
5734
|
var A = arguments[e];
|
|
5652
5735
|
W(A), A.length > 0 && (t === void 0 ? t = A : t += "/" + A);
|
|
5653
5736
|
}
|
|
5654
|
-
return t === void 0 ? "." :
|
|
5737
|
+
return t === void 0 ? "." : ct.normalize(t);
|
|
5655
5738
|
},
|
|
5656
5739
|
relative: function(t, e) {
|
|
5657
|
-
if (W(t), W(e), t === e || (t =
|
|
5740
|
+
if (W(t), W(e), t === e || (t = ct.resolve(t), e = ct.resolve(e), t === e))
|
|
5658
5741
|
return "";
|
|
5659
5742
|
for (var A = 1; A < t.length && t.charCodeAt(A) === 47; ++A)
|
|
5660
5743
|
;
|
|
@@ -5749,7 +5832,7 @@ var ot = {
|
|
|
5749
5832
|
format: function(t) {
|
|
5750
5833
|
if (t === null || typeof t != "object")
|
|
5751
5834
|
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
5752
|
-
return
|
|
5835
|
+
return Bn("/", t);
|
|
5753
5836
|
},
|
|
5754
5837
|
parse: function(t) {
|
|
5755
5838
|
W(t);
|
|
@@ -5777,22 +5860,22 @@ var ot = {
|
|
|
5777
5860
|
win32: null,
|
|
5778
5861
|
posix: null
|
|
5779
5862
|
};
|
|
5780
|
-
|
|
5781
|
-
var Le =
|
|
5782
|
-
const
|
|
5863
|
+
ct.posix = ct;
|
|
5864
|
+
var Le = ct, Bt = /* @__PURE__ */ ((i) => (i.start = "start", i.left = "left", i.right = "right", i.justify = "justify", i))(Bt || {}), vt = /* @__PURE__ */ ((i) => (i.sepia = "sepia", i.night = "night", i.custom = "custom", i))(vt || {});
|
|
5865
|
+
const Tt = {
|
|
5783
5866
|
range: [0.7, 4],
|
|
5784
5867
|
step: 0.05
|
|
5785
|
-
},
|
|
5868
|
+
}, jt = {
|
|
5786
5869
|
range: [100, 1e3],
|
|
5787
5870
|
step: 100
|
|
5788
|
-
},
|
|
5871
|
+
}, Vt = {
|
|
5789
5872
|
range: [50, 250],
|
|
5790
5873
|
step: 10
|
|
5791
5874
|
};
|
|
5792
|
-
function
|
|
5875
|
+
function En(i, t) {
|
|
5793
5876
|
return i == null || t == null || i <= t ? i : void 0;
|
|
5794
5877
|
}
|
|
5795
|
-
function
|
|
5878
|
+
function wn(i, t) {
|
|
5796
5879
|
return i == null || t == null || i >= t ? i : void 0;
|
|
5797
5880
|
}
|
|
5798
5881
|
function N(i) {
|
|
@@ -5801,18 +5884,18 @@ function N(i) {
|
|
|
5801
5884
|
function C(i) {
|
|
5802
5885
|
return typeof i == "boolean" || i == null ? i : void 0;
|
|
5803
5886
|
}
|
|
5804
|
-
function
|
|
5887
|
+
function Dt(i, t) {
|
|
5805
5888
|
if (i !== void 0)
|
|
5806
5889
|
return i === null ? null : t[i] !== void 0 ? i : void 0;
|
|
5807
5890
|
}
|
|
5808
|
-
function
|
|
5891
|
+
function gt(i) {
|
|
5809
5892
|
return typeof i == "boolean" || typeof i == "number" && i >= 0 ? i : i === null ? null : void 0;
|
|
5810
5893
|
}
|
|
5811
5894
|
function F(i) {
|
|
5812
5895
|
if (i !== void 0)
|
|
5813
5896
|
return i === null ? null : i < 0 ? void 0 : i;
|
|
5814
5897
|
}
|
|
5815
|
-
function
|
|
5898
|
+
function dt(i, t) {
|
|
5816
5899
|
if (i === void 0)
|
|
5817
5900
|
return;
|
|
5818
5901
|
if (i === null)
|
|
@@ -5820,12 +5903,12 @@ function lt(i, t) {
|
|
|
5820
5903
|
const e = Math.min(...t), A = Math.max(...t);
|
|
5821
5904
|
return i >= e && i <= A ? i : void 0;
|
|
5822
5905
|
}
|
|
5823
|
-
function
|
|
5906
|
+
function Lt(i, t) {
|
|
5824
5907
|
return i === void 0 ? t : i;
|
|
5825
5908
|
}
|
|
5826
|
-
class
|
|
5909
|
+
class Et {
|
|
5827
5910
|
constructor(t = {}) {
|
|
5828
|
-
this.backgroundColor = N(t.backgroundColor), this.blendFilter = C(t.blendFilter), this.constraint = F(t.constraint), this.columnCount = F(t.columnCount), this.darkenFilter =
|
|
5911
|
+
this.backgroundColor = N(t.backgroundColor), this.blendFilter = C(t.blendFilter), this.constraint = F(t.constraint), this.columnCount = F(t.columnCount), this.darkenFilter = gt(t.darkenFilter), this.deprecatedFontSize = C(t.deprecatedFontSize), this.fontFamily = N(t.fontFamily), this.fontSize = dt(t.fontSize, Tt.range), this.fontSizeNormalize = C(t.fontSizeNormalize), this.fontOpticalSizing = C(t.fontOpticalSizing), this.fontWeight = dt(t.fontWeight, jt.range), this.fontWidth = dt(t.fontWidth, Vt.range), this.hyphens = C(t.hyphens), this.invertFilter = gt(t.invertFilter), this.invertGaijiFilter = gt(t.invertGaijiFilter), this.iOSPatch = C(t.iOSPatch), this.iPadOSPatch = C(t.iPadOSPatch), this.letterSpacing = F(t.letterSpacing), this.ligatures = C(t.ligatures), this.lineHeight = F(t.lineHeight), this.linkColor = N(t.linkColor), this.noRuby = C(t.noRuby), this.pageGutter = F(t.pageGutter), this.paragraphIndent = F(t.paragraphIndent), this.paragraphSpacing = F(t.paragraphSpacing), this.scroll = C(t.scroll), this.scrollPaddingTop = F(t.scrollPaddingTop), this.scrollPaddingBottom = F(t.scrollPaddingBottom), this.selectionBackgroundColor = N(t.selectionBackgroundColor), this.selectionTextColor = N(t.selectionTextColor), this.textAlign = Dt(t.textAlign, Bt), this.textColor = N(t.textColor), this.textNormalization = C(t.textNormalization), this.theme = Dt(t.theme, vt), this.visitedColor = N(t.visitedColor), this.wordSpacing = F(t.wordSpacing), this.optimalLineLength = F(t.optimalLineLength), this.maximalLineLength = F(t.maximalLineLength), this.minimalLineLength = F(t.minimalLineLength);
|
|
5829
5912
|
}
|
|
5830
5913
|
static serialize(t) {
|
|
5831
5914
|
const { ...e } = t;
|
|
@@ -5834,7 +5917,7 @@ class mt {
|
|
|
5834
5917
|
static deserialize(t) {
|
|
5835
5918
|
try {
|
|
5836
5919
|
const e = JSON.parse(t);
|
|
5837
|
-
return new
|
|
5920
|
+
return new Et(e);
|
|
5838
5921
|
} catch (e) {
|
|
5839
5922
|
return console.error("Failed to deserialize preferences:", e), null;
|
|
5840
5923
|
}
|
|
@@ -5843,12 +5926,12 @@ class mt {
|
|
|
5843
5926
|
const e = { ...this };
|
|
5844
5927
|
for (const A of Object.keys(t))
|
|
5845
5928
|
t[A] !== void 0 && (A !== "maximalLineLength" || t[A] === null || t[A] >= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (A !== "minimalLineLength" || t[A] === null || t[A] <= (t.optimalLineLength ?? e.optimalLineLength ?? 65)) && (e[A] = t[A]);
|
|
5846
|
-
return new
|
|
5929
|
+
return new Et(e);
|
|
5847
5930
|
}
|
|
5848
5931
|
}
|
|
5849
|
-
class
|
|
5932
|
+
class In {
|
|
5850
5933
|
constructor(t) {
|
|
5851
|
-
this.backgroundColor = N(t.backgroundColor) || null, this.blendFilter = C(t.blendFilter) ?? !1, this.constraint = F(t.constraint) || 0, this.columnCount = F(t.columnCount) || null, this.darkenFilter =
|
|
5934
|
+
this.backgroundColor = N(t.backgroundColor) || null, this.blendFilter = C(t.blendFilter) ?? !1, this.constraint = F(t.constraint) || 0, this.columnCount = F(t.columnCount) || null, this.darkenFilter = gt(t.darkenFilter) ?? !1, this.deprecatedFontSize = C(t.deprecatedFontSize), (this.deprecatedFontSize === !1 || this.deprecatedFontSize === null) && (this.deprecatedFontSize = !CSS.supports("zoom", "1")), this.fontFamily = N(t.fontFamily) || null, this.fontSize = dt(t.fontSize, Tt.range) || 1, this.fontSizeNormalize = C(t.fontSizeNormalize) ?? !1, this.fontOpticalSizing = C(t.fontOpticalSizing) ?? null, this.fontWeight = dt(t.fontWeight, jt.range) || null, this.fontWidth = dt(t.fontWidth, Vt.range) || null, this.hyphens = C(t.hyphens) ?? null, this.invertFilter = gt(t.invertFilter) ?? !1, this.invertGaijiFilter = gt(t.invertGaijiFilter) ?? !1, this.iOSPatch = t.iOSPatch === !1 ? !1 : (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile", this.iPadOSPatch = t.iPadOSPatch === !1 ? !1 : O.OS.iPadOS && O.iOSRequest === "desktop", this.letterSpacing = F(t.letterSpacing) || null, this.ligatures = C(t.ligatures) ?? null, this.lineHeight = F(t.lineHeight) || null, this.linkColor = N(t.linkColor) || null, this.noRuby = C(t.noRuby) ?? !1, this.pageGutter = Lt(F(t.pageGutter), 20), this.paragraphIndent = F(t.paragraphIndent) ?? null, this.paragraphSpacing = F(t.paragraphSpacing) ?? null, this.scroll = C(t.scroll) ?? !1, this.scrollPaddingTop = F(t.scrollPaddingTop) ?? null, this.scrollPaddingBottom = F(t.scrollPaddingBottom) ?? null, this.selectionBackgroundColor = N(t.selectionBackgroundColor) || null, this.selectionTextColor = N(t.selectionTextColor) || null, this.textAlign = Dt(t.textAlign, Bt) || null, this.textColor = N(t.textColor) || null, this.textNormalization = C(t.textNormalization) ?? !1, this.theme = Dt(t.theme, vt) || null, this.visitedColor = N(t.visitedColor) || null, this.wordSpacing = F(t.wordSpacing) || null, this.optimalLineLength = F(t.optimalLineLength) || 65, this.maximalLineLength = Lt(wn(t.maximalLineLength, this.optimalLineLength), 80), this.minimalLineLength = Lt(En(t.minimalLineLength, this.optimalLineLength), 40);
|
|
5852
5935
|
}
|
|
5853
5936
|
}
|
|
5854
5937
|
class Q {
|
|
@@ -5876,7 +5959,7 @@ class Q {
|
|
|
5876
5959
|
this._value = null;
|
|
5877
5960
|
}
|
|
5878
5961
|
}
|
|
5879
|
-
class
|
|
5962
|
+
class k extends Q {
|
|
5880
5963
|
set value(t) {
|
|
5881
5964
|
this._value = t, this._onChange(this._value);
|
|
5882
5965
|
}
|
|
@@ -5977,13 +6060,13 @@ class z extends Q {
|
|
|
5977
6060
|
this._value = null;
|
|
5978
6061
|
}
|
|
5979
6062
|
}
|
|
5980
|
-
const
|
|
5981
|
-
RS__backgroundColor:
|
|
5982
|
-
RS__textColor:
|
|
5983
|
-
RS__linkColor:
|
|
5984
|
-
RS__visitedColor:
|
|
5985
|
-
RS__selectionBackgroundColor:
|
|
5986
|
-
RS__selectionTextColor:
|
|
6063
|
+
const Fn = "#FFFFFF", Un = "#121212", Cn = "#0000EE", yn = "#551A8B", Rn = "#b4d8fe", Qn = "inherit", rt = {
|
|
6064
|
+
RS__backgroundColor: Fn,
|
|
6065
|
+
RS__textColor: Un,
|
|
6066
|
+
RS__linkColor: Cn,
|
|
6067
|
+
RS__visitedColor: yn,
|
|
6068
|
+
RS__selectionBackgroundColor: Rn,
|
|
6069
|
+
RS__selectionTextColor: Qn
|
|
5987
6070
|
};
|
|
5988
6071
|
class Xe {
|
|
5989
6072
|
constructor(t, e, A) {
|
|
@@ -5991,7 +6074,7 @@ class Xe {
|
|
|
5991
6074
|
this.preferences = t, this.settings = e, this.metadata = A, this.layout = ((n = this.metadata) == null ? void 0 : n.effectiveLayout) || p.reflowable;
|
|
5992
6075
|
}
|
|
5993
6076
|
clear() {
|
|
5994
|
-
this.preferences = new
|
|
6077
|
+
this.preferences = new Et({ optimalLineLength: 65 });
|
|
5995
6078
|
}
|
|
5996
6079
|
updatePreference(t, e) {
|
|
5997
6080
|
this.preferences[t] = e;
|
|
@@ -5999,7 +6082,7 @@ class Xe {
|
|
|
5999
6082
|
get backgroundColor() {
|
|
6000
6083
|
return new Q({
|
|
6001
6084
|
initialValue: this.preferences.backgroundColor,
|
|
6002
|
-
effectiveValue: this.settings.backgroundColor ||
|
|
6085
|
+
effectiveValue: this.settings.backgroundColor || rt.RS__backgroundColor,
|
|
6003
6086
|
isEffective: this.preferences.backgroundColor !== null,
|
|
6004
6087
|
onChange: (t) => {
|
|
6005
6088
|
this.updatePreference("backgroundColor", t || null);
|
|
@@ -6007,7 +6090,7 @@ class Xe {
|
|
|
6007
6090
|
});
|
|
6008
6091
|
}
|
|
6009
6092
|
get blendFilter() {
|
|
6010
|
-
return new
|
|
6093
|
+
return new k({
|
|
6011
6094
|
initialValue: this.preferences.blendFilter,
|
|
6012
6095
|
effectiveValue: this.settings.blendFilter || !1,
|
|
6013
6096
|
isEffective: this.preferences.blendFilter !== null,
|
|
@@ -6049,7 +6132,7 @@ class Xe {
|
|
|
6049
6132
|
});
|
|
6050
6133
|
}
|
|
6051
6134
|
get deprecatedFontSize() {
|
|
6052
|
-
return new
|
|
6135
|
+
return new k({
|
|
6053
6136
|
initialValue: this.preferences.deprecatedFontSize,
|
|
6054
6137
|
effectiveValue: CSS.supports("zoom", "1") ? this.settings.deprecatedFontSize || !1 : !0,
|
|
6055
6138
|
isEffective: this.layout !== p.fixed,
|
|
@@ -6076,12 +6159,12 @@ class Xe {
|
|
|
6076
6159
|
onChange: (t) => {
|
|
6077
6160
|
this.updatePreference("fontSize", t || null);
|
|
6078
6161
|
},
|
|
6079
|
-
supportedRange:
|
|
6080
|
-
step:
|
|
6162
|
+
supportedRange: Tt.range,
|
|
6163
|
+
step: Tt.step
|
|
6081
6164
|
});
|
|
6082
6165
|
}
|
|
6083
6166
|
get fontSizeNormalize() {
|
|
6084
|
-
return new
|
|
6167
|
+
return new k({
|
|
6085
6168
|
initialValue: this.preferences.fontSizeNormalize,
|
|
6086
6169
|
effectiveValue: this.settings.fontSizeNormalize || !1,
|
|
6087
6170
|
isEffective: this.layout !== p.fixed && this.preferences.fontSizeNormalize !== null,
|
|
@@ -6091,7 +6174,7 @@ class Xe {
|
|
|
6091
6174
|
});
|
|
6092
6175
|
}
|
|
6093
6176
|
get fontOpticalSizing() {
|
|
6094
|
-
return new
|
|
6177
|
+
return new k({
|
|
6095
6178
|
initialValue: this.preferences.fontOpticalSizing,
|
|
6096
6179
|
effectiveValue: this.settings.fontOpticalSizing || !0,
|
|
6097
6180
|
isEffective: this.layout !== p.fixed && this.preferences.fontOpticalSizing !== null,
|
|
@@ -6108,8 +6191,8 @@ class Xe {
|
|
|
6108
6191
|
onChange: (t) => {
|
|
6109
6192
|
this.updatePreference("fontWeight", t || null);
|
|
6110
6193
|
},
|
|
6111
|
-
supportedRange:
|
|
6112
|
-
step:
|
|
6194
|
+
supportedRange: jt.range,
|
|
6195
|
+
step: jt.step
|
|
6113
6196
|
});
|
|
6114
6197
|
}
|
|
6115
6198
|
get fontWidth() {
|
|
@@ -6120,13 +6203,13 @@ class Xe {
|
|
|
6120
6203
|
onChange: (t) => {
|
|
6121
6204
|
this.updatePreference("fontWidth", t || null);
|
|
6122
6205
|
},
|
|
6123
|
-
supportedRange:
|
|
6124
|
-
step:
|
|
6206
|
+
supportedRange: Vt.range,
|
|
6207
|
+
step: Vt.step
|
|
6125
6208
|
});
|
|
6126
6209
|
}
|
|
6127
6210
|
get hyphens() {
|
|
6128
6211
|
var t;
|
|
6129
|
-
return new
|
|
6212
|
+
return new k({
|
|
6130
6213
|
initialValue: this.preferences.hyphens,
|
|
6131
6214
|
effectiveValue: this.settings.hyphens || !1,
|
|
6132
6215
|
isEffective: this.layout !== p.fixed && ((t = this.metadata) == null ? void 0 : t.effectiveReadingProgression) === R.ltr && this.preferences.hyphens !== null,
|
|
@@ -6160,7 +6243,7 @@ class Xe {
|
|
|
6160
6243
|
});
|
|
6161
6244
|
}
|
|
6162
6245
|
get iOSPatch() {
|
|
6163
|
-
return new
|
|
6246
|
+
return new k({
|
|
6164
6247
|
initialValue: this.preferences.iOSPatch,
|
|
6165
6248
|
effectiveValue: this.settings.iOSPatch || !1,
|
|
6166
6249
|
isEffective: this.layout !== p.fixed,
|
|
@@ -6170,7 +6253,7 @@ class Xe {
|
|
|
6170
6253
|
});
|
|
6171
6254
|
}
|
|
6172
6255
|
get iPadOSPatch() {
|
|
6173
|
-
return new
|
|
6256
|
+
return new k({
|
|
6174
6257
|
initialValue: this.preferences.iPadOSPatch,
|
|
6175
6258
|
effectiveValue: this.settings.iPadOSPatch || !1,
|
|
6176
6259
|
isEffective: this.layout !== p.fixed,
|
|
@@ -6193,7 +6276,7 @@ class Xe {
|
|
|
6193
6276
|
}
|
|
6194
6277
|
get ligatures() {
|
|
6195
6278
|
var t, e;
|
|
6196
|
-
return new
|
|
6279
|
+
return new k({
|
|
6197
6280
|
initialValue: this.preferences.ligatures,
|
|
6198
6281
|
effectiveValue: this.settings.ligatures || !0,
|
|
6199
6282
|
isEffective: this.layout !== p.fixed && ((e = (t = this.metadata) == null ? void 0 : t.languages) == null ? void 0 : e.some((A) => A === "ar" || A === "fa")) && this.preferences.ligatures !== null || !1,
|
|
@@ -6217,7 +6300,7 @@ class Xe {
|
|
|
6217
6300
|
get linkColor() {
|
|
6218
6301
|
return new Q({
|
|
6219
6302
|
initialValue: this.preferences.linkColor,
|
|
6220
|
-
effectiveValue: this.settings.linkColor ||
|
|
6303
|
+
effectiveValue: this.settings.linkColor || rt.RS__linkColor,
|
|
6221
6304
|
isEffective: this.layout !== p.fixed && this.preferences.linkColor !== null,
|
|
6222
6305
|
onChange: (t) => {
|
|
6223
6306
|
this.updatePreference("linkColor", t || null);
|
|
@@ -6250,7 +6333,7 @@ class Xe {
|
|
|
6250
6333
|
}
|
|
6251
6334
|
get noRuby() {
|
|
6252
6335
|
var t, e;
|
|
6253
|
-
return new
|
|
6336
|
+
return new k({
|
|
6254
6337
|
initialValue: this.preferences.noRuby,
|
|
6255
6338
|
effectiveValue: this.settings.noRuby || !1,
|
|
6256
6339
|
isEffective: this.layout !== p.fixed && ((e = (t = this.metadata) == null ? void 0 : t.languages) == null ? void 0 : e.includes("ja")) || !1,
|
|
@@ -6306,7 +6389,7 @@ class Xe {
|
|
|
6306
6389
|
});
|
|
6307
6390
|
}
|
|
6308
6391
|
get scroll() {
|
|
6309
|
-
return new
|
|
6392
|
+
return new k({
|
|
6310
6393
|
initialValue: this.preferences.scroll,
|
|
6311
6394
|
effectiveValue: this.settings.scroll || !1,
|
|
6312
6395
|
isEffective: this.layout !== p.fixed,
|
|
@@ -6361,7 +6444,7 @@ class Xe {
|
|
|
6361
6444
|
get selectionBackgroundColor() {
|
|
6362
6445
|
return new Q({
|
|
6363
6446
|
initialValue: this.preferences.selectionBackgroundColor,
|
|
6364
|
-
effectiveValue: this.settings.selectionBackgroundColor ||
|
|
6447
|
+
effectiveValue: this.settings.selectionBackgroundColor || rt.RS__selectionBackgroundColor,
|
|
6365
6448
|
isEffective: this.layout !== p.fixed && this.preferences.selectionBackgroundColor !== null,
|
|
6366
6449
|
onChange: (t) => {
|
|
6367
6450
|
this.updatePreference("selectionBackgroundColor", t || null);
|
|
@@ -6371,7 +6454,7 @@ class Xe {
|
|
|
6371
6454
|
get selectionTextColor() {
|
|
6372
6455
|
return new Q({
|
|
6373
6456
|
initialValue: this.preferences.selectionTextColor,
|
|
6374
|
-
effectiveValue: this.settings.selectionTextColor ||
|
|
6457
|
+
effectiveValue: this.settings.selectionTextColor || rt.RS__selectionTextColor,
|
|
6375
6458
|
isEffective: this.layout !== p.fixed && this.preferences.selectionTextColor !== null,
|
|
6376
6459
|
onChange: (t) => {
|
|
6377
6460
|
this.updatePreference("selectionTextColor", t || null);
|
|
@@ -6381,18 +6464,18 @@ class Xe {
|
|
|
6381
6464
|
get textAlign() {
|
|
6382
6465
|
return new Oe({
|
|
6383
6466
|
initialValue: this.preferences.textAlign,
|
|
6384
|
-
effectiveValue: this.settings.textAlign ||
|
|
6467
|
+
effectiveValue: this.settings.textAlign || Bt.start,
|
|
6385
6468
|
isEffective: this.layout !== p.fixed && this.preferences.textAlign !== null,
|
|
6386
6469
|
onChange: (t) => {
|
|
6387
6470
|
this.updatePreference("textAlign", t || null);
|
|
6388
6471
|
},
|
|
6389
|
-
supportedValues: Object.values(
|
|
6472
|
+
supportedValues: Object.values(Bt)
|
|
6390
6473
|
});
|
|
6391
6474
|
}
|
|
6392
6475
|
get textColor() {
|
|
6393
6476
|
return new Q({
|
|
6394
6477
|
initialValue: this.preferences.textColor,
|
|
6395
|
-
effectiveValue: this.settings.textColor ||
|
|
6478
|
+
effectiveValue: this.settings.textColor || rt.RS__textColor,
|
|
6396
6479
|
isEffective: this.layout !== p.fixed && this.preferences.textColor !== null,
|
|
6397
6480
|
onChange: (t) => {
|
|
6398
6481
|
this.updatePreference("textColor", t || null);
|
|
@@ -6400,7 +6483,7 @@ class Xe {
|
|
|
6400
6483
|
});
|
|
6401
6484
|
}
|
|
6402
6485
|
get textNormalization() {
|
|
6403
|
-
return new
|
|
6486
|
+
return new k({
|
|
6404
6487
|
initialValue: this.preferences.textNormalization,
|
|
6405
6488
|
effectiveValue: this.settings.textNormalization || !1,
|
|
6406
6489
|
isEffective: this.layout !== p.fixed,
|
|
@@ -6417,13 +6500,13 @@ class Xe {
|
|
|
6417
6500
|
onChange: (t) => {
|
|
6418
6501
|
this.updatePreference("theme", t || null);
|
|
6419
6502
|
},
|
|
6420
|
-
supportedValues: Object.values(
|
|
6503
|
+
supportedValues: Object.values(vt)
|
|
6421
6504
|
});
|
|
6422
6505
|
}
|
|
6423
6506
|
get visitedColor() {
|
|
6424
6507
|
return new Q({
|
|
6425
6508
|
initialValue: this.preferences.visitedColor,
|
|
6426
|
-
effectiveValue: this.settings.visitedColor ||
|
|
6509
|
+
effectiveValue: this.settings.visitedColor || rt.RS__visitedColor,
|
|
6427
6510
|
isEffective: this.layout !== p.fixed && this.preferences.visitedColor !== null,
|
|
6428
6511
|
onChange: (t) => {
|
|
6429
6512
|
this.updatePreference("visitedColor", t || null);
|
|
@@ -6448,11 +6531,11 @@ class Ze {
|
|
|
6448
6531
|
this.backgroundColor = t.backgroundColor || e.backgroundColor || null, this.blendFilter = typeof t.blendFilter == "boolean" ? t.blendFilter : e.blendFilter ?? null, this.columnCount = t.columnCount !== void 0 ? t.columnCount : e.columnCount !== void 0 ? e.columnCount : null, this.constraint = t.constraint || e.constraint, this.darkenFilter = typeof t.darkenFilter == "boolean" ? t.darkenFilter : e.darkenFilter ?? null, this.deprecatedFontSize = typeof t.deprecatedFontSize == "boolean" ? t.deprecatedFontSize : e.deprecatedFontSize ?? null, this.fontFamily = t.fontFamily || e.fontFamily || null, this.fontSize = t.fontSize !== void 0 ? t.fontSize : e.fontSize !== void 0 ? e.fontSize : null, this.fontSizeNormalize = typeof t.fontSizeNormalize == "boolean" ? t.fontSizeNormalize : e.fontSizeNormalize ?? null, this.fontOpticalSizing = typeof t.fontOpticalSizing == "boolean" ? t.fontOpticalSizing : e.fontOpticalSizing ?? null, this.fontWeight = t.fontWeight !== void 0 ? t.fontWeight : e.fontWeight !== void 0 ? e.fontWeight : null, this.fontWidth = t.fontWidth !== void 0 ? t.fontWidth : e.fontWidth !== void 0 ? e.fontWidth : null, this.hyphens = typeof t.hyphens == "boolean" ? t.hyphens : e.hyphens ?? null, this.invertFilter = typeof t.invertFilter == "boolean" ? t.invertFilter : e.invertFilter ?? null, this.invertGaijiFilter = typeof t.invertGaijiFilter == "boolean" ? t.invertGaijiFilter : e.invertGaijiFilter ?? null, this.iOSPatch = this.deprecatedFontSize || t.iOSPatch === !1 ? !1 : t.iOSPatch === !0 ? (O.OS.iOS || O.OS.iPadOS) && O.iOSRequest === "mobile" : e.iOSPatch, this.iPadOSPatch = this.deprecatedFontSize || t.iPadOSPatch === !1 ? !1 : t.iPadOSPatch === !0 ? O.OS.iPadOS && O.iOSRequest === "desktop" : e.iPadOSPatch, this.letterSpacing = t.letterSpacing !== void 0 ? t.letterSpacing : e.letterSpacing !== void 0 ? e.letterSpacing : null, this.ligatures = typeof t.ligatures == "boolean" ? t.ligatures : e.ligatures ?? null, this.lineHeight = t.lineHeight !== void 0 ? t.lineHeight : e.lineHeight !== void 0 ? e.lineHeight : null, this.linkColor = t.linkColor || e.linkColor || null, this.maximalLineLength = t.maximalLineLength === null ? null : t.maximalLineLength || e.maximalLineLength || null, this.minimalLineLength = t.minimalLineLength === null ? null : t.minimalLineLength || e.minimalLineLength || null, this.noRuby = typeof t.noRuby == "boolean" ? t.noRuby : e.noRuby ?? null, this.optimalLineLength = t.optimalLineLength || e.optimalLineLength, this.pageGutter = t.pageGutter !== void 0 ? t.pageGutter : e.pageGutter !== void 0 ? e.pageGutter : null, this.paragraphIndent = t.paragraphIndent !== void 0 ? t.paragraphIndent : e.paragraphIndent !== void 0 ? e.paragraphIndent : null, this.paragraphSpacing = t.paragraphSpacing !== void 0 ? t.paragraphSpacing : e.paragraphSpacing !== void 0 ? e.paragraphSpacing : null, this.scroll = typeof t.scroll == "boolean" ? t.scroll : e.scroll ?? null, this.scrollPaddingTop = t.scrollPaddingTop !== void 0 ? t.scrollPaddingTop : e.scrollPaddingTop !== void 0 ? e.scrollPaddingTop : null, this.scrollPaddingBottom = t.scrollPaddingBottom !== void 0 ? t.scrollPaddingBottom : e.scrollPaddingBottom !== void 0 ? e.scrollPaddingBottom : null, this.selectionBackgroundColor = t.selectionBackgroundColor || e.selectionBackgroundColor || null, this.selectionTextColor = t.selectionTextColor || e.selectionTextColor || null, this.textAlign = t.textAlign || e.textAlign || null, this.textColor = t.textColor || e.textColor || null, this.textNormalization = typeof t.textNormalization == "boolean" ? t.textNormalization : e.textNormalization ?? null, this.theme = t.theme || e.theme || null, this.visitedColor = t.visitedColor || e.visitedColor || null, this.wordSpacing = t.wordSpacing !== void 0 ? t.wordSpacing : e.wordSpacing !== void 0 ? e.wordSpacing : null;
|
|
6449
6532
|
}
|
|
6450
6533
|
}
|
|
6451
|
-
function
|
|
6534
|
+
function Rt(i) {
|
|
6452
6535
|
const t = getComputedStyle(i), e = parseFloat(t.paddingLeft || "0"), A = parseFloat(t.paddingRight || "0");
|
|
6453
6536
|
return i.clientWidth - e - A;
|
|
6454
6537
|
}
|
|
6455
|
-
class
|
|
6538
|
+
class jA {
|
|
6456
6539
|
constructor() {
|
|
6457
6540
|
}
|
|
6458
6541
|
toFlag(t) {
|
|
@@ -6479,7 +6562,7 @@ class xA {
|
|
|
6479
6562
|
return `${t}rem`;
|
|
6480
6563
|
}
|
|
6481
6564
|
}
|
|
6482
|
-
class
|
|
6565
|
+
class VA extends jA {
|
|
6483
6566
|
constructor(t) {
|
|
6484
6567
|
super(), this.a11yNormalize = t.a11yNormalize ?? null, this.appearance = t.appearance ?? 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;
|
|
6485
6568
|
}
|
|
@@ -6488,7 +6571,7 @@ class TA extends xA {
|
|
|
6488
6571
|
return this.a11yNormalize && (t["--USER__a11yNormalize"] = this.toFlag("a11y")), this.appearance && (t["--USER__appearance"] = this.toFlag(this.appearance)), 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;
|
|
6489
6572
|
}
|
|
6490
6573
|
}
|
|
6491
|
-
class
|
|
6574
|
+
class zn extends jA {
|
|
6492
6575
|
constructor(t) {
|
|
6493
6576
|
super(), this.backgroundColor = t.backgroundColor ?? null, this.baseFontFamily = t.baseFontFamily ?? null, this.baseFontSize = t.baseFontSize ?? null, this.baseLineHeight = t.baseLineHeight ?? null, this.boxSizingMedia = t.boxSizingMedia ?? null, this.boxSizingTable = t.boxSizingTable ?? null, this.colWidth = t.colWidth ?? null, this.colCount = t.colCount ?? null, this.colGap = t.colGap ?? null, this.codeFontFamily = t.codeFontFamily ?? null, this.compFontFamily = t.compFontFamily ?? null, this.defaultLineLength = t.defaultLineLength ?? null, this.flowSpacing = t.flowSpacing ?? null, this.humanistTf = t.humanistTf ?? null, this.linkColor = t.linkColor ?? null, this.maxMediaWidth = t.maxMediaWidth ?? null, this.maxMediaHeight = t.maxMediaHeight ?? null, this.modernTf = t.modernTf ?? null, this.monospaceTf = t.monospaceTf ?? null, this.noOverflow = t.noOverflow ?? null, this.noVerticalPagination = t.noVerticalPagination ?? null, this.oldStyleTf = t.oldStyleTf ?? null, this.pageGutter = t.pageGutter ?? null, this.paraIndent = t.paraIndent ?? null, this.paraSpacing = t.paraSpacing ?? null, this.primaryColor = t.primaryColor ?? null, this.scrollPaddingBottom = t.scrollPaddingBottom ?? null, this.scrollPaddingTop = t.scrollPaddingTop ?? null, this.sansSerifJa = t.sansSerifJa ?? null, this.sansSerifJaV = t.sansSerifJaV ?? null, this.sansTf = t.sansTf ?? null, this.secondaryColor = t.secondaryColor ?? null, this.selectionBackgroundColor = t.selectionBackgroundColor ?? null, this.selectionTextColor = t.selectionTextColor ?? null, this.serifJa = t.serifJa ?? null, this.serifJaV = t.serifJaV ?? null, this.textColor = t.textColor ?? null, this.typeScale = t.typeScale ?? null, this.visitedColor = t.visitedColor ?? null;
|
|
6494
6577
|
}
|
|
@@ -6497,9 +6580,9 @@ class yn extends xA {
|
|
|
6497
6580
|
return this.backgroundColor && (t["--RS__backgroundColor"] = this.backgroundColor), this.baseFontFamily && (t["--RS__baseFontFamily"] = this.baseFontFamily), this.baseFontSize != null && (t["--RS__baseFontSize"] = this.toRem(this.baseFontSize)), this.baseLineHeight != null && (t["--RS__baseLineHeight"] = this.toUnitless(this.baseLineHeight)), this.boxSizingMedia && (t["--RS__boxSizingMedia"] = this.boxSizingMedia), this.boxSizingTable && (t["--RS__boxSizingTable"] = this.boxSizingTable), this.colWidth != null && (t["--RS__colWidth"] = this.colWidth), this.colCount != null && (t["--RS__colCount"] = this.toUnitless(this.colCount)), this.colGap != null && (t["--RS__colGap"] = this.toPx(this.colGap)), this.codeFontFamily && (t["--RS__codeFontFamily"] = this.codeFontFamily), this.compFontFamily && (t["--RS__compFontFamily"] = this.compFontFamily), this.defaultLineLength != null && (t["--RS__defaultLineLength"] = this.toPx(this.defaultLineLength)), this.flowSpacing != null && (t["--RS__flowSpacing"] = this.toRem(this.flowSpacing)), this.humanistTf && (t["--RS__humanistTf"] = this.humanistTf), this.linkColor && (t["--RS__linkColor"] = this.linkColor), this.maxMediaWidth && (t["--RS__maxMediaWidth"] = this.toVw(this.maxMediaWidth)), this.maxMediaHeight && (t["--RS__maxMediaHeight"] = this.toVh(this.maxMediaHeight)), this.modernTf && (t["--RS__modernTf"] = this.modernTf), this.monospaceTf && (t["--RS__monospaceTf"] = this.monospaceTf), this.noOverflow && (t["--RS__disableOverflow"] = this.toFlag("noOverflow")), this.noVerticalPagination && (t["--RS__disablePagination"] = this.toFlag("noVerticalPagination")), this.oldStyleTf && (t["--RS__oldStyleTf"] = this.oldStyleTf), this.pageGutter != null && (t["--RS__pageGutter"] = this.toPx(this.pageGutter)), this.paraIndent != null && (t["--RS__paraIndent"] = this.toRem(this.paraIndent)), this.paraSpacing != null && (t["--RS__paraSpacing"] = this.toRem(this.paraSpacing)), this.primaryColor && (t["--RS__primaryColor"] = this.primaryColor), this.sansSerifJa && (t["--RS__sans-serif-ja"] = this.sansSerifJa), this.sansSerifJaV && (t["--RS__sans-serif-ja-v"] = this.sansSerifJaV), this.sansTf && (t["--RS__sansTf"] = this.sansTf), this.scrollPaddingBottom != null && (t["--RS__scrollPaddingBottom"] = this.toPx(this.scrollPaddingBottom)), this.scrollPaddingTop != null && (t["--RS__scrollPaddingTop"] = this.toPx(this.scrollPaddingTop)), this.secondaryColor && (t["--RS__secondaryColor"] = this.secondaryColor), this.selectionBackgroundColor && (t["--RS__selectionBackgroundColor"] = this.selectionBackgroundColor), this.selectionTextColor && (t["--RS__selectionTextColor"] = this.selectionTextColor), this.serifJa && (t["--RS__serif-ja"] = this.serifJa), this.serifJaV && (t["--RS__serif-ja-v"] = this.serifJaV), this.textColor && (t["--RS__textColor"] = this.textColor), this.typeScale && (t["--RS__typeScale"] = this.toUnitless(this.typeScale)), this.visitedColor && (t["--RS__visitedColor"] = this.visitedColor), t;
|
|
6498
6581
|
}
|
|
6499
6582
|
}
|
|
6500
|
-
class
|
|
6583
|
+
class Yn {
|
|
6501
6584
|
constructor(t) {
|
|
6502
|
-
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth =
|
|
6585
|
+
this.rsProperties = t.rsProperties, this.userProperties = t.userProperties, this.lineLengths = t.lineLengths, this.container = t.container, this.containerParent = t.container.parentElement || document.documentElement, this.constraint = t.constraint, this.cachedColCount = t.userProperties.colCount, this.effectiveContainerWidth = Rt(this.containerParent);
|
|
6503
6586
|
}
|
|
6504
6587
|
update(t) {
|
|
6505
6588
|
this.cachedColCount = t.columnCount, t.constraint !== this.constraint && (this.constraint = t.constraint), t.pageGutter !== this.rsProperties.pageGutter && (this.rsProperties.pageGutter = t.pageGutter), t.scrollPaddingBottom !== this.rsProperties.scrollPaddingBottom && (this.rsProperties.scrollPaddingBottom = t.scrollPaddingBottom), t.scrollPaddingTop !== this.rsProperties.scrollPaddingTop && (this.rsProperties.scrollPaddingTop = t.scrollPaddingTop), this.lineLengths.update({
|
|
@@ -6548,7 +6631,7 @@ class Rn {
|
|
|
6548
6631
|
visitedColor: t.visitedColor,
|
|
6549
6632
|
wordSpacing: t.wordSpacing
|
|
6550
6633
|
};
|
|
6551
|
-
this.userProperties = new
|
|
6634
|
+
this.userProperties = new VA(A);
|
|
6552
6635
|
}
|
|
6553
6636
|
updateLayout(t, e, A, n) {
|
|
6554
6637
|
return A ?? this.userProperties.view === "scroll" ? this.computeScrollLength(t, e) : this.paginate(t, e, n);
|
|
@@ -6567,54 +6650,53 @@ class Rn {
|
|
|
6567
6650
|
// TODO: As scroll shows, the effective line-length
|
|
6568
6651
|
// should be the same as uncompensated when scale >= 1
|
|
6569
6652
|
paginate(t, e, A) {
|
|
6570
|
-
const n = Math.round(
|
|
6571
|
-
let
|
|
6653
|
+
const n = Math.round(Rt(this.containerParent) - this.constraint), r = this.getCompensatedMetrics(t, e), { zoomCompensation: s, optimal: o, minimal: a, maximal: l } = r, h = () => n >= o && l !== null ? Math.min(Math.round(l * s), n) : n;
|
|
6654
|
+
let c = 1, g = n;
|
|
6572
6655
|
if (A === void 0)
|
|
6573
6656
|
return {
|
|
6574
6657
|
colCount: void 0,
|
|
6575
|
-
effectiveContainerWidth:
|
|
6576
|
-
effectiveLineLength: Math.round(
|
|
6658
|
+
effectiveContainerWidth: g,
|
|
6659
|
+
effectiveLineLength: Math.round(g / c * s)
|
|
6577
6660
|
};
|
|
6578
6661
|
if (A === null)
|
|
6579
|
-
if (n
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
}
|
|
6662
|
+
if (n >= o && l !== null) {
|
|
6663
|
+
c = Math.floor(n / o);
|
|
6664
|
+
const m = Math.round(c * (l * s));
|
|
6665
|
+
g = Math.min(m, n);
|
|
6666
|
+
} else
|
|
6667
|
+
g = h();
|
|
6586
6668
|
else if (A > 1) {
|
|
6587
|
-
const
|
|
6588
|
-
if (n >=
|
|
6589
|
-
if (
|
|
6590
|
-
|
|
6669
|
+
const m = Math.round(A * (a !== null ? a : o));
|
|
6670
|
+
if (n >= m)
|
|
6671
|
+
if (c = A, l === null)
|
|
6672
|
+
g = n;
|
|
6591
6673
|
else {
|
|
6592
|
-
const
|
|
6593
|
-
|
|
6674
|
+
const M = Math.round(c * (l * s));
|
|
6675
|
+
g = Math.min(M, n);
|
|
6676
|
+
}
|
|
6677
|
+
else if (a !== null && n < Math.round(A * a))
|
|
6678
|
+
if (c = Math.floor(n / a), c <= 1)
|
|
6679
|
+
c = 1, g = h();
|
|
6680
|
+
else {
|
|
6681
|
+
const M = Math.round(c * (o * s));
|
|
6682
|
+
g = Math.min(M, n);
|
|
6594
6683
|
}
|
|
6595
6684
|
else {
|
|
6596
|
-
|
|
6597
|
-
const
|
|
6598
|
-
|
|
6599
|
-
}
|
|
6600
|
-
} else if (h = 1, n >= o)
|
|
6601
|
-
if (l === null)
|
|
6602
|
-
c = n;
|
|
6603
|
-
else {
|
|
6604
|
-
const g = Math.round(l * s);
|
|
6605
|
-
c = Math.min(g, n);
|
|
6685
|
+
c = A;
|
|
6686
|
+
const M = Math.round(c * (o * s));
|
|
6687
|
+
g = Math.min(M, n);
|
|
6606
6688
|
}
|
|
6607
|
-
else
|
|
6608
|
-
c =
|
|
6689
|
+
} else
|
|
6690
|
+
c = 1, g = h();
|
|
6609
6691
|
return {
|
|
6610
|
-
colCount:
|
|
6611
|
-
effectiveContainerWidth:
|
|
6612
|
-
effectiveLineLength: Math.round(
|
|
6692
|
+
colCount: c,
|
|
6693
|
+
effectiveContainerWidth: g,
|
|
6694
|
+
effectiveLineLength: Math.round(g / c / (t && t >= 1 ? t : 1) * s)
|
|
6613
6695
|
};
|
|
6614
6696
|
}
|
|
6615
6697
|
// This behaves as paginate where colCount = 1
|
|
6616
6698
|
computeScrollLength(t, e) {
|
|
6617
|
-
const A = Math.round(
|
|
6699
|
+
const A = Math.round(Rt(this.containerParent) - this.constraint), n = this.getCompensatedMetrics(t && (t < 1 || e) ? t : 1, e), r = n.zoomCompensation, s = n.optimal, o = n.maximal;
|
|
6618
6700
|
let a, l = A, h = Math.round(s * r);
|
|
6619
6701
|
if (o === null)
|
|
6620
6702
|
h = A;
|
|
@@ -6636,7 +6718,7 @@ class Rn {
|
|
|
6636
6718
|
this.userProperties.colCount = t.colCount, this.userProperties.lineLength = t.effectiveLineLength, this.effectiveContainerWidth = t.effectiveContainerWidth, this.container.style.width = `${this.effectiveContainerWidth}px`;
|
|
6637
6719
|
}
|
|
6638
6720
|
}
|
|
6639
|
-
const
|
|
6721
|
+
const Nn = (i) => ({
|
|
6640
6722
|
frameLoaded: i.frameLoaded || (() => {
|
|
6641
6723
|
}),
|
|
6642
6724
|
positionChanged: i.positionChanged || (() => {
|
|
@@ -6655,16 +6737,16 @@ const Qn = (i) => ({
|
|
|
6655
6737
|
textSelected: i.textSelected || (() => {
|
|
6656
6738
|
})
|
|
6657
6739
|
});
|
|
6658
|
-
class
|
|
6740
|
+
class DA extends Ai {
|
|
6659
6741
|
constructor(t, e, A, n = [], r = void 0, s = { preferences: {}, defaults: {} }) {
|
|
6660
6742
|
super(), this._preferencesEditor = null, this.reflowViewport = {
|
|
6661
6743
|
readingOrder: [],
|
|
6662
6744
|
progressions: /* @__PURE__ */ new Map(),
|
|
6663
6745
|
positions: null
|
|
6664
|
-
}, this.pub = e, this.container = t, this.listeners =
|
|
6665
|
-
rsProperties: new
|
|
6666
|
-
userProperties: new
|
|
6667
|
-
lineLengths: new
|
|
6746
|
+
}, this.pub = e, this.container = t, this.listeners = Nn(A), this.currentLocation = r, n.length && (this.positions = n), this._preferences = new Et(s.preferences), this._defaults = new In(s.defaults), this._settings = new Ze(this._preferences, this._defaults), this._css = new Yn({
|
|
6747
|
+
rsProperties: new zn({}),
|
|
6748
|
+
userProperties: new VA({}),
|
|
6749
|
+
lineLengths: new pt({
|
|
6668
6750
|
optimalChars: this._settings.optimalLineLength,
|
|
6669
6751
|
minChars: this._settings.minimalLineLength,
|
|
6670
6752
|
maxChars: this._settings.maximalLineLength,
|
|
@@ -6676,23 +6758,23 @@ class jA extends $A {
|
|
|
6676
6758
|
}),
|
|
6677
6759
|
container: t,
|
|
6678
6760
|
constraint: this._settings.constraint
|
|
6679
|
-
}), this._layout =
|
|
6761
|
+
}), this._layout = DA.determineLayout(e, !!this._settings.scroll), this.currentProgression = e.metadata.effectiveReadingProgression, this.resizeObserver = new ResizeObserver(() => this.ownerWindow.requestAnimationFrame(async () => await this.resizeHandler())), this.resizeObserver.observe(this.container.parentElement || document.documentElement);
|
|
6680
6762
|
}
|
|
6681
6763
|
static determineLayout(t, e) {
|
|
6682
6764
|
var n, r;
|
|
6683
6765
|
const A = t.metadata.effectiveLayout;
|
|
6684
|
-
return A === p.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || (r = (n = t.metadata) == null ? void 0 : n.conformsTo) != null && r.includes(
|
|
6766
|
+
return A === p.fixed || t.metadata.otherMetadata && "http://openmangaformat.org/schema/1.0#version" in t.metadata.otherMetadata || (r = (n = t.metadata) == null ? void 0 : n.conformsTo) != null && r.includes(tA.DIVINA) ? p.fixed : A === p.scrolled || A === p.reflowable && e ? p.scrolled : p.reflowable;
|
|
6685
6767
|
}
|
|
6686
6768
|
async load() {
|
|
6687
6769
|
var t;
|
|
6688
6770
|
if ((t = this.positions) != null && t.length || (this.positions = await this.pub.positionsFromManifest()), this._layout === p.fixed)
|
|
6689
|
-
this.framePool = new
|
|
6771
|
+
this.framePool = new pn(this.container, this.positions, this.pub), this.framePool.listener = (e, A) => {
|
|
6690
6772
|
this.eventListener(e, A);
|
|
6691
6773
|
};
|
|
6692
6774
|
else {
|
|
6693
6775
|
await this.updateCSS(!1);
|
|
6694
6776
|
const e = this.compileCSSProperties(this._css);
|
|
6695
|
-
this.framePool = new
|
|
6777
|
+
this.framePool = new rn(this.container, this.positions, e);
|
|
6696
6778
|
}
|
|
6697
6779
|
this.currentLocation === void 0 && (this.currentLocation = this.positions[0]), await this.resizeHandler(), await this.apply();
|
|
6698
6780
|
}
|
|
@@ -6736,7 +6818,7 @@ class jA extends $A {
|
|
|
6736
6818
|
async resizeHandler() {
|
|
6737
6819
|
const t = this.container.parentElement || document.documentElement;
|
|
6738
6820
|
if (this._layout === p.fixed)
|
|
6739
|
-
this.container.style.width = `${
|
|
6821
|
+
this.container.style.width = `${Rt(t) - this._settings.constraint}px`, this.framePool.resizeHandler();
|
|
6740
6822
|
else {
|
|
6741
6823
|
const e = this._css.userProperties.colCount, A = this._css.userProperties.lineLength;
|
|
6742
6824
|
this._css.resizeHandler(), (this._css.userProperties.view !== "scroll" && e !== this._css.userProperties.colCount || A !== this._css.userProperties.lineLength) && await this.commitCSS(this._css);
|
|
@@ -6774,10 +6856,10 @@ class jA extends $A {
|
|
|
6774
6856
|
this.listeners.frameLoaded(this._cframes[0].iframe.contentWindow), this.listeners.positionChanged(this.currentLocation);
|
|
6775
6857
|
break;
|
|
6776
6858
|
case "first_visible_locator":
|
|
6777
|
-
const l =
|
|
6859
|
+
const l = ut.deserialize(e);
|
|
6778
6860
|
if (!l)
|
|
6779
6861
|
break;
|
|
6780
|
-
this.currentLocation = new
|
|
6862
|
+
this.currentLocation = new ut({
|
|
6781
6863
|
href: this.currentLocation.href,
|
|
6782
6864
|
type: this.currentLocation.type,
|
|
6783
6865
|
title: this.currentLocation.title,
|
|
@@ -6863,7 +6945,7 @@ class jA extends $A {
|
|
|
6863
6945
|
}
|
|
6864
6946
|
determineModules() {
|
|
6865
6947
|
let t = Array.from(_t.keys());
|
|
6866
|
-
return this._layout === p.fixed ? t.filter((e) =>
|
|
6948
|
+
return this._layout === p.fixed ? t.filter((e) => Li.includes(e)) : (t = t.filter((e) => Oi.includes(e)), this._layout === p.scrolled ? t = t.filter((e) => e !== "column_snapper") : t = t.filter((e) => e !== "scroll_snapper"), t);
|
|
6867
6949
|
}
|
|
6868
6950
|
// Start listening to messages from the current iframe
|
|
6869
6951
|
attachListener() {
|
|
@@ -7071,7 +7153,7 @@ class jA extends $A {
|
|
|
7071
7153
|
return this.go(t.locator, e, A);
|
|
7072
7154
|
}
|
|
7073
7155
|
}
|
|
7074
|
-
class
|
|
7156
|
+
class xn {
|
|
7075
7157
|
constructor(t) {
|
|
7076
7158
|
var e;
|
|
7077
7159
|
this.sourceNode = null, this.listeners = {}, this.isMutedValue = !1, this.isPlayingValue = !1, this.isPausedValue = !1, this.isLoadingValue = !1, this.isLoadedValue = !1, this.isEndedValue = !1, this.playback = t.playback, this.audioContext = t.audioContext, this.gainNode = (e = this.audioContext) == null ? void 0 : e.createGain(), this.setVolume(this.playback.state.volume), this.mediaElement = document.createElement("audio"), this.mediaElement.crossOrigin = "use-credentials", this.mediaElement.addEventListener(
|
|
@@ -7246,39 +7328,39 @@ class Yn {
|
|
|
7246
7328
|
}
|
|
7247
7329
|
}
|
|
7248
7330
|
export {
|
|
7249
|
-
|
|
7331
|
+
k as BooleanPreference,
|
|
7250
7332
|
Oe as EnumPreference,
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7333
|
+
In as EpubDefaults,
|
|
7334
|
+
DA as EpubNavigator,
|
|
7335
|
+
Et as EpubPreferences,
|
|
7254
7336
|
Xe as EpubPreferencesEditor,
|
|
7255
7337
|
Ze as EpubSettings,
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7338
|
+
ln as FXLCoordinator,
|
|
7339
|
+
sn as FXLFrameManager,
|
|
7340
|
+
pn as FXLFramePoolManager,
|
|
7341
|
+
cn as FXLPeripherals,
|
|
7342
|
+
gn as FXLSpreader,
|
|
7261
7343
|
$t as FrameComms,
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7344
|
+
nn as FrameManager,
|
|
7345
|
+
rn as FramePoolManager,
|
|
7346
|
+
on as HorizontalThird,
|
|
7347
|
+
pt as LineLengths,
|
|
7348
|
+
ei as Navigator,
|
|
7267
7349
|
te as Orientation,
|
|
7268
7350
|
Q as Preference,
|
|
7269
|
-
|
|
7351
|
+
zn as RSProperties,
|
|
7270
7352
|
z as RangePreference,
|
|
7271
|
-
|
|
7353
|
+
Yn as ReadiumCSS,
|
|
7272
7354
|
ee as Spread,
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7355
|
+
Bt as TextAlignment,
|
|
7356
|
+
vt as Theme,
|
|
7357
|
+
VA as UserProperties,
|
|
7358
|
+
an as VerticalThird,
|
|
7359
|
+
Ai as VisualNavigator,
|
|
7360
|
+
xn as WebAudioEngine,
|
|
7361
|
+
Tt as fontSizeRangeConfig,
|
|
7362
|
+
jt as fontWeightRangeConfig,
|
|
7363
|
+
Vt as fontWidthRangeConfig,
|
|
7364
|
+
yt as sML,
|
|
7283
7365
|
O as sMLWithRequest
|
|
7284
7366
|
};
|