flipbookengine 0.5.4 → 0.6.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.
@@ -1,12 +1,12 @@
1
- var ye = Object.defineProperty;
1
+ var Se = Object.defineProperty;
2
2
  var Nt = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
- var be = (e, t, s) => t in e ? ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
6
- var m = (e, t, s) => be(e, typeof t != "symbol" ? t + "" : t, s), yt = (e, t, s) => t.has(e) || Nt("Cannot " + s);
5
+ var Te = (e, t, s) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
6
+ var v = (e, t, s) => Te(e, typeof t != "symbol" ? t + "" : t, s), yt = (e, t, s) => t.has(e) || Nt("Cannot " + s);
7
7
  var _ = (e, t, s) => (yt(e, t, "read from private field"), s ? s.call(e) : t.get(e)), rt = (e, t, s) => t.has(e) ? Nt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), at = (e, t, s, o) => (yt(e, t, "write to private field"), o ? o.call(e, s) : t.set(e, s), s), J = (e, t, s) => (yt(e, t, "access private method"), s);
8
8
  import * as Bt from "pdfjs-dist";
9
- var xe = Symbol.for("preact-signals");
9
+ var ke = Symbol.for("preact-signals");
10
10
  function It() {
11
11
  if (j > 1)
12
12
  j--;
@@ -31,41 +31,41 @@ function It() {
31
31
  if (lt = 0, j--, t) throw e;
32
32
  }
33
33
  }
34
- var k = void 0;
34
+ var A = void 0;
35
35
  function wt(e) {
36
- var t = k;
37
- k = void 0;
36
+ var t = A;
37
+ A = void 0;
38
38
  try {
39
39
  return e();
40
40
  } finally {
41
- k = t;
41
+ A = t;
42
42
  }
43
43
  }
44
44
  var tt = void 0, j = 0, lt = 0, _t = 0, ct = void 0, dt = 0;
45
45
  function ee(e) {
46
- if (k !== void 0) {
46
+ if (A !== void 0) {
47
47
  var t = e.n;
48
- if (t === void 0 || t.t !== k)
49
- return t = { i: 0, S: e, p: k.s, n: void 0, t: k, e: void 0, x: void 0, r: t }, k.s !== void 0 && (k.s.n = t), k.s = t, e.n = t, 32 & k.f && e.S(t), t;
48
+ if (t === void 0 || t.t !== A)
49
+ return t = { i: 0, S: e, p: A.s, n: void 0, t: A, e: void 0, x: void 0, r: t }, A.s !== void 0 && (A.s.n = t), A.s = t, e.n = t, 32 & A.f && e.S(t), t;
50
50
  if (t.i === -1)
51
- return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = k.s, t.n = void 0, k.s.n = t, k.s = t), t;
51
+ return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = A.s, t.n = void 0, A.s.n = t, A.s = t), t;
52
52
  }
53
53
  }
54
- function I(e, t) {
54
+ function L(e, t) {
55
55
  this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
56
56
  }
57
- I.prototype.brand = xe;
58
- I.prototype.h = function() {
57
+ L.prototype.brand = ke;
58
+ L.prototype.h = function() {
59
59
  return !0;
60
60
  };
61
- I.prototype.S = function(e) {
61
+ L.prototype.S = function(e) {
62
62
  var t = this, s = this.t;
63
63
  s !== e && e.e === void 0 && (e.x = s, this.t = e, s !== void 0 ? s.e = e : wt(function() {
64
64
  var o;
65
65
  (o = t.W) == null || o.call(t);
66
66
  }));
67
67
  };
68
- I.prototype.U = function(e) {
68
+ L.prototype.U = function(e) {
69
69
  var t = this;
70
70
  if (this.t !== void 0) {
71
71
  var s = e.e, o = e.x;
@@ -75,7 +75,7 @@ I.prototype.U = function(e) {
75
75
  }));
76
76
  }
77
77
  };
78
- I.prototype.subscribe = function(e) {
78
+ L.prototype.subscribe = function(e) {
79
79
  var t = this;
80
80
  return G(function() {
81
81
  var s = t.value;
@@ -84,22 +84,22 @@ I.prototype.subscribe = function(e) {
84
84
  });
85
85
  }, { name: "sub" });
86
86
  };
87
- I.prototype.valueOf = function() {
87
+ L.prototype.valueOf = function() {
88
88
  return this.value;
89
89
  };
90
- I.prototype.toString = function() {
90
+ L.prototype.toString = function() {
91
91
  return this.value + "";
92
92
  };
93
- I.prototype.toJSON = function() {
93
+ L.prototype.toJSON = function() {
94
94
  return this.value;
95
95
  };
96
- I.prototype.peek = function() {
96
+ L.prototype.peek = function() {
97
97
  var e = this;
98
98
  return wt(function() {
99
99
  return e.value;
100
100
  });
101
101
  };
102
- Object.defineProperty(I.prototype, "value", { get: function() {
102
+ Object.defineProperty(L.prototype, "value", { get: function() {
103
103
  var e = ee(this);
104
104
  return e !== void 0 && (e.i = this.i), this.v;
105
105
  }, set: function(e) {
@@ -115,8 +115,8 @@ Object.defineProperty(I.prototype, "value", { get: function() {
115
115
  }
116
116
  }
117
117
  } });
118
- function M(e, t) {
119
- return new I(e, t);
118
+ function D(e, t) {
119
+ return new L(e, t);
120
120
  }
121
121
  function ie(e) {
122
122
  for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
@@ -139,33 +139,33 @@ function ne(e) {
139
139
  e.s = s;
140
140
  }
141
141
  function q(e, t) {
142
- I.call(this, void 0, t), this.x = e, this.s = void 0, this.g = dt - 1, this.f = 4;
142
+ L.call(this, void 0, t), this.x = e, this.s = void 0, this.g = dt - 1, this.f = 4;
143
143
  }
144
- q.prototype = new I();
144
+ q.prototype = new L();
145
145
  q.prototype.h = function() {
146
146
  if (this.f &= -3, 1 & this.f) return !1;
147
147
  if ((36 & this.f) == 32 || (this.f &= -5, this.g === dt)) return !0;
148
148
  if (this.g = dt, this.f |= 1, this.i > 0 && !ie(this))
149
149
  return this.f &= -2, !0;
150
- var e = k;
150
+ var e = A;
151
151
  try {
152
- se(this), k = this;
152
+ se(this), A = this;
153
153
  var t = this.x();
154
154
  (16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
155
155
  } catch (s) {
156
156
  this.v = s, this.f |= 16, this.i++;
157
157
  }
158
- return k = e, ne(this), this.f &= -2, !0;
158
+ return A = e, ne(this), this.f &= -2, !0;
159
159
  };
160
160
  q.prototype.S = function(e) {
161
161
  if (this.t === void 0) {
162
162
  this.f |= 36;
163
163
  for (var t = this.s; t !== void 0; t = t.n) t.S.S(t);
164
164
  }
165
- I.prototype.S.call(this, e);
165
+ L.prototype.S.call(this, e);
166
166
  };
167
167
  q.prototype.U = function(e) {
168
- if (this.t !== void 0 && (I.prototype.U.call(this, e), this.t === void 0)) {
168
+ if (this.t !== void 0 && (L.prototype.U.call(this, e), this.t === void 0)) {
169
169
  this.f &= -33;
170
170
  for (var t = this.s; t !== void 0; t = t.n) t.S.U(t);
171
171
  }
@@ -189,14 +189,14 @@ function oe(e) {
189
189
  var t = e.m;
190
190
  if (e.m = void 0, typeof t == "function") {
191
191
  j++;
192
- var s = k;
193
- k = void 0;
192
+ var s = A;
193
+ A = void 0;
194
194
  try {
195
195
  t();
196
196
  } catch (o) {
197
197
  throw e.f &= -2, e.f |= 8, Lt(e), o;
198
198
  } finally {
199
- k = s, It();
199
+ A = s, It();
200
200
  }
201
201
  }
202
202
  }
@@ -204,9 +204,9 @@ function Lt(e) {
204
204
  for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
205
205
  e.x = void 0, e.s = void 0, oe(e);
206
206
  }
207
- function Pe(e) {
208
- if (k !== this) throw new Error("Out-of-order effect");
209
- ne(this), k = e, this.f &= -2, 8 & this.f && Lt(this), It();
207
+ function Ce(e) {
208
+ if (A !== this) throw new Error("Out-of-order effect");
209
+ ne(this), A = e, this.f &= -2, 8 & this.f && Lt(this), It();
210
210
  }
211
211
  function X(e, t) {
212
212
  this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t == null ? void 0 : t.name;
@@ -224,8 +224,8 @@ X.prototype.c = function() {
224
224
  X.prototype.S = function() {
225
225
  if (1 & this.f) throw new Error("Cycle detected");
226
226
  this.f |= 1, this.f &= -9, oe(this), se(this), j++;
227
- var e = k;
228
- return k = this, Pe.bind(this, e);
227
+ var e = A;
228
+ return A = this, Ce.bind(this, e);
229
229
  };
230
230
  X.prototype.N = function() {
231
231
  2 & this.f || (this.f |= 2, this.u = tt, tt = this);
@@ -247,7 +247,7 @@ function G(e, t) {
247
247
  return o[Symbol.dispose] = o, o;
248
248
  }
249
249
  var re = /* @__PURE__ */ Symbol.for("Serenity.initPropHook");
250
- function Se(e) {
250
+ function Ae(e) {
251
251
  return !!(e && typeof e.nodeType == "number");
252
252
  }
253
253
  function vt(e) {
@@ -256,36 +256,36 @@ function vt(e) {
256
256
  function ae(e) {
257
257
  return typeof e == "number";
258
258
  }
259
- function z(e) {
259
+ function O(e) {
260
260
  return typeof e == "object" && e !== null;
261
261
  }
262
- function Ce(e) {
262
+ function Ee(e) {
263
263
  return !!(e && e.isComponent);
264
264
  }
265
265
  function zt(e) {
266
- return z(e) && typeof e.length == "number" && typeof e.nodeType != "number";
266
+ return O(e) && typeof e.length == "number" && typeof e.nodeType != "number";
267
267
  }
268
- function ke(e) {
268
+ function Me(e) {
269
269
  return typeof e == "function" && typeof e[re] == "function";
270
270
  }
271
271
  function it(e) {
272
272
  return e != null && typeof e != "boolean";
273
273
  }
274
274
  function st(e) {
275
- return Array.isArray(e) ? e.map(st).filter(Boolean).join(" ") : z(e) ? Symbol.iterator in e ? st(Array.from(e)) : Object.keys(e).filter((t) => e[t]).join(" ") : it(e) ? "" + e : "";
275
+ return Array.isArray(e) ? e.map(st).filter(Boolean).join(" ") : O(e) ? Symbol.iterator in e ? st(Array.from(e)) : Object.keys(e).filter((t) => e[t]).join(" ") : it(e) ? "" + e : "";
276
276
  }
277
- function Te(e) {
277
+ function De(e) {
278
278
  return e != null && typeof e == "object" && "current" in e;
279
279
  }
280
280
  function Ft(e, t) {
281
- Te(e) ? e.current = t : typeof e == "function" && e(t);
281
+ De(e) ? e.current = t : typeof e == "function" && e(t);
282
282
  }
283
- function Ae(e, t, s) {
283
+ function Re(e, t, s) {
284
284
  t = { ...t, children: s };
285
285
  const o = new e(t), r = o.render();
286
286
  return "ref" in t && Ft(t.ref, o), r;
287
287
  }
288
- var Ee = "http://www.w3.org/1998/Math/MathML", Me = /* @__PURE__ */ new Set(["math", "annotation", "annotation-xml", "maction", "merror", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics", "menclose", "mfenced"]), De = /* @__PURE__ */ new Set([
288
+ var Ie = "http://www.w3.org/1998/Math/MathML", Le = /* @__PURE__ */ new Set(["math", "annotation", "annotation-xml", "maction", "merror", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics", "menclose", "mfenced"]), ze = /* @__PURE__ */ new Set([
289
289
  // "a",
290
290
  "animate",
291
291
  "animateMotion",
@@ -350,23 +350,23 @@ var Ee = "http://www.w3.org/1998/Math/MathML", Me = /* @__PURE__ */ new Set(["ma
350
350
  "tspan",
351
351
  "use",
352
352
  "view"
353
- ]), Gt = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/, Re = "http://www.w3.org/2000/svg", Ut = /* @__PURE__ */ Symbol.for("Serenity.jsxNamespaceURI");
354
- function Ie(e) {
353
+ ]), Gt = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/, Fe = "http://www.w3.org/2000/svg", Ut = /* @__PURE__ */ Symbol.for("Serenity.jsxNamespaceURI");
354
+ function Oe(e) {
355
355
  const t = globalThis[Ut];
356
356
  return arguments.length && (globalThis[Ut] = e), t;
357
357
  }
358
- var Le = /* @__PURE__ */ Symbol.for("Serenity.jsxTypeKey"), ze = "ShadowRoot";
359
- function Fe(e) {
360
- return e != null && e[Le] === ze;
358
+ var We = /* @__PURE__ */ Symbol.for("Serenity.jsxTypeKey"), $e = "ShadowRoot";
359
+ function He(e) {
360
+ return e != null && e[We] === $e;
361
361
  }
362
362
  var bt = /* @__PURE__ */ Symbol.for("Serenity.disposingListeners"), xt = /* @__PURE__ */ Symbol.for("Serenity.lifecycleRoot");
363
363
  function Ot() {
364
364
  return globalThis[bt] || (globalThis[bt] = /* @__PURE__ */ new WeakMap());
365
365
  }
366
366
  function Wt(e) {
367
- e && e.target && (!e.currentTarget || e.currentTarget === e.target) && Oe(e == null ? void 0 : e.target);
367
+ e && e.target && (!e.currentTarget || e.currentTarget === e.target) && Ne(e == null ? void 0 : e.target);
368
368
  }
369
- function Oe(e, t) {
369
+ function Ne(e, t) {
370
370
  if (!e)
371
371
  return;
372
372
  const s = Ot();
@@ -409,7 +409,7 @@ function jt(e, t, s) {
409
409
  }
410
410
  return e;
411
411
  }
412
- function We(...e) {
412
+ function Be(...e) {
413
413
  if (e.length > 0) {
414
414
  const t = globalThis[xt] || null;
415
415
  return globalThis[xt] = e[0] || null, t;
@@ -419,34 +419,34 @@ function We(...e) {
419
419
  function Z(e) {
420
420
  return e != null && typeof e == "object" && typeof e.subscribe == "function" && typeof e.peek == "function" && "value" in e;
421
421
  }
422
- var ot, O, U, Tt, At, te, $e = (te = class {
422
+ var ot, $, U, Ct, At, te, _e = (te = class {
423
423
  constructor(e, t, s) {
424
424
  rt(this, U);
425
425
  rt(this, ot);
426
- rt(this, O);
427
- this.signal = e, this.isInitial = !0, this.hasChanged = !1, this.lifecycleRoot = t, at(this, O, s);
426
+ rt(this, $);
427
+ this.signal = e, this.isInitial = !0, this.hasChanged = !1, this.lifecycleRoot = t, at(this, $, s);
428
428
  }
429
429
  get lifecycleNode() {
430
- return _(this, O);
430
+ return _(this, $);
431
431
  }
432
432
  get effectDisposer() {
433
433
  return _(this, ot);
434
434
  }
435
435
  set effectDisposer(e) {
436
- J(this, U, Tt).call(this), at(this, ot, e), J(this, U, At).call(this);
436
+ J(this, U, Ct).call(this), at(this, ot, e), J(this, U, At).call(this);
437
437
  }
438
438
  set lifecycleNode(e) {
439
- e !== _(this, O) && (J(this, U, Tt).call(this), at(this, O, e), J(this, U, At).call(this));
439
+ e !== _(this, $) && (J(this, U, Ct).call(this), at(this, $, e), J(this, U, At).call(this));
440
440
  }
441
- }, ot = new WeakMap(), O = new WeakMap(), U = new WeakSet(), Tt = function() {
441
+ }, ot = new WeakMap(), $ = new WeakMap(), U = new WeakSet(), Ct = function() {
442
442
  var e;
443
- jt(_(this, O), this.effectDisposer), jt(_(this, O), (e = this.signal) == null ? void 0 : e.derivedDisposer);
443
+ jt(_(this, $), this.effectDisposer), jt(_(this, $), (e = this.signal) == null ? void 0 : e.derivedDisposer);
444
444
  }, At = function() {
445
445
  var e;
446
- kt(_(this, O), this.effectDisposer), kt(_(this, O), (e = this.signal) == null ? void 0 : e.derivedDisposer);
446
+ kt(_(this, $), this.effectDisposer), kt(_(this, $), (e = this.signal) == null ? void 0 : e.derivedDisposer);
447
447
  }, te);
448
448
  function nt(e, t, s) {
449
- const o = s != null && s.useLifecycleRoot ? We() : void 0, r = new $e(e, o, s == null ? void 0 : s.lifecycleNode), h = r.signal.subscribe(function(u) {
449
+ const o = s != null && s.useLifecycleRoot ? Be() : void 0, r = new _e(e, o, s == null ? void 0 : s.lifecycleNode), h = r.signal.subscribe(function(u) {
450
450
  r.newValue = u, r.isInitial && (this != null && this.dispose) && (r.effectDisposer = this.dispose.bind(this)), r.hasChanged = !r.isInitial && r.prevValue !== r.newValue;
451
451
  try {
452
452
  t(r);
@@ -466,33 +466,33 @@ function he(e) {
466
466
  function Zt(e) {
467
467
  return e instanceof DocumentFragment && he(e.firstChild);
468
468
  }
469
- function He(e, t) {
469
+ function Ge(e, t) {
470
470
  var s;
471
471
  typeof e.replaceWith == "function" ? e.replaceWith(t) : (s = e.parentNode) == null || s.replaceChild(t, e);
472
472
  }
473
473
  function qt(e) {
474
474
  return e instanceof DocumentFragment ? (++Pt, e.prepend(document.createComment(Et + Pt)), e.append(document.createComment(Et + Pt)), e) : e instanceof Node ? e : it(e) ? document.createTextNode(e) : document.createComment("");
475
475
  }
476
- function Ne(e, t) {
476
+ function Ue(e, t) {
477
477
  let s;
478
478
  nt(t, (o) => {
479
479
  var u;
480
480
  if (o.isInitial) {
481
481
  s = qt(o.newValue);
482
- let g = Zt(s) ? s.firstChild : s;
483
- ut(e, s), o.lifecycleNode = (s = g) ?? e;
482
+ let p = Zt(s) ? s.firstChild : s;
483
+ ut(e, s), o.lifecycleNode = (s = p) ?? e;
484
484
  return;
485
485
  }
486
486
  if (!o.hasChanged)
487
487
  return;
488
488
  const r = qt(o.newValue);
489
489
  if (he(s)) {
490
- let g;
491
- for (; (g = s.nextSibling) && ((u = g.parentNode) == null || u.removeChild(g), !(g instanceof Comment && g.data === s.data)); )
490
+ let p;
491
+ for (; (p = s.nextSibling) && ((u = p.parentNode) == null || u.removeChild(p), !(p instanceof Comment && p.data === s.data)); )
492
492
  ;
493
493
  }
494
494
  let h = Zt(r) ? r.firstChild : r;
495
- He(s, r), o.lifecycleNode = (s = h) ?? e;
495
+ Ge(s, r), o.lifecycleNode = (s = h) ?? e;
496
496
  });
497
497
  }
498
498
  function ut(e, t) {
@@ -502,19 +502,19 @@ function ut(e, t) {
502
502
  ut(e, s);
503
503
  else if (vt(t) || ae(t))
504
504
  Vt(e, document.createTextNode(t));
505
- else if (Se(t))
505
+ else if (Ae(t))
506
506
  Vt(e, t);
507
- else if (Fe(t)) {
507
+ else if (He(t)) {
508
508
  const s = e.attachShadow(t.attr);
509
509
  ut(s, t.children), Ft(t.ref, s);
510
- } else Z(t) && Ne(e, t);
510
+ } else Z(t) && Ue(e, t);
511
511
  }
512
512
  function le(e) {
513
- return e == null || (zt(e) ? e = Array.from(e).map((t) => Z(t) ? t.peek() : t) : z(e) && (e = { ...e }, Object.entries(e).forEach(([t, s]) => {
513
+ return e == null || (zt(e) ? e = Array.from(e).map((t) => Z(t) ? t.peek() : t) : O(e) && (e = { ...e }, Object.entries(e).forEach(([t, s]) => {
514
514
  Z(s) && (e[t] = s.peek());
515
515
  }))), e;
516
516
  }
517
- function Be(e, t) {
517
+ function je(e, t) {
518
518
  if (t == null || t === !1 || t === !0)
519
519
  return;
520
520
  t = le(t);
@@ -522,9 +522,9 @@ function Be(e, t) {
522
522
  for (let o of s)
523
523
  o && e.classList.remove(o);
524
524
  }
525
- function _e(e, t, s) {
525
+ function Ve(e, t, s) {
526
526
  if (t == null || t === !1) {
527
- Be(e, s);
527
+ je(e, s);
528
528
  return;
529
529
  }
530
530
  s = le(s), zt(t) ? t = Array.from(t).map((o) => {
@@ -538,7 +538,7 @@ function _e(e, t, s) {
538
538
  }, {
539
539
  lifecycleNode: e
540
540
  }), r;
541
- }) : z(t) && (t = { ...t }, Object.entries(t).forEach(([o, r]) => {
541
+ }) : O(t) && (t = { ...t }, Object.entries(t).forEach(([o, r]) => {
542
542
  Z(r) && nt(r, (h) => {
543
543
  if (h.isInitial) {
544
544
  t[o] = h.newValue;
@@ -560,10 +560,10 @@ function St(e, t, s) {
560
560
  for (let r of o)
561
561
  r && e.classList.add(r);
562
562
  }
563
- function Ge(e, t) {
563
+ function Ze(e, t) {
564
564
  return e + t.charAt(0).toUpperCase() + t.substring(1);
565
565
  }
566
- var Ue = /* @__PURE__ */ (() => {
566
+ var qe = /* @__PURE__ */ (() => {
567
567
  let e = {
568
568
  animationIterationCount: 0,
569
569
  borderImageOutset: 0,
@@ -612,12 +612,12 @@ var Ue = /* @__PURE__ */ (() => {
612
612
  const t = ["Webkit", "ms", "Moz", "O"];
613
613
  return Object.keys(e).forEach((s) => {
614
614
  t.forEach((o) => {
615
- e[Ge(o, s)] = 0;
615
+ e[Ze(o, s)] = 0;
616
616
  });
617
617
  }), e;
618
618
  })();
619
619
  function Mt(e, t, s) {
620
- t.indexOf("-") === 0 ? e.style.setProperty(t, s) : ae(s) && Ue[t] !== 0 ? e.style[t] = s + "px" : e.style[t] = s;
620
+ t.indexOf("-") === 0 ? e.style.setProperty(t, s) : ae(s) && qe[t] !== 0 ? e.style[t] = s + "px" : e.style[t] = s;
621
621
  }
622
622
  function Xt(e, t) {
623
623
  if (!(t == null || t === !1 || t === !0)) {
@@ -625,12 +625,12 @@ function Xt(e, t) {
625
625
  e.removeAttribute("style");
626
626
  return;
627
627
  }
628
- z(t) && Object.keys(t).forEach((s) => {
628
+ O(t) && Object.keys(t).forEach((s) => {
629
629
  Mt(e, s, "");
630
630
  });
631
631
  }
632
632
  }
633
- function je(e, t, s) {
633
+ function Xe(e, t, s) {
634
634
  if (t == null || t === !1 || t === !0) {
635
635
  Xt(e, s);
636
636
  return;
@@ -639,8 +639,8 @@ function je(e, t, s) {
639
639
  e.setAttribute("style", t);
640
640
  return;
641
641
  }
642
- if (z(t)) {
643
- z(s) ? (t = { ...t }, Object.keys(s).forEach((o) => {
642
+ if (O(t)) {
643
+ O(s) ? (t = { ...t }, Object.keys(s).forEach((o) => {
644
644
  o in t || (t[o] = "");
645
645
  })) : Xt(e, s), Object.entries(t).forEach(([o, r]) => {
646
646
  Z(r) ? nt(r, (h) => Mt(e, o, h.newValue), {
@@ -650,11 +650,11 @@ function je(e, t, s) {
650
650
  return;
651
651
  }
652
652
  }
653
- var Ve = "http://www.w3.org/1999/xlink", Ze = "http://www.w3.org/XML/1998/namespace";
653
+ var Ye = "http://www.w3.org/1999/xlink", Qe = "http://www.w3.org/XML/1998/namespace";
654
654
  function ht(e, t) {
655
655
  return e.replace(/[A-Z]/g, (s) => t + s.toLowerCase());
656
656
  }
657
- var qe = /* @__PURE__ */ new Map([
657
+ var Ke = /* @__PURE__ */ new Map([
658
658
  ["autoComplete", "autocomplete"],
659
659
  ["autoFocus", "autofocus"],
660
660
  ["className", "class"],
@@ -686,7 +686,7 @@ function Yt(e, t, s, o) {
686
686
  it(s) ? e[t] = s : it(o) && (e[t] = "");
687
687
  return;
688
688
  case "dangerouslySetInnerHTML":
689
- z(s) ? e.innerHTML = s.__html : z(o) && (e.innerHTML = "");
689
+ O(s) ? e.innerHTML = s.__html : O(o) && (e.innerHTML = "");
690
690
  return;
691
691
  case "value":
692
692
  if (s == null) {
@@ -702,7 +702,7 @@ function Yt(e, t, s, o) {
702
702
  }
703
703
  break;
704
704
  case "class":
705
- _e(e, s, o);
705
+ Ve(e, s, o);
706
706
  return;
707
707
  case "spellcheck":
708
708
  e.spellcheck = s === "" || s === !0 || s === "true" ? !0 : s === !1 || s === "false" ? !1 : s;
@@ -717,7 +717,7 @@ function Yt(e, t, s, o) {
717
717
  case "namespaceURI":
718
718
  return;
719
719
  case "style":
720
- je(e, s, o);
720
+ Xe(e, s, o);
721
721
  return;
722
722
  case "on":
723
723
  case "onCapture":
@@ -735,7 +735,7 @@ function Yt(e, t, s, o) {
735
735
  case "xlinkShow":
736
736
  case "xlinkTitle":
737
737
  case "xlinkType":
738
- e.setAttributeNS(Ve, ht(t, ":"), s);
738
+ e.setAttributeNS(Ye, ht(t, ":"), s);
739
739
  return;
740
740
  case "xmlnsXlink":
741
741
  e.setAttribute("xmlns:xlink", s);
@@ -743,7 +743,7 @@ function Yt(e, t, s, o) {
743
743
  case "xmlBase":
744
744
  case "xmlLang":
745
745
  case "xmlSpace":
746
- e.setAttributeNS(Ze, ht(t, ":"), s);
746
+ e.setAttributeNS(Qe, ht(t, ":"), s);
747
747
  return;
748
748
  }
749
749
  if (typeof s == "function") {
@@ -753,12 +753,12 @@ function Yt(e, t, s, o) {
753
753
  let r = t.toLowerCase();
754
754
  const h = r.endsWith("capture");
755
755
  let u;
756
- !h && (e[r] === null || o != null && e[r] === o) ? (e[r] = s, kt(e, Ye.bind(e, r))) : h ? (u = r.substring(2, r.length - 7), o != null && e.removeEventListener(u, o, !0), e.addEventListener(u, s, !0)) : (r in window ? u = r.substring(2) : u = r[2] + t.slice(3), o != null && e.removeEventListener(u, o), e.addEventListener(u, s));
756
+ !h && (e[r] === null || o != null && e[r] === o) ? (e[r] = s, kt(e, ti.bind(e, r))) : h ? (u = r.substring(2, r.length - 7), o != null && e.removeEventListener(u, o, !0), e.addEventListener(u, s, !0)) : (r in window ? u = r.substring(2) : u = r[2] + t.slice(3), o != null && e.removeEventListener(u, o), e.addEventListener(u, s));
757
757
  } else
758
758
  console.warn(`A function was provided for JSX ${e.tagName} element ${t} which does not start with "on":`, s, e.tagName);
759
759
  return;
760
760
  }
761
- if (z(o)) {
761
+ if (O(o)) {
762
762
  if (o === s)
763
763
  return;
764
764
  delete e[t];
@@ -773,7 +773,7 @@ function Yt(e, t, s, o) {
773
773
  return;
774
774
  e instanceof SVGElement && !Gt.test(t) ? e.removeAttributeNS(ht(t, "-"), s) : e.removeAttribute(t);
775
775
  }
776
- if (z(s)) {
776
+ if (O(s)) {
777
777
  e[t] = s;
778
778
  return;
779
779
  }
@@ -783,35 +783,35 @@ function Yt(e, t, s, o) {
783
783
  }
784
784
  s !== !1 && s != null && (e instanceof SVGElement && !Gt.test(t) ? e.setAttribute(ht(t, "-"), s) : e.setAttribute(t, s));
785
785
  }
786
- function Xe(e, t) {
786
+ function Je(e, t) {
787
787
  for (let [s, o] of Object.entries(t))
788
- s = qe.get(s) ?? s, Z(o) ? nt(o, (r) => Yt(e, s, r.newValue, r.prevValue), {
788
+ s = Ke.get(s) ?? s, Z(o) ? nt(o, (r) => Yt(e, s, r.newValue, r.prevValue), {
789
789
  lifecycleNode: e
790
- }) : ke(o) ? o[re](e, s) : Yt(e, s, o);
790
+ }) : Me(o) ? o[re](e, s) : Yt(e, s, o);
791
791
  return e;
792
792
  }
793
- function Ye(e) {
793
+ function ti(e) {
794
794
  this[e] = null;
795
795
  }
796
- function p(e, t) {
796
+ function d(e, t) {
797
797
  let { children: s, ...o } = t || {}, r = o.namespaceURI;
798
- r || (De.has(e) ? r = Re : Me.has(e) ? r = Ee : r = Ie());
798
+ r || (ze.has(e) ? r = Fe : Le.has(e) ? r = Ie : r = Oe());
799
799
  let h;
800
800
  if (vt(e)) {
801
- if (h = r ? document.createElementNS(r, e) : document.createElement(e), Xe(h, o), ut(h, s), h instanceof window.HTMLSelectElement && o.value != null)
801
+ if (h = r ? document.createElementNS(r, e) : document.createElement(e), Je(h, o), ut(h, s), h instanceof window.HTMLSelectElement && o.value != null)
802
802
  if (o.multiple === !0 && Array.isArray(o.value)) {
803
- const u = o.value.map((g) => String(g));
804
- h.querySelectorAll("option").forEach((g) => g.selected = u.includes(g.value));
803
+ const u = o.value.map((p) => String(p));
804
+ h.querySelectorAll("option").forEach((p) => p.selected = u.includes(p.value));
805
805
  } else
806
806
  h.value = o.value;
807
807
  Ft(o.ref, h);
808
808
  } else if (typeof e == "function")
809
- z(e.defaultProps) && (o = { ...e.defaultProps, ...o }), h = Ce(e) ? Ae(e, o, s) : e({ ...o, children: s });
809
+ O(e.defaultProps) && (o = { ...e.defaultProps, ...o }), h = Ee(e) ? Re(e, o, s) : e({ ...o, children: s });
810
810
  else
811
811
  throw new TypeError(`Invalid JSX element type: ${e}`);
812
812
  return h;
813
813
  }
814
- var Qe = /* @__PURE__ */ Symbol.for("preact-signals");
814
+ var ei = /* @__PURE__ */ Symbol.for("preact-signals");
815
815
  function $t() {
816
816
  if (V > 1)
817
817
  V--;
@@ -836,41 +836,41 @@ function $t() {
836
836
  if (gt = 0, V--, t) throw e;
837
837
  }
838
838
  }
839
- var S = void 0;
839
+ var P = void 0;
840
840
  function ce(e) {
841
- var t = S;
842
- S = void 0;
841
+ var t = P;
842
+ P = void 0;
843
843
  try {
844
844
  return e();
845
845
  } finally {
846
- S = t;
846
+ P = t;
847
847
  }
848
848
  }
849
849
  var et = void 0, V = 0, gt = 0, Qt = 0, pt = void 0, ft = 0;
850
850
  function de(e) {
851
- if (S !== void 0) {
851
+ if (P !== void 0) {
852
852
  var t = e.n;
853
- if (t === void 0 || t.t !== S)
854
- return t = { i: 0, S: e, p: S.s, n: void 0, t: S, e: void 0, x: void 0, r: t }, S.s !== void 0 && (S.s.n = t), S.s = t, e.n = t, 32 & S.f && e.S(t), t;
853
+ if (t === void 0 || t.t !== P)
854
+ return t = { i: 0, S: e, p: P.s, n: void 0, t: P, e: void 0, x: void 0, r: t }, P.s !== void 0 && (P.s.n = t), P.s = t, e.n = t, 32 & P.f && e.S(t), t;
855
855
  if (t.i === -1)
856
- return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = S.s, t.n = void 0, S.s.n = t, S.s = t), t;
856
+ return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = P.s, t.n = void 0, P.s.n = t, P.s = t), t;
857
857
  }
858
858
  }
859
- function L(e, t) {
859
+ function z(e, t) {
860
860
  this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
861
861
  }
862
- L.prototype.brand = Qe;
863
- L.prototype.h = function() {
862
+ z.prototype.brand = ei;
863
+ z.prototype.h = function() {
864
864
  return !0;
865
865
  };
866
- L.prototype.S = function(e) {
866
+ z.prototype.S = function(e) {
867
867
  var t = this, s = this.t;
868
868
  s !== e && e.e === void 0 && (e.x = s, this.t = e, s !== void 0 ? s.e = e : ce(function() {
869
869
  var o;
870
870
  (o = t.W) == null || o.call(t);
871
871
  }));
872
872
  };
873
- L.prototype.U = function(e) {
873
+ z.prototype.U = function(e) {
874
874
  var t = this;
875
875
  if (this.t !== void 0) {
876
876
  var s = e.e, o = e.x;
@@ -880,37 +880,37 @@ L.prototype.U = function(e) {
880
880
  }));
881
881
  }
882
882
  };
883
- L.prototype.subscribe = function(e) {
883
+ z.prototype.subscribe = function(e) {
884
884
  var t = this;
885
- return Je(function() {
886
- var s = t.value, o = S;
887
- S = void 0;
885
+ return si(function() {
886
+ var s = t.value, o = P;
887
+ P = void 0;
888
888
  try {
889
889
  e(s);
890
890
  } finally {
891
- S = o;
891
+ P = o;
892
892
  }
893
893
  }, { name: "sub" });
894
894
  };
895
- L.prototype.valueOf = function() {
895
+ z.prototype.valueOf = function() {
896
896
  return this.value;
897
897
  };
898
- L.prototype.toString = function() {
898
+ z.prototype.toString = function() {
899
899
  return this.value + "";
900
900
  };
901
- L.prototype.toJSON = function() {
901
+ z.prototype.toJSON = function() {
902
902
  return this.value;
903
903
  };
904
- L.prototype.peek = function() {
905
- var e = S;
906
- S = void 0;
904
+ z.prototype.peek = function() {
905
+ var e = P;
906
+ P = void 0;
907
907
  try {
908
908
  return this.value;
909
909
  } finally {
910
- S = e;
910
+ P = e;
911
911
  }
912
912
  };
913
- Object.defineProperty(L.prototype, "value", { get: function() {
913
+ Object.defineProperty(z.prototype, "value", { get: function() {
914
914
  var e = de(this);
915
915
  return e !== void 0 && (e.i = this.i), this.v;
916
916
  }, set: function(e) {
@@ -947,33 +947,33 @@ function pe(e) {
947
947
  e.s = s;
948
948
  }
949
949
  function Y(e, t) {
950
- L.call(this, void 0), this.x = e, this.s = void 0, this.g = ft - 1, this.f = 4, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
950
+ z.call(this, void 0), this.x = e, this.s = void 0, this.g = ft - 1, this.f = 4, this.W = t == null ? void 0 : t.watched, this.Z = t == null ? void 0 : t.unwatched, this.name = t == null ? void 0 : t.name;
951
951
  }
952
- Y.prototype = new L();
952
+ Y.prototype = new z();
953
953
  Y.prototype.h = function() {
954
954
  if (this.f &= -3, 1 & this.f) return !1;
955
955
  if ((36 & this.f) == 32 || (this.f &= -5, this.g === ft)) return !0;
956
956
  if (this.g = ft, this.f |= 1, this.i > 0 && !ue(this))
957
957
  return this.f &= -2, !0;
958
- var e = S;
958
+ var e = P;
959
959
  try {
960
- ge(this), S = this;
960
+ ge(this), P = this;
961
961
  var t = this.x();
962
962
  (16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);
963
963
  } catch (s) {
964
964
  this.v = s, this.f |= 16, this.i++;
965
965
  }
966
- return S = e, pe(this), this.f &= -2, !0;
966
+ return P = e, pe(this), this.f &= -2, !0;
967
967
  };
968
968
  Y.prototype.S = function(e) {
969
969
  if (this.t === void 0) {
970
970
  this.f |= 36;
971
971
  for (var t = this.s; t !== void 0; t = t.n) t.S.S(t);
972
972
  }
973
- L.prototype.S.call(this, e);
973
+ z.prototype.S.call(this, e);
974
974
  };
975
975
  Y.prototype.U = function(e) {
976
- if (this.t !== void 0 && (L.prototype.U.call(this, e), this.t === void 0)) {
976
+ if (this.t !== void 0 && (z.prototype.U.call(this, e), this.t === void 0)) {
977
977
  this.f &= -33;
978
978
  for (var t = this.s; t !== void 0; t = t.n) t.S.U(t);
979
979
  }
@@ -994,14 +994,14 @@ function fe(e) {
994
994
  var t = e.m;
995
995
  if (e.m = void 0, typeof t == "function") {
996
996
  V++;
997
- var s = S;
998
- S = void 0;
997
+ var s = P;
998
+ P = void 0;
999
999
  try {
1000
1000
  t();
1001
1001
  } catch (o) {
1002
1002
  throw e.f &= -2, e.f |= 8, Ht(e), o;
1003
1003
  } finally {
1004
- S = s, $t();
1004
+ P = s, $t();
1005
1005
  }
1006
1006
  }
1007
1007
  }
@@ -1009,9 +1009,9 @@ function Ht(e) {
1009
1009
  for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
1010
1010
  e.x = void 0, e.s = void 0, fe(e);
1011
1011
  }
1012
- function Ke(e) {
1013
- if (S !== this) throw new Error("Out-of-order effect");
1014
- pe(this), S = e, this.f &= -2, 8 & this.f && Ht(this), $t();
1012
+ function ii(e) {
1013
+ if (P !== this) throw new Error("Out-of-order effect");
1014
+ pe(this), P = e, this.f &= -2, 8 & this.f && Ht(this), $t();
1015
1015
  }
1016
1016
  function Q(e, t) {
1017
1017
  this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t == null ? void 0 : t.name;
@@ -1029,8 +1029,8 @@ Q.prototype.c = function() {
1029
1029
  Q.prototype.S = function() {
1030
1030
  if (1 & this.f) throw new Error("Cycle detected");
1031
1031
  this.f |= 1, this.f &= -9, fe(this), ge(this), V++;
1032
- var e = S;
1033
- return S = this, Ke.bind(this, e);
1032
+ var e = P;
1033
+ return P = this, ii.bind(this, e);
1034
1034
  };
1035
1035
  Q.prototype.N = function() {
1036
1036
  2 & this.f || (this.f |= 2, this.u = et, et = this);
@@ -1041,7 +1041,7 @@ Q.prototype.d = function() {
1041
1041
  Q.prototype.dispose = function() {
1042
1042
  this.d();
1043
1043
  };
1044
- function Je(e, t) {
1044
+ function si(e, t) {
1045
1045
  var s = new Q(e, t);
1046
1046
  try {
1047
1047
  s.c();
@@ -1051,7 +1051,7 @@ function Je(e, t) {
1051
1051
  var o = s.d.bind(s);
1052
1052
  return o[Symbol.dispose] = o, o;
1053
1053
  }
1054
- const ti = {
1054
+ const ni = {
1055
1055
  emptyStateTitle: "No data available.",
1056
1056
  thumbnails: "Thumbnails",
1057
1057
  singlePageMode: "Single Page Mode",
@@ -1064,8 +1064,9 @@ const ti = {
1064
1064
  settings: "Settings",
1065
1065
  downloadCatalog: "Download Catalog",
1066
1066
  play: "Play",
1067
- pause: "Pause"
1068
- }, ei = {
1067
+ pause: "Pause",
1068
+ tableOfContents: "Table of Contents"
1069
+ }, oi = {
1069
1070
  emptyStateTitle: "Veri bulunamadi.",
1070
1071
  thumbnails: "Küçük Resimler",
1071
1072
  singlePageMode: "Tek Sayfa Modu",
@@ -1078,25 +1079,26 @@ const ti = {
1078
1079
  settings: "Ayarlar",
1079
1080
  downloadCatalog: "Kataloğu İndir",
1080
1081
  play: "Otomatik Oynat",
1081
- pause: "Duraklat"
1082
- }, Ct = {
1083
- en: ti,
1084
- tr: ei
1082
+ pause: "Duraklat",
1083
+ tableOfContents: "İçindekiler"
1084
+ }, Tt = {
1085
+ en: ni,
1086
+ tr: oi
1085
1087
  };
1086
- function ii(e = {}) {
1088
+ function me(e = {}) {
1087
1089
  var r;
1088
- const t = e.locale ?? "en", s = Ct[t] ?? Ct.en, o = ((r = e.messages) == null ? void 0 : r[t]) ?? {};
1090
+ const t = e.locale ?? "en", s = Tt[t] ?? Tt.en, o = ((r = e.messages) == null ? void 0 : r[t]) ?? {};
1089
1091
  return {
1090
- ...Ct.en,
1092
+ ...Tt.en,
1091
1093
  ...s,
1092
1094
  ...o
1093
1095
  };
1094
1096
  }
1095
- function si(e) {
1096
- const t = w(() => ii({ locale: e.store.locale.value, messages: e.store.messages.value }));
1097
- return /* @__PURE__ */ p("div", { class: "bk-toolbar", role: "toolbar", "aria-label": "Flipbook controls", children: [
1098
- /* @__PURE__ */ p("div", { class: "bk-btn-group", children: [
1099
- /* @__PURE__ */ p(
1097
+ function ri(e) {
1098
+ const t = w(() => me({ locale: e.store.locale.value, messages: e.store.messages.value }));
1099
+ return /* @__PURE__ */ d("div", { class: "bk-toolbar", role: "toolbar", "aria-label": "Flipbook controls", children: [
1100
+ /* @__PURE__ */ d("div", { class: "bk-btn-group", children: [
1101
+ /* @__PURE__ */ d(
1100
1102
  "button",
1101
1103
  {
1102
1104
  type: "button",
@@ -1105,15 +1107,34 @@ function si(e) {
1105
1107
  "aria-label": w(() => t.value.thumbnails || "Thumbnails"),
1106
1108
  "aria-pressed": w(() => e.store.showThumbs.value ? "true" : "false"),
1107
1109
  title: w(() => t.value.thumbnails || "Thumbnails"),
1108
- children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1109
- /* @__PURE__ */ p("rect", { x: "3", y: "3", width: "7", height: "7" }),
1110
- /* @__PURE__ */ p("rect", { x: "14", y: "3", width: "7", height: "7" }),
1111
- /* @__PURE__ */ p("rect", { x: "14", y: "14", width: "7", height: "7" }),
1112
- /* @__PURE__ */ p("rect", { x: "3", y: "14", width: "7", height: "7" })
1110
+ children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1111
+ /* @__PURE__ */ d("rect", { x: "3", y: "3", width: "7", height: "7" }),
1112
+ /* @__PURE__ */ d("rect", { x: "14", y: "3", width: "7", height: "7" }),
1113
+ /* @__PURE__ */ d("rect", { x: "14", y: "14", width: "7", height: "7" }),
1114
+ /* @__PURE__ */ d("rect", { x: "3", y: "14", width: "7", height: "7" })
1113
1115
  ] })
1114
1116
  }
1115
1117
  ),
1116
- /* @__PURE__ */ p(
1118
+ w(() => e.store.toc.value.length ? /* @__PURE__ */ d(
1119
+ "button",
1120
+ {
1121
+ type: "button",
1122
+ class: w(() => e.store.showToc.value ? "bk-btn active" : "bk-btn"),
1123
+ onClick: e.onToggleToc,
1124
+ "aria-label": w(() => t.value.tableOfContents || "Table of Contents"),
1125
+ "aria-pressed": w(() => e.store.showToc.value ? "true" : "false"),
1126
+ title: w(() => t.value.tableOfContents || "Table of Contents"),
1127
+ children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1128
+ /* @__PURE__ */ d("line", { x1: "8", y1: "6", x2: "21", y2: "6" }),
1129
+ /* @__PURE__ */ d("line", { x1: "8", y1: "12", x2: "21", y2: "12" }),
1130
+ /* @__PURE__ */ d("line", { x1: "8", y1: "18", x2: "21", y2: "18" }),
1131
+ /* @__PURE__ */ d("line", { x1: "3", y1: "6", x2: "3.01", y2: "6" }),
1132
+ /* @__PURE__ */ d("line", { x1: "3", y1: "12", x2: "3.01", y2: "12" }),
1133
+ /* @__PURE__ */ d("line", { x1: "3", y1: "18", x2: "3.01", y2: "18" })
1134
+ ] })
1135
+ }
1136
+ ) : null),
1137
+ /* @__PURE__ */ d(
1117
1138
  "button",
1118
1139
  {
1119
1140
  type: "button",
@@ -1122,16 +1143,16 @@ function si(e) {
1122
1143
  "aria-label": w(() => t.value.singlePageMode || "Single Page"),
1123
1144
  "aria-pressed": w(() => e.store.isSingleMode.value ? "true" : "false"),
1124
1145
  title: w(() => t.value.singlePageMode || "Single Page"),
1125
- children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1126
- /* @__PURE__ */ p("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
1127
- /* @__PURE__ */ p("polyline", { points: "14 2 14 8 20 8" }),
1128
- /* @__PURE__ */ p("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
1129
- /* @__PURE__ */ p("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
1130
- /* @__PURE__ */ p("polyline", { points: "10 9 9 9 8 9" })
1146
+ children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1147
+ /* @__PURE__ */ d("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
1148
+ /* @__PURE__ */ d("polyline", { points: "14 2 14 8 20 8" }),
1149
+ /* @__PURE__ */ d("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
1150
+ /* @__PURE__ */ d("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
1151
+ /* @__PURE__ */ d("polyline", { points: "10 9 9 9 8 9" })
1131
1152
  ] })
1132
1153
  }
1133
1154
  ),
1134
- /* @__PURE__ */ p(
1155
+ /* @__PURE__ */ d(
1135
1156
  "button",
1136
1157
  {
1137
1158
  type: "button",
@@ -1141,34 +1162,34 @@ function si(e) {
1141
1162
  "aria-pressed": w(() => e.store.isAutoPlaying.value ? "true" : "false"),
1142
1163
  title: w(() => e.store.isAutoPlaying.value ? t.value.pause || "Pause" : t.value.play || "Play"),
1143
1164
  children: [
1144
- /* @__PURE__ */ p("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1145
- /* @__PURE__ */ p("rect", { x: "6", y: "4", width: "4", height: "16" }),
1146
- /* @__PURE__ */ p("rect", { x: "14", y: "4", width: "4", height: "16" })
1165
+ /* @__PURE__ */ d("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1166
+ /* @__PURE__ */ d("rect", { x: "6", y: "4", width: "4", height: "16" }),
1167
+ /* @__PURE__ */ d("rect", { x: "14", y: "4", width: "4", height: "16" })
1147
1168
  ] }),
1148
- /* @__PURE__ */ p("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polygon", { points: "5 3 19 12 5 21 5 3" }) })
1169
+ /* @__PURE__ */ d("svg", { style: { display: w(() => e.store.isAutoPlaying.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ d("polygon", { points: "5 3 19 12 5 21 5 3" }) })
1149
1170
  ]
1150
1171
  }
1151
1172
  )
1152
1173
  ] }),
1153
- /* @__PURE__ */ p("div", { class: "bk-btn-group bk-btn-group--center", children: [
1154
- /* @__PURE__ */ p("button", { type: "button", class: "bk-btn", onClick: e.onPrevPage, "aria-label": w(() => t.value.previous || "Previous"), title: w(() => t.value.previous || "Previous"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polyline", { points: "15 18 9 12 15 6" }) }) }),
1155
- /* @__PURE__ */ p("span", { class: "bz-page-info", "aria-live": "polite", "aria-atomic": "true", children: w(() => {
1174
+ /* @__PURE__ */ d("div", { class: "bk-btn-group bk-btn-group--center", children: [
1175
+ /* @__PURE__ */ d("button", { type: "button", class: "bk-btn", onClick: e.onPrevPage, "aria-label": w(() => t.value.previous || "Previous"), title: w(() => t.value.previous || "Previous"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ d("polyline", { points: "15 18 9 12 15 6" }) }) }),
1176
+ /* @__PURE__ */ d("span", { class: "bz-page-info", "aria-live": "polite", "aria-atomic": "true", children: w(() => {
1156
1177
  const s = e.store.currentPage.value, o = e.store.totalPages.value;
1157
1178
  if (e.store.isSingleMode.value || s === 0 || s >= o - 1)
1158
1179
  return `${s + 1} / ${o}`;
1159
1180
  const r = s % 2 === 1 ? s : s - 1;
1160
1181
  return `${r + 1}-${r + 2} / ${o}`;
1161
1182
  }) }),
1162
- /* @__PURE__ */ p("button", { type: "button", class: "bk-btn", onClick: e.onNextPage, "aria-label": w(() => t.value.next || "Next"), title: w(() => t.value.next || "Next"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("polyline", { points: "9 18 15 12 9 6" }) }) })
1183
+ /* @__PURE__ */ d("button", { type: "button", class: "bk-btn", onClick: e.onNextPage, "aria-label": w(() => t.value.next || "Next"), title: w(() => t.value.next || "Next"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ d("polyline", { points: "9 18 15 12 9 6" }) }) })
1163
1184
  ] }),
1164
- /* @__PURE__ */ p("div", { class: "bk-btn-group", children: [
1165
- /* @__PURE__ */ p("button", { type: "button", class: "bk-btn", onClick: e.onZoomIn, "aria-label": w(() => t.value.zoomIn || "Zoom In"), title: w(() => t.value.zoomIn || "Zoom In"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1166
- /* @__PURE__ */ p("circle", { cx: "11", cy: "11", r: "8" }),
1167
- /* @__PURE__ */ p("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1168
- /* @__PURE__ */ p("line", { x1: "11", y1: "8", x2: "11", y2: "14" }),
1169
- /* @__PURE__ */ p("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
1185
+ /* @__PURE__ */ d("div", { class: "bk-btn-group", children: [
1186
+ /* @__PURE__ */ d("button", { type: "button", class: "bk-btn", onClick: e.onZoomIn, "aria-label": w(() => t.value.zoomIn || "Zoom In"), title: w(() => t.value.zoomIn || "Zoom In"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1187
+ /* @__PURE__ */ d("circle", { cx: "11", cy: "11", r: "8" }),
1188
+ /* @__PURE__ */ d("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1189
+ /* @__PURE__ */ d("line", { x1: "11", y1: "8", x2: "11", y2: "14" }),
1190
+ /* @__PURE__ */ d("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
1170
1191
  ] }) }),
1171
- /* @__PURE__ */ p(
1192
+ /* @__PURE__ */ d(
1172
1193
  "button",
1173
1194
  {
1174
1195
  type: "button",
@@ -1176,20 +1197,20 @@ function si(e) {
1176
1197
  onClick: e.onZoomOut,
1177
1198
  "aria-label": w(() => t.value.zoomOut || "Zoom Out"),
1178
1199
  title: w(() => t.value.zoomOut || "Zoom Out"),
1179
- children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1180
- /* @__PURE__ */ p("circle", { cx: "11", cy: "11", r: "8" }),
1181
- /* @__PURE__ */ p("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1182
- /* @__PURE__ */ p("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
1200
+ children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1201
+ /* @__PURE__ */ d("circle", { cx: "11", cy: "11", r: "8" }),
1202
+ /* @__PURE__ */ d("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1203
+ /* @__PURE__ */ d("line", { x1: "8", y1: "11", x2: "14", y2: "11" })
1183
1204
  ] })
1184
1205
  }
1185
1206
  ),
1186
- /* @__PURE__ */ p("button", { type: "button", class: "bk-btn bk-btn--fullscreen", onClick: e.onToggleFullscreen, "aria-label": w(() => t.value.fullscreen || "Fullscreen"), title: w(() => t.value.fullscreen || "Fullscreen"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ p("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) }) }),
1187
- w(() => e.store.allowDownload.value && e.store.hasDownloadUrl.value && e.onDownload ? /* @__PURE__ */ p("button", { type: "button", class: "bk-btn bk-btn--download", onClick: e.onDownload, "aria-label": w(() => t.value.downloadCatalog || "Download"), title: w(() => t.value.downloadCatalog || "Download"), children: /* @__PURE__ */ p("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1188
- /* @__PURE__ */ p("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1189
- /* @__PURE__ */ p("polyline", { points: "7 10 12 15 17 10" }),
1190
- /* @__PURE__ */ p("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
1207
+ /* @__PURE__ */ d("button", { type: "button", class: "bk-btn bk-btn--fullscreen", onClick: e.onToggleFullscreen, "aria-label": w(() => t.value.fullscreen || "Fullscreen"), title: w(() => t.value.fullscreen || "Fullscreen"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: /* @__PURE__ */ d("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) }) }),
1208
+ w(() => e.store.allowDownload.value && e.store.hasDownloadUrl.value && e.onDownload ? /* @__PURE__ */ d("button", { type: "button", class: "bk-btn bk-btn--download", onClick: e.onDownload, "aria-label": w(() => t.value.downloadCatalog || "Download"), title: w(() => t.value.downloadCatalog || "Download"), children: /* @__PURE__ */ d("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1209
+ /* @__PURE__ */ d("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1210
+ /* @__PURE__ */ d("polyline", { points: "7 10 12 15 17 10" }),
1211
+ /* @__PURE__ */ d("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
1191
1212
  ] }) }) : null),
1192
- /* @__PURE__ */ p(
1213
+ /* @__PURE__ */ d(
1193
1214
  "button",
1194
1215
  {
1195
1216
  type: "button",
@@ -1199,15 +1220,15 @@ function si(e) {
1199
1220
  "aria-pressed": w(() => e.store.soundEnabled.value ? "true" : "false"),
1200
1221
  title: "Sound",
1201
1222
  children: [
1202
- /* @__PURE__ */ p("svg", { style: { display: w(() => e.store.soundEnabled.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1203
- /* @__PURE__ */ p("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1204
- /* @__PURE__ */ p("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
1205
- /* @__PURE__ */ p("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
1223
+ /* @__PURE__ */ d("svg", { style: { display: w(() => e.store.soundEnabled.value ? "block" : "none") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1224
+ /* @__PURE__ */ d("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1225
+ /* @__PURE__ */ d("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
1226
+ /* @__PURE__ */ d("path", { d: "M19.07 4.93a10 10 0 0 1 0 14.14" })
1206
1227
  ] }),
1207
- /* @__PURE__ */ p("svg", { style: { display: w(() => e.store.soundEnabled.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1208
- /* @__PURE__ */ p("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1209
- /* @__PURE__ */ p("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
1210
- /* @__PURE__ */ p("line", { x1: "17", y1: "9", x2: "23", y2: "15" })
1228
+ /* @__PURE__ */ d("svg", { style: { display: w(() => e.store.soundEnabled.value ? "none" : "block") }, xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", children: [
1229
+ /* @__PURE__ */ d("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1230
+ /* @__PURE__ */ d("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
1231
+ /* @__PURE__ */ d("line", { x1: "17", y1: "9", x2: "23", y2: "15" })
1211
1232
  ] })
1212
1233
  ]
1213
1234
  }
@@ -1215,8 +1236,8 @@ function si(e) {
1215
1236
  ] })
1216
1237
  ] });
1217
1238
  }
1218
- function ni(e) {
1219
- return /* @__PURE__ */ p("div", { class: "bk-thumbs", style: w(() => e.store.showThumbs.value ? "display:flex;" : "display:none;"), children: e.store.pages.value.map((t, s) => {
1239
+ function ai(e) {
1240
+ return /* @__PURE__ */ d("div", { class: "bk-thumbs", style: w(() => e.store.showThumbs.value ? "display:flex;" : "display:none;"), children: e.store.pages.value.map((t, s) => {
1220
1241
  const o = () => {
1221
1242
  const r = e.store.currentPage.value;
1222
1243
  if (e.store.isSingleMode.value || r === 0 || r >= e.store.pages.value.length - 1)
@@ -1224,7 +1245,7 @@ function ni(e) {
1224
1245
  const h = r % 2 === 1 ? r : r - 1;
1225
1246
  return s === h || s === h + 1;
1226
1247
  };
1227
- return /* @__PURE__ */ p(
1248
+ return /* @__PURE__ */ d(
1228
1249
  "div",
1229
1250
  {
1230
1251
  class: w(() => `thumb-item ${o() ? "active" : ""}`),
@@ -1237,7 +1258,7 @@ function ni(e) {
1237
1258
  (r.key === "Enter" || r.key === " ") && (r.preventDefault(), e.onThumbClick(s));
1238
1259
  },
1239
1260
  children: [
1240
- /* @__PURE__ */ p("div", { class: "thumb-img-wrapper", children: /* @__PURE__ */ p(
1261
+ /* @__PURE__ */ d("div", { class: "thumb-img-wrapper", children: /* @__PURE__ */ d(
1241
1262
  "img",
1242
1263
  {
1243
1264
  "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
@@ -1250,14 +1271,50 @@ function ni(e) {
1250
1271
  }
1251
1272
  }
1252
1273
  ) }),
1253
- /* @__PURE__ */ p("span", { children: s + 1 })
1274
+ /* @__PURE__ */ d("span", { children: s + 1 })
1254
1275
  ]
1255
1276
  }
1256
1277
  );
1257
1278
  }) });
1258
1279
  }
1259
- function oi(e) {
1260
- return /* @__PURE__ */ p(
1280
+ function we(e, t, s) {
1281
+ return /* @__PURE__ */ d("ol", { class: "bk-toc-list", children: e.map((o) => {
1282
+ var r;
1283
+ return /* @__PURE__ */ d("li", { class: "bk-toc-item", children: [
1284
+ /* @__PURE__ */ d(
1285
+ "button",
1286
+ {
1287
+ type: "button",
1288
+ class: w(() => t.currentPage.value === o.pageIndex ? "bk-toc-entry active" : "bk-toc-entry"),
1289
+ "aria-current": w(() => t.currentPage.value === o.pageIndex ? "page" : void 0),
1290
+ onClick: () => s(o.pageIndex),
1291
+ children: [
1292
+ /* @__PURE__ */ d("span", { class: "bk-toc-title", children: o.title }),
1293
+ /* @__PURE__ */ d("span", { class: "bk-toc-page", children: o.pageIndex + 1 })
1294
+ ]
1295
+ }
1296
+ ),
1297
+ (r = o.children) != null && r.length ? we(o.children, t, s) : null
1298
+ ] });
1299
+ }) });
1300
+ }
1301
+ function hi(e) {
1302
+ const t = w(() => me({ locale: e.store.locale.value, messages: e.store.messages.value }));
1303
+ return /* @__PURE__ */ d(
1304
+ "nav",
1305
+ {
1306
+ class: "bk-toc",
1307
+ "aria-label": w(() => t.value.tableOfContents || "Table of Contents"),
1308
+ style: w(() => e.store.showToc.value && e.store.toc.value.length ? "display:flex;" : "display:none;"),
1309
+ children: [
1310
+ /* @__PURE__ */ d("div", { class: "bk-toc-heading", children: w(() => t.value.tableOfContents || "Table of Contents") }),
1311
+ we(e.store.toc.value, e.store, e.onEntryClick)
1312
+ ]
1313
+ }
1314
+ );
1315
+ }
1316
+ function li(e) {
1317
+ return /* @__PURE__ */ d(
1261
1318
  "div",
1262
1319
  {
1263
1320
  role: "region",
@@ -1267,13 +1324,13 @@ function oi(e) {
1267
1324
  return e.store.isDoublePageLayout.value && (t += "double-mode "), e.store.isFrontCover.value && (t += "bk-is-cover "), e.store.isBackCover.value && (t += "bk-is-back-cover "), e.store.zoomState.value.isActive && (t += "zoomed "), t.trim();
1268
1325
  }),
1269
1326
  ref: e.bookWrapperRef,
1270
- children: /* @__PURE__ */ p(
1327
+ children: /* @__PURE__ */ d(
1271
1328
  "div",
1272
1329
  {
1273
1330
  class: "bk-book-sizer",
1274
1331
  ref: e.bookSizerRef,
1275
1332
  children: [
1276
- /* @__PURE__ */ p(
1333
+ /* @__PURE__ */ d(
1277
1334
  "div",
1278
1335
  {
1279
1336
  ref: e.bookContainerRef,
@@ -1281,14 +1338,14 @@ function oi(e) {
1281
1338
  style: w(() => `display: ${e.store.isSingleMode.value ? "none" : "block"};`),
1282
1339
  children: e.store.pages.value.map((t, s) => {
1283
1340
  const o = s === 0 || s === e.store.pages.value.length - 1;
1284
- return /* @__PURE__ */ p(
1341
+ return /* @__PURE__ */ d(
1285
1342
  "div",
1286
1343
  {
1287
1344
  class: `bz-page ${s === 0 ? "bz-page--cover" : ""} ${s === e.store.pages.value.length - 1 ? "bz-page--back" : ""}`,
1288
1345
  "data-density": o ? "hard" : "soft",
1289
1346
  "data-idx": s,
1290
- children: /* @__PURE__ */ p("div", { class: "bz-page-content", style: "position:relative; width:100%; height:100%; overflow:hidden;", children: [
1291
- /* @__PURE__ */ p(
1347
+ children: /* @__PURE__ */ d("div", { class: "bz-page-content", style: "position:relative; width:100%; height:100%; overflow:hidden;", children: [
1348
+ /* @__PURE__ */ d(
1292
1349
  "img",
1293
1350
  {
1294
1351
  "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
@@ -1299,21 +1356,21 @@ function oi(e) {
1299
1356
  loading: "lazy"
1300
1357
  }
1301
1358
  ),
1302
- /* @__PURE__ */ p("div", { class: "page-shadow" })
1359
+ /* @__PURE__ */ d("div", { class: "page-shadow" })
1303
1360
  ] })
1304
1361
  }
1305
1362
  );
1306
1363
  })
1307
1364
  }
1308
1365
  ),
1309
- /* @__PURE__ */ p(
1366
+ /* @__PURE__ */ d(
1310
1367
  "div",
1311
1368
  {
1312
1369
  class: "bk-single-view",
1313
1370
  style: w(() => `display: ${e.store.isSingleMode.value ? "flex" : "none"}; width: 100%; height: 100%; justify-content: center; align-items: center; position: absolute; top: 0; left: 0; z-index: 10;`),
1314
1371
  children: w(() => {
1315
1372
  const t = e.store.pages.value[e.store.currentPage.value];
1316
- return t ? /* @__PURE__ */ p(
1373
+ return t ? /* @__PURE__ */ d(
1317
1374
  "img",
1318
1375
  {
1319
1376
  "data-pdf-page": t.assetId.startsWith("pdf-page-") ? t.pageNumber : void 0,
@@ -1332,10 +1389,10 @@ function oi(e) {
1332
1389
  }
1333
1390
  );
1334
1391
  }
1335
- function ri(e) {
1392
+ function ci(e) {
1336
1393
  const t = w(() => e.store.showArrows.value && e.store.currentPage.value > 0), s = w(() => !e.store.showArrows.value || e.store.totalPages.value <= 1 ? !1 : e.store.currentPage.value < e.store.totalPages.value - 1);
1337
- return /* @__PURE__ */ p("div", { class: "bk-nav-arrows", style: w(() => e.store.showArrows.value ? "display: flex;" : "display: none;"), children: [
1338
- /* @__PURE__ */ p(
1394
+ return /* @__PURE__ */ d("div", { class: "bk-nav-arrows", style: w(() => e.store.showArrows.value ? "display: flex;" : "display: none;"), children: [
1395
+ /* @__PURE__ */ d(
1339
1396
  "button",
1340
1397
  {
1341
1398
  type: "button",
@@ -1345,10 +1402,10 @@ function ri(e) {
1345
1402
  o.preventDefault(), e.onPrevPage();
1346
1403
  },
1347
1404
  "aria-label": "Previous Page",
1348
- children: /* @__PURE__ */ p("div", { class: "bk-arrow-icon bk-arrow-left" })
1405
+ children: /* @__PURE__ */ d("div", { class: "bk-arrow-icon bk-arrow-left" })
1349
1406
  }
1350
1407
  ),
1351
- /* @__PURE__ */ p(
1408
+ /* @__PURE__ */ d(
1352
1409
  "button",
1353
1410
  {
1354
1411
  type: "button",
@@ -1358,42 +1415,46 @@ function ri(e) {
1358
1415
  o.preventDefault(), e.onNextPage();
1359
1416
  },
1360
1417
  "aria-label": "Next Page",
1361
- children: /* @__PURE__ */ p("div", { class: "bk-arrow-icon bk-arrow-right" })
1418
+ children: /* @__PURE__ */ d("div", { class: "bk-arrow-icon bk-arrow-right" })
1362
1419
  }
1363
1420
  )
1364
1421
  ] });
1365
1422
  }
1366
- function ai(e) {
1423
+ function di(e) {
1367
1424
  const t = () => {
1368
1425
  e.store.showThumbs.value = !e.store.showThumbs.value;
1369
1426
  }, s = () => {
1370
- e.store.isSingleMode.value = !e.store.isSingleMode.value;
1427
+ e.store.showToc.value = !e.store.showToc.value;
1371
1428
  }, o = () => {
1372
- e.store.isAutoPlaying.value = !e.store.isAutoPlaying.value;
1429
+ e.store.isSingleMode.value = !e.store.isSingleMode.value;
1373
1430
  }, r = () => {
1374
- var b;
1375
- (b = e.interactionManagerRef.current) == null || b.zoomIn();
1431
+ e.store.isAutoPlaying.value = !e.store.isAutoPlaying.value;
1376
1432
  }, h = () => {
1377
- var b;
1378
- (b = e.interactionManagerRef.current) == null || b.zoomOut();
1379
- }, u = () => e.onToggleFullscreen(), g = (b) => {
1380
- var D;
1381
- e.store.currentPage.value !== b && (e.store.currentPage.value = b, (D = e.pageFlipAdapterRef.current) == null || D.playSound());
1382
- }, x = () => {
1383
- var b;
1384
- (b = e.pageFlipAdapterRef.current) == null || b.turnToNextPage();
1385
- }, P = () => {
1386
- var b;
1387
- (b = e.pageFlipAdapterRef.current) == null || b.turnToPrevPage();
1433
+ var S;
1434
+ (S = e.interactionManagerRef.current) == null || S.zoomIn();
1435
+ }, u = () => {
1436
+ var S;
1437
+ (S = e.interactionManagerRef.current) == null || S.zoomOut();
1438
+ }, p = () => e.onToggleFullscreen(), b = (S) => {
1439
+ e.store.currentPage.value = S, e.store.showToc.value = !1;
1440
+ }, x = (S) => {
1441
+ var T;
1442
+ e.store.currentPage.value !== S && (e.store.currentPage.value = S, (T = e.pageFlipAdapterRef.current) == null || T.playSound());
1443
+ }, M = () => {
1444
+ var S;
1445
+ (S = e.pageFlipAdapterRef.current) == null || S.turnToNextPage();
1446
+ }, I = () => {
1447
+ var S;
1448
+ (S = e.pageFlipAdapterRef.current) == null || S.turnToPrevPage();
1388
1449
  };
1389
- return /* @__PURE__ */ p(
1450
+ return /* @__PURE__ */ d(
1390
1451
  "div",
1391
1452
  {
1392
1453
  class: w(() => `bk-wrapper bk-theme-${e.store.themeMode.value} ${e.className || ""}`),
1393
1454
  children: [
1394
- /* @__PURE__ */ p("div", { class: "bk-main-area", children: [
1395
- /* @__PURE__ */ p(
1396
- oi,
1455
+ /* @__PURE__ */ d("div", { class: "bk-main-area", children: [
1456
+ /* @__PURE__ */ d(
1457
+ li,
1397
1458
  {
1398
1459
  store: e.store,
1399
1460
  bookWrapperRef: e.bookWrapperRef,
@@ -1401,51 +1462,53 @@ function ai(e) {
1401
1462
  bookContainerRef: e.bookContainerRef
1402
1463
  }
1403
1464
  ),
1404
- /* @__PURE__ */ p(
1405
- ri,
1465
+ /* @__PURE__ */ d(
1466
+ ci,
1406
1467
  {
1407
1468
  store: e.store,
1408
- onPrevPage: P,
1409
- onNextPage: x
1469
+ onPrevPage: I,
1470
+ onNextPage: M
1410
1471
  }
1411
1472
  ),
1412
- e.store.whiteLabel.value ? null : /* @__PURE__ */ p("div", { class: "bk-watermark", children: [
1473
+ e.store.whiteLabel.value ? null : /* @__PURE__ */ d("div", { class: "bk-watermark", children: [
1413
1474
  "Powered by ",
1414
- /* @__PURE__ */ p("a", { href: "https://flipbookengine.com", target: "_blank", rel: "noopener", style: "text-decoration: underline;", children: "FlipbookEngine" })
1415
- ] })
1475
+ /* @__PURE__ */ d("a", { href: "https://flipbookengine.com", target: "_blank", rel: "noopener", style: "text-decoration: underline;", children: "FlipbookEngine" })
1476
+ ] }),
1477
+ /* @__PURE__ */ d(hi, { store: e.store, onEntryClick: b })
1416
1478
  ] }),
1417
- /* @__PURE__ */ p(
1418
- si,
1479
+ /* @__PURE__ */ d(
1480
+ ri,
1419
1481
  {
1420
1482
  store: e.store,
1421
1483
  onToggleThumbs: t,
1422
- onToggleSingleMode: s,
1423
- onZoomIn: r,
1424
- onZoomOut: h,
1484
+ onToggleToc: s,
1485
+ onToggleSingleMode: o,
1486
+ onZoomIn: h,
1487
+ onZoomOut: u,
1425
1488
  onDownload: e.onDownload,
1426
- onNextPage: x,
1427
- onPrevPage: P,
1489
+ onNextPage: M,
1490
+ onPrevPage: I,
1428
1491
  onSoundToggle: () => e.store.soundEnabled.value = !e.store.soundEnabled.value,
1429
- onToggleAutoPlay: o,
1430
- onToggleFullscreen: u
1492
+ onToggleAutoPlay: r,
1493
+ onToggleFullscreen: p
1431
1494
  }
1432
1495
  ),
1433
- /* @__PURE__ */ p(
1434
- ni,
1496
+ /* @__PURE__ */ d(
1497
+ ai,
1435
1498
  {
1436
1499
  store: e.store,
1437
- onThumbClick: g
1500
+ onThumbClick: x
1438
1501
  }
1439
1502
  )
1440
1503
  ]
1441
1504
  }
1442
1505
  );
1443
1506
  }
1444
- var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Dt = { exports: {} };
1507
+ var ui = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Dt = { exports: {} };
1445
1508
  (function(e, t) {
1446
1509
  (function(s, o) {
1447
1510
  o(t);
1448
- })(hi, function(s) {
1511
+ })(ui, function(s) {
1449
1512
  class o {
1450
1513
  constructor(i, n) {
1451
1514
  this.state = { angle: 0, area: [], position: { x: 0, y: 0 }, hardAngle: 0, hardDrawingAngle: 0 }, this.createdDensity = n, this.nowDrawingDensity = this.createdDensity, this.render = i;
@@ -1489,19 +1552,19 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1489
1552
  super(i, a), this.image = null, this.isLoad = !1, this.loadingAngle = 0, this.image = new Image(), this.image.src = n;
1490
1553
  }
1491
1554
  draw(i) {
1492
- const n = this.render.getContext(), a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, d = this.render.getRect().height;
1555
+ const n = this.render.getContext(), a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, c = this.render.getRect().height;
1493
1556
  n.save(), n.translate(a.x, a.y), n.beginPath();
1494
- for (let c of this.state.area) c !== null && (c = this.render.convertToGlobal(c), n.lineTo(c.x - a.x, c.y - a.y));
1495
- n.rotate(this.state.angle), n.clip(), this.isLoad ? n.drawImage(this.image, 0, 0, l, d) : this.drawLoader(n, { x: 0, y: 0 }, l, d), n.restore();
1557
+ for (let g of this.state.area) g !== null && (g = this.render.convertToGlobal(g), n.lineTo(g.x - a.x, g.y - a.y));
1558
+ n.rotate(this.state.angle), n.clip(), this.isLoad ? n.drawImage(this.image, 0, 0, l, c) : this.drawLoader(n, { x: 0, y: 0 }, l, c), n.restore();
1496
1559
  }
1497
1560
  simpleDraw(i) {
1498
- const n = this.render.getRect(), a = this.render.getContext(), l = n.pageWidth, d = n.height, c = i === 1 ? n.left + n.pageWidth : n.left, v = n.top;
1499
- this.isLoad ? a.drawImage(this.image, c, v, l, d) : this.drawLoader(a, { x: c, y: v }, l, d);
1561
+ const n = this.render.getRect(), a = this.render.getContext(), l = n.pageWidth, c = n.height, g = i === 1 ? n.left + n.pageWidth : n.left, y = n.top;
1562
+ this.isLoad ? a.drawImage(this.image, g, y, l, c) : this.drawLoader(a, { x: g, y }, l, c);
1500
1563
  }
1501
1564
  drawLoader(i, n, a, l) {
1502
1565
  i.beginPath(), i.strokeStyle = "rgb(200, 200, 200)", i.fillStyle = "rgb(255, 255, 255)", i.lineWidth = 1, i.rect(n.x + 1, n.y + 1, a - 1, l - 1), i.stroke(), i.fill();
1503
- const d = { x: n.x + a / 2, y: n.y + l / 2 };
1504
- i.beginPath(), i.lineWidth = 10, i.arc(d.x, d.y, 20, this.loadingAngle, 3 * Math.PI / 2 + this.loadingAngle), i.stroke(), i.closePath(), this.loadingAngle += 0.07, this.loadingAngle >= 2 * Math.PI && (this.loadingAngle = 0);
1566
+ const c = { x: n.x + a / 2, y: n.y + l / 2 };
1567
+ i.beginPath(), i.lineWidth = 10, i.arc(c.x, c.y, 20, this.loadingAngle, 3 * Math.PI / 2 + this.loadingAngle), i.stroke(), i.closePath(), this.loadingAngle += 0.07, this.loadingAngle >= 2 * Math.PI && (this.loadingAngle = 0);
1505
1568
  }
1506
1569
  load() {
1507
1570
  this.isLoad || (this.image.onload = () => {
@@ -1611,16 +1674,16 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1611
1674
  this.createSpread();
1612
1675
  }
1613
1676
  }
1614
- class g {
1677
+ class p {
1615
1678
  static GetDistanceBetweenTwoPoint(i, n) {
1616
1679
  return i === null || n === null ? 1 / 0 : Math.sqrt(Math.pow(n.x - i.x, 2) + Math.pow(n.y - i.y, 2));
1617
1680
  }
1618
1681
  static GetSegmentLength(i) {
1619
- return g.GetDistanceBetweenTwoPoint(i[0], i[1]);
1682
+ return p.GetDistanceBetweenTwoPoint(i[0], i[1]);
1620
1683
  }
1621
1684
  static GetAngleBetweenTwoLine(i, n) {
1622
- const a = i[0].y - i[1].y, l = n[0].y - n[1].y, d = i[1].x - i[0].x, c = n[1].x - n[0].x;
1623
- return Math.acos((a * l + d * c) / (Math.sqrt(a * a + d * d) * Math.sqrt(l * l + c * c)));
1685
+ const a = i[0].y - i[1].y, l = n[0].y - n[1].y, c = i[1].x - i[0].x, g = n[1].x - n[0].x;
1686
+ return Math.acos((a * l + c * g) / (Math.sqrt(a * a + c * c) * Math.sqrt(l * l + g * g)));
1624
1687
  }
1625
1688
  static PointInRect(i, n) {
1626
1689
  return n === null ? null : n.x >= i.left && n.x <= i.width + i.left && n.y >= i.top && n.y <= i.top + i.height ? n : null;
@@ -1629,37 +1692,37 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1629
1692
  return { x: i.x * Math.cos(a) + i.y * Math.sin(a) + n.x, y: i.y * Math.cos(a) - i.x * Math.sin(a) + n.y };
1630
1693
  }
1631
1694
  static LimitPointToCircle(i, n, a) {
1632
- if (g.GetDistanceBetweenTwoPoint(i, a) <= n) return a;
1633
- const l = i.x, d = i.y, c = a.x, v = a.y;
1634
- let y = Math.sqrt(Math.pow(n, 2) * Math.pow(l - c, 2) / (Math.pow(l - c, 2) + Math.pow(d - v, 2))) + l;
1635
- a.x < 0 && (y *= -1);
1636
- let A = (y - l) * (d - v) / (l - c) + d;
1637
- return l - c + d === 0 && (A = n), { x: y, y: A };
1695
+ if (p.GetDistanceBetweenTwoPoint(i, a) <= n) return a;
1696
+ const l = i.x, c = i.y, g = a.x, y = a.y;
1697
+ let f = Math.sqrt(Math.pow(n, 2) * Math.pow(l - g, 2) / (Math.pow(l - g, 2) + Math.pow(c - y, 2))) + l;
1698
+ a.x < 0 && (f *= -1);
1699
+ let C = (f - l) * (c - y) / (l - g) + c;
1700
+ return l - g + c === 0 && (C = n), { x: f, y: C };
1638
1701
  }
1639
1702
  static GetIntersectBetweenTwoSegment(i, n, a) {
1640
- return g.PointInRect(i, g.GetIntersectBeetwenTwoLine(n, a));
1703
+ return p.PointInRect(i, p.GetIntersectBeetwenTwoLine(n, a));
1641
1704
  }
1642
1705
  static GetIntersectBeetwenTwoLine(i, n) {
1643
- const a = i[0].y - i[1].y, l = n[0].y - n[1].y, d = i[1].x - i[0].x, c = n[1].x - n[0].x, v = i[0].x * i[1].y - i[1].x * i[0].y, y = n[0].x * n[1].y - n[1].x * n[0].y, A = a * y - l * v, R = d * y - c * v, W = -(v * c - y * d) / (a * c - l * d), K = -(a * y - l * v) / (a * c - l * d);
1644
- if (isFinite(W) && isFinite(K)) return { x: W, y: K };
1645
- if (Math.abs(A - R) < 0.1) throw new Error("Segment included");
1706
+ const a = i[0].y - i[1].y, l = n[0].y - n[1].y, c = i[1].x - i[0].x, g = n[1].x - n[0].x, y = i[0].x * i[1].y - i[1].x * i[0].y, f = n[0].x * n[1].y - n[1].x * n[0].y, C = a * f - l * y, R = c * f - g * y, F = -(y * g - f * c) / (a * g - l * c), K = -(a * f - l * y) / (a * g - l * c);
1707
+ if (isFinite(F) && isFinite(K)) return { x: F, y: K };
1708
+ if (Math.abs(C - R) < 0.1) throw new Error("Segment included");
1646
1709
  return null;
1647
1710
  }
1648
1711
  static GetCordsFromTwoPoint(i, n) {
1649
- const a = Math.abs(i.x - n.x), l = Math.abs(i.y - n.y), d = Math.max(a, l), c = [i];
1650
- function v(y, A, R, W, K) {
1651
- return A > y ? y + K * (R / W) : A < y ? y - K * (R / W) : y;
1712
+ const a = Math.abs(i.x - n.x), l = Math.abs(i.y - n.y), c = Math.max(a, l), g = [i];
1713
+ function y(f, C, R, F, K) {
1714
+ return C > f ? f + K * (R / F) : C < f ? f - K * (R / F) : f;
1652
1715
  }
1653
- for (let y = 1; y <= d; y += 1) c.push({ x: v(i.x, n.x, a, d, y), y: v(i.y, n.y, l, d, y) });
1654
- return c;
1716
+ for (let f = 1; f <= c; f += 1) g.push({ x: y(i.x, n.x, a, c, f), y: y(i.y, n.y, l, c, f) });
1717
+ return g;
1655
1718
  }
1656
1719
  }
1657
- class x extends o {
1720
+ class b extends o {
1658
1721
  constructor(i, n, a) {
1659
1722
  super(i, a), this.copiedElement = null, this.temporaryCopy = null, this.isLoad = !1, this.element = n, this.element.classList.add("stf__item"), this.element.classList.add("--" + a);
1660
1723
  }
1661
1724
  newTemporaryCopy() {
1662
- return this.nowDrawingDensity === "hard" ? this : (this.temporaryCopy === null && (this.copiedElement = this.element.cloneNode(!0), this.element.parentElement.appendChild(this.copiedElement), this.temporaryCopy = new x(this.render, this.copiedElement, this.nowDrawingDensity)), this.getTemporaryCopy());
1725
+ return this.nowDrawingDensity === "hard" ? this : (this.temporaryCopy === null && (this.copiedElement = this.element.cloneNode(!0), this.element.parentElement.appendChild(this.copiedElement), this.temporaryCopy = new b(this.render, this.copiedElement, this.nowDrawingDensity)), this.getTemporaryCopy());
1663
1726
  }
1664
1727
  getTemporaryCopy() {
1665
1728
  return this.temporaryCopy;
@@ -1668,17 +1731,17 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1668
1731
  this.temporaryCopy !== null && (this.copiedElement.remove(), this.copiedElement = null, this.temporaryCopy = null);
1669
1732
  }
1670
1733
  draw(i) {
1671
- const n = i || this.nowDrawingDensity, a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, d = this.render.getRect().height;
1734
+ const n = i || this.nowDrawingDensity, a = this.render.convertToGlobal(this.state.position), l = this.render.getRect().pageWidth, c = this.render.getRect().height;
1672
1735
  this.element.classList.remove("--simple");
1673
- const c = `
1736
+ const g = `
1674
1737
  display: block;
1675
1738
  z-index: ${this.element.style.zIndex};
1676
1739
  left: 0;
1677
1740
  top: 0;
1678
1741
  width: ${l}px;
1679
- height: ${d}px;
1742
+ height: ${c}px;
1680
1743
  `;
1681
- n === "hard" ? this.drawHard(c) : this.drawSoft(a, c);
1744
+ n === "hard" ? this.drawHard(g) : this.drawSoft(a, g);
1682
1745
  }
1683
1746
  drawHard(i = "") {
1684
1747
  const n = this.render.getRect().left + this.render.getRect().width / 2, a = this.state.hardDrawingAngle, l = i + `
@@ -1693,22 +1756,22 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1693
1756
  }
1694
1757
  drawSoft(i, n = "") {
1695
1758
  let a = "polygon( ";
1696
- for (const d of this.state.area) if (d !== null) {
1697
- let c = this.render.getDirection() === 1 ? { x: -d.x + this.state.position.x, y: d.y - this.state.position.y } : { x: d.x - this.state.position.x, y: d.y - this.state.position.y };
1698
- c = g.GetRotatedPoint(c, { x: 0, y: 0 }, this.state.angle), a += c.x + "px " + c.y + "px, ";
1759
+ for (const c of this.state.area) if (c !== null) {
1760
+ let g = this.render.getDirection() === 1 ? { x: -c.x + this.state.position.x, y: c.y - this.state.position.y } : { x: c.x - this.state.position.x, y: c.y - this.state.position.y };
1761
+ g = p.GetRotatedPoint(g, { x: 0, y: 0 }, this.state.angle), a += g.x + "px " + g.y + "px, ";
1699
1762
  }
1700
1763
  a = a.slice(0, -2), a += ")";
1701
1764
  const l = n + `transform-origin: 0 0; clip-path: ${a}; -webkit-clip-path: ${a};` + (this.render.isSafari() && this.state.angle === 0 ? `transform: translate(${i.x}px, ${i.y}px);` : `transform: translate3d(${i.x}px, ${i.y}px, 0) rotate(${this.state.angle}rad);`);
1702
1765
  this.element.style.cssText = l;
1703
1766
  }
1704
1767
  simpleDraw(i) {
1705
- const n = this.render.getRect(), a = n.pageWidth, l = n.height, d = i === 1 ? n.left + n.pageWidth : n.left, c = n.top;
1768
+ const n = this.render.getRect(), a = n.pageWidth, l = n.height, c = i === 1 ? n.left + n.pageWidth : n.left, g = n.top;
1706
1769
  this.element.classList.add("--simple"), this.element.style.cssText = `
1707
1770
  position: absolute;
1708
1771
  display: block;
1709
1772
  height: ${l}px;
1710
- left: ${d}px;
1711
- top: ${c}px;
1773
+ left: ${c}px;
1774
+ top: ${g}px;
1712
1775
  width: ${a}px;
1713
1776
  z-index: ${this.render.getSettings().startZIndex + 1};`;
1714
1777
  }
@@ -1725,19 +1788,19 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1725
1788
  this.element.classList.remove("--soft", "--hard"), this.element.classList.add("--" + i), super.setDrawingDensity(i);
1726
1789
  }
1727
1790
  }
1728
- class P extends h {
1791
+ class x extends h {
1729
1792
  constructor(i, n, a, l) {
1730
1793
  super(i, n), this.element = a, this.pagesElement = l;
1731
1794
  }
1732
1795
  load() {
1733
1796
  for (const i of this.pagesElement) {
1734
- const n = new x(this.render, i, i.dataset.density === "hard" ? "hard" : "soft");
1797
+ const n = new b(this.render, i, i.dataset.density === "hard" ? "hard" : "soft");
1735
1798
  n.load(), this.pages.push(n);
1736
1799
  }
1737
1800
  this.createSpread();
1738
1801
  }
1739
1802
  }
1740
- class b {
1803
+ class M {
1741
1804
  constructor(i, n, a, l) {
1742
1805
  this.direction = i, this.corner = n, this.topIntersectPoint = null, this.sideIntersectPoint = null, this.bottomIntersectPoint = null, this.pageWidth = parseInt(a, 10), this.pageHeight = parseInt(l, 10);
1743
1806
  }
@@ -1755,7 +1818,7 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1755
1818
  }
1756
1819
  getBottomClipArea() {
1757
1820
  const i = [];
1758
- return i.push(this.topIntersectPoint), this.corner === "top" ? i.push({ x: this.pageWidth, y: 0 }) : (this.topIntersectPoint !== null && i.push({ x: this.pageWidth, y: 0 }), i.push({ x: this.pageWidth, y: this.pageHeight })), this.sideIntersectPoint !== null ? g.GetDistanceBetweenTwoPoint(this.sideIntersectPoint, this.topIntersectPoint) >= 10 && i.push(this.sideIntersectPoint) : this.corner === "top" && i.push({ x: this.pageWidth, y: this.pageHeight }), i.push(this.bottomIntersectPoint), i.push(this.topIntersectPoint), i;
1821
+ return i.push(this.topIntersectPoint), this.corner === "top" ? i.push({ x: this.pageWidth, y: 0 }) : (this.topIntersectPoint !== null && i.push({ x: this.pageWidth, y: 0 }), i.push({ x: this.pageWidth, y: this.pageHeight })), this.sideIntersectPoint !== null ? p.GetDistanceBetweenTwoPoint(this.sideIntersectPoint, this.topIntersectPoint) >= 10 && i.push(this.sideIntersectPoint) : this.corner === "top" && i.push({ x: this.pageWidth, y: this.pageHeight }), i.push(this.bottomIntersectPoint), i.push(this.topIntersectPoint), i;
1759
1822
  }
1760
1823
  getAngle() {
1761
1824
  return this.direction === 0 ? -this.angle : this.angle;
@@ -1785,7 +1848,7 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1785
1848
  return this.corner === "top" ? this.topIntersectPoint : this.sideIntersectPoint !== null ? this.sideIntersectPoint : this.topIntersectPoint;
1786
1849
  }
1787
1850
  getShadowAngle() {
1788
- const i = g.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(), [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]);
1851
+ const i = p.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(), [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]);
1789
1852
  return this.direction === 0 ? i : Math.PI - i;
1790
1853
  }
1791
1854
  calcAngleAndPosition(i) {
@@ -1800,8 +1863,8 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1800
1863
  const n = this.pageWidth - i.x + 1, a = this.corner === "bottom" ? this.pageHeight - i.y : i.y;
1801
1864
  let l = 2 * Math.acos(n / Math.sqrt(a * a + n * n));
1802
1865
  a < 0 && (l = -l);
1803
- const d = Math.PI - l;
1804
- if (!isFinite(l) || d >= 0 && d < 3e-3) throw new Error("The G point is too small");
1866
+ const c = Math.PI - l;
1867
+ if (!isFinite(l) || c >= 0 && c < 3e-3) throw new Error("The G point is too small");
1805
1868
  return this.corner === "bottom" && (l = -l), l;
1806
1869
  }
1807
1870
  getPageRect(i) {
@@ -1815,17 +1878,17 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1815
1878
  }
1816
1879
  calculateIntersectPoint(i) {
1817
1880
  const n = { left: -1, top: -1, width: this.pageWidth + 2, height: this.pageHeight + 2 };
1818
- this.corner === "top" ? (this.topIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [i, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [i, this.rect.bottomLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }])) : (this.topIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [this.rect.topLeft, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [i, this.rect.topLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = g.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }]));
1881
+ this.corner === "top" ? (this.topIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [i, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [i, this.rect.bottomLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }])) : (this.topIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [this.rect.topLeft, this.rect.topRight], [{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }]), this.sideIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [i, this.rect.topLeft], [{ x: this.pageWidth, y: 0 }, { x: this.pageWidth, y: this.pageHeight }]), this.bottomIntersectPoint = p.GetIntersectBetweenTwoSegment(n, [this.rect.bottomLeft, this.rect.bottomRight], [{ x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }]));
1819
1882
  }
1820
1883
  checkPositionAtCenterLine(i, n, a) {
1821
1884
  let l = i;
1822
- const d = g.LimitPointToCircle(n, this.pageWidth, l);
1823
- l !== d && (l = d, this.updateAngleAndGeometry(l));
1824
- const c = Math.sqrt(Math.pow(this.pageWidth, 2) + Math.pow(this.pageHeight, 2));
1825
- let v = this.rect.bottomRight, y = this.rect.topLeft;
1826
- if (this.corner === "bottom" && (v = this.rect.topRight, y = this.rect.bottomLeft), v.x <= 0) {
1827
- const A = g.LimitPointToCircle(a, c, y);
1828
- A !== l && (l = A, this.updateAngleAndGeometry(l));
1885
+ const c = p.LimitPointToCircle(n, this.pageWidth, l);
1886
+ l !== c && (l = c, this.updateAngleAndGeometry(l));
1887
+ const g = Math.sqrt(Math.pow(this.pageWidth, 2) + Math.pow(this.pageHeight, 2));
1888
+ let y = this.rect.bottomRight, f = this.rect.topLeft;
1889
+ if (this.corner === "bottom" && (y = this.rect.topRight, f = this.rect.bottomLeft), y.x <= 0) {
1890
+ const C = p.LimitPointToCircle(a, g, f);
1891
+ C !== l && (l = C, this.updateAngleAndGeometry(l));
1829
1892
  }
1830
1893
  return l;
1831
1894
  }
@@ -1834,7 +1897,7 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1834
1897
  return [i, i !== this.sideIntersectPoint && this.sideIntersectPoint !== null ? this.sideIntersectPoint : this.bottomIntersectPoint];
1835
1898
  }
1836
1899
  }
1837
- class D {
1900
+ class I {
1838
1901
  constructor(i, n) {
1839
1902
  this.flippingPage = null, this.bottomPage = null, this.calc = null, this.state = "read", this.render = i, this.app = n;
1840
1903
  }
@@ -1845,22 +1908,22 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1845
1908
  if (this.app.getSettings().disableFlipByClick && !this.isPointOnCorners(i) || (this.calc !== null && this.render.finishAnimation(), !this.start(i))) return;
1846
1909
  const n = this.getBoundsRect();
1847
1910
  this.setState("flipping");
1848
- const a = n.height / 10, l = this.calc.getCorner() === "bottom" ? n.height - a : a, d = this.calc.getCorner() === "bottom" ? n.height : 0;
1849
- this.calc.calc({ x: n.pageWidth - a, y: l }), this.animateFlippingTo({ x: n.pageWidth - a, y: l }, { x: -n.pageWidth, y: d }, !0);
1911
+ const a = n.height / 10, l = this.calc.getCorner() === "bottom" ? n.height - a : a, c = this.calc.getCorner() === "bottom" ? n.height : 0;
1912
+ this.calc.calc({ x: n.pageWidth - a, y: l }), this.animateFlippingTo({ x: n.pageWidth - a, y: l }, { x: -n.pageWidth, y: c }, !0);
1850
1913
  }
1851
1914
  start(i) {
1852
1915
  this.reset();
1853
- const n = this.render.convertToBook(i), a = this.getBoundsRect(), l = this.getDirectionByPoint(n), d = n.y >= a.height / 2 ? "bottom" : "top";
1916
+ const n = this.render.convertToBook(i), a = this.getBoundsRect(), l = this.getDirectionByPoint(n), c = n.y >= a.height / 2 ? "bottom" : "top";
1854
1917
  if (!this.checkDirection(l)) return !1;
1855
1918
  try {
1856
1919
  if (this.flippingPage = this.app.getPageCollection().getFlippingPage(l), this.bottomPage = this.app.getPageCollection().getBottomPage(l), this.render.getOrientation() === "landscape") if (l === 1) {
1857
- const c = this.app.getPageCollection().nextBy(this.flippingPage);
1858
- c !== null && this.flippingPage.getDensity() !== c.getDensity() && (this.flippingPage.setDrawingDensity("hard"), c.setDrawingDensity("hard"));
1920
+ const g = this.app.getPageCollection().nextBy(this.flippingPage);
1921
+ g !== null && this.flippingPage.getDensity() !== g.getDensity() && (this.flippingPage.setDrawingDensity("hard"), g.setDrawingDensity("hard"));
1859
1922
  } else {
1860
- const c = this.app.getPageCollection().prevBy(this.flippingPage);
1861
- c !== null && this.flippingPage.getDensity() !== c.getDensity() && (this.flippingPage.setDrawingDensity("hard"), c.setDrawingDensity("hard"));
1923
+ const g = this.app.getPageCollection().prevBy(this.flippingPage);
1924
+ g !== null && this.flippingPage.getDensity() !== g.getDensity() && (this.flippingPage.setDrawingDensity("hard"), g.setDrawingDensity("hard"));
1862
1925
  }
1863
- return this.render.setDirection(l), this.calc = new b(l, d, a.pageWidth.toString(10), a.height.toString(10)), !0;
1926
+ return this.render.setDirection(l), this.calc = new M(l, c, a.pageWidth.toString(10), a.height.toString(10)), !0;
1864
1927
  } catch {
1865
1928
  return !1;
1866
1929
  }
@@ -1895,16 +1958,16 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1895
1958
  if (this.isPointOnCorners(i)) if (this.calc === null) {
1896
1959
  if (!this.start(i)) return;
1897
1960
  this.setState("fold_corner"), this.calc.calc({ x: a - 1, y: 1 });
1898
- const l = 50, d = this.calc.getCorner() === "bottom" ? n.height - 1 : 1, c = this.calc.getCorner() === "bottom" ? n.height - l : l;
1899
- this.animateFlippingTo({ x: a - 1, y: d }, { x: a - l, y: c }, !1, !1);
1961
+ const l = 50, c = this.calc.getCorner() === "bottom" ? n.height - 1 : 1, g = this.calc.getCorner() === "bottom" ? n.height - l : l;
1962
+ this.animateFlippingTo({ x: a - 1, y: c }, { x: a - l, y: g }, !1, !1);
1900
1963
  } else this.do(this.render.convertToPage(i));
1901
1964
  else this.setState("read"), this.render.finishAnimation(), this.stopMove();
1902
1965
  }
1903
1966
  animateFlippingTo(i, n, a, l = !0) {
1904
- const d = g.GetCordsFromTwoPoint(i, n), c = [];
1905
- for (const y of d) c.push(() => this.do(y));
1906
- const v = this.getAnimationDuration(d.length);
1907
- this.render.startAnimation(c, v, () => {
1967
+ const c = p.GetCordsFromTwoPoint(i, n), g = [];
1968
+ for (const f of c) g.push(() => this.do(f));
1969
+ const y = this.getAnimationDuration(c.length);
1970
+ this.render.startAnimation(g, y, () => {
1908
1971
  this.calc && (a && (this.calc.getDirection() === 1 ? this.app.turnToPrevPage() : this.app.turnToNextPage()), l && (this.render.setBottomPage(null), this.render.setFlippingPage(null), this.render.clearShadow(), this.setState("read"), this.reset()));
1909
1972
  });
1910
1973
  }
@@ -1942,11 +2005,11 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1942
2005
  return !1;
1943
2006
  }
1944
2007
  isPointOnCorners(i) {
1945
- const n = this.getBoundsRect(), a = n.pageWidth, l = Math.sqrt(Math.pow(a, 2) + Math.pow(n.height, 2)) / 5, d = this.render.convertToBook(i);
1946
- return d.x > 0 && d.y > 0 && d.x < n.width && d.y < n.height && (d.x < l || d.x > n.width - l) && (d.y < l || d.y > n.height - l);
2008
+ const n = this.getBoundsRect(), a = n.pageWidth, l = Math.sqrt(Math.pow(a, 2) + Math.pow(n.height, 2)) / 5, c = this.render.convertToBook(i);
2009
+ return c.x > 0 && c.y > 0 && c.x < n.width && c.y < n.height && (c.x < l || c.x > n.width - l) && (c.y < l || c.y > n.height - l);
1947
2010
  }
1948
2011
  }
1949
- class $ {
2012
+ class S {
1950
2013
  constructor(i, n) {
1951
2014
  this.leftPage = null, this.rightPage = null, this.flippingPage = null, this.bottomPage = null, this.direction = null, this.orientation = null, this.shadow = null, this.animation = null, this.pageRect = null, this.boundsRect = null, this.timer = 0, this.safari = !1, this.setting = n, this.app = i;
1952
2015
  const a = new RegExp("Version\\/[\\d\\.]+.*Safari/");
@@ -1979,14 +2042,14 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1979
2042
  }
1980
2043
  calculateBoundsRect() {
1981
2044
  let i = "landscape";
1982
- const n = this.getBlockWidth(), a = n / 2, l = this.getBlockHeight() / 2, d = this.setting.width / this.setting.height;
1983
- let c = this.setting.width, v = this.setting.height, y = a - c;
1984
- return this.setting.size === "stretch" ? (n < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (i = "portrait"), c = i === "portrait" ? this.getBlockWidth() : this.getBlockWidth() / 2, c > this.setting.maxWidth && (c = this.setting.maxWidth), v = c / d, v > this.getBlockHeight() && (v = this.getBlockHeight(), c = v * d), y = i === "portrait" ? a - c / 2 - c : a - c) : n < 2 * c && this.app.getSettings().usePortrait && (i = "portrait", y = a - c / 2 - c), this.boundsRect = { left: y, top: l - v / 2, width: 2 * c, height: v, pageWidth: c }, i;
2045
+ const n = this.getBlockWidth(), a = n / 2, l = this.getBlockHeight() / 2, c = this.setting.width / this.setting.height;
2046
+ let g = this.setting.width, y = this.setting.height, f = a - g;
2047
+ return this.setting.size === "stretch" ? (n < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (i = "portrait"), g = i === "portrait" ? this.getBlockWidth() : this.getBlockWidth() / 2, g > this.setting.maxWidth && (g = this.setting.maxWidth), y = g / c, y > this.getBlockHeight() && (y = this.getBlockHeight(), g = y * c), f = i === "portrait" ? a - g / 2 - g : a - g) : n < 2 * g && this.app.getSettings().usePortrait && (i = "portrait", f = a - g / 2 - g), this.boundsRect = { left: f, top: l - y / 2, width: 2 * g, height: y, pageWidth: g }, i;
1985
2048
  }
1986
2049
  setShadowData(i, n, a, l) {
1987
2050
  if (!this.app.getSettings().drawShadow) return;
1988
- const d = 100 * this.getSettings().maxShadowOpacity;
1989
- this.shadow = { pos: i, angle: n, width: 3 * this.getRect().pageWidth / 4 * a / 100, opacity: (100 - a) * d / 100 / 100, direction: l, progress: 2 * a };
2051
+ const c = 100 * this.getSettings().maxShadowOpacity;
2052
+ this.shadow = { pos: i, angle: n, width: 3 * this.getRect().pageWidth / 4 * a / 100, opacity: (100 - a) * c / 100 / 100, direction: l, progress: 2 * a };
1990
2053
  }
1991
2054
  clearShadow() {
1992
2055
  this.shadow = null;
@@ -2048,7 +2111,7 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2048
2111
  return n || (n = this.direction), { topLeft: this.convertToGlobal(i.topLeft, n), topRight: this.convertToGlobal(i.topRight, n), bottomLeft: this.convertToGlobal(i.bottomLeft, n), bottomRight: this.convertToGlobal(i.bottomRight, n) };
2049
2112
  }
2050
2113
  }
2051
- class C extends $ {
2114
+ class T extends S {
2052
2115
  constructor(i, n, a) {
2053
2116
  super(i, n), this.canvas = a, this.ctx = a.getContext("2d");
2054
2117
  }
@@ -2085,49 +2148,49 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2085
2148
  this.ctx.save(), this.ctx.beginPath();
2086
2149
  const n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.convertRectToGlobal(this.pageRect);
2087
2150
  this.ctx.moveTo(a.topLeft.x, a.topLeft.y), this.ctx.lineTo(a.topRight.x, a.topRight.y), this.ctx.lineTo(a.bottomRight.x, a.bottomRight.y), this.ctx.lineTo(a.bottomLeft.x, a.bottomLeft.y), this.ctx.translate(n.x, n.y), this.ctx.rotate(Math.PI + this.shadow.angle + Math.PI / 2);
2088
- const l = 3 * this.shadow.width / 4, d = this.ctx.createLinearGradient(0, 0, l, 0);
2089
- this.shadow.direction === 0 ? (this.ctx.translate(-l, -100), d.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0.9, "rgba(0, 0, 0, 0.05)"), d.addColorStop(0.7, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(0, -100), d.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(0.1, "rgba(0, 0, 0, 0.05)"), d.addColorStop(0.3, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), d.addColorStop(1, "rgba(0, 0, 0, 0)")), this.ctx.clip(), this.ctx.fillStyle = d, this.ctx.fillRect(0, 0, l, 2 * i.height), this.ctx.restore();
2151
+ const l = 3 * this.shadow.width / 4, c = this.ctx.createLinearGradient(0, 0, l, 0);
2152
+ this.shadow.direction === 0 ? (this.ctx.translate(-l, -100), c.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), c.addColorStop(0.9, "rgba(0, 0, 0, 0.05)"), c.addColorStop(0.7, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), c.addColorStop(0, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(0, -100), c.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), c.addColorStop(0.1, "rgba(0, 0, 0, 0.05)"), c.addColorStop(0.3, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), c.addColorStop(1, "rgba(0, 0, 0, 0)")), this.ctx.clip(), this.ctx.fillStyle = c, this.ctx.fillRect(0, 0, l, 2 * i.height), this.ctx.restore();
2090
2153
  }
2091
2154
  clear() {
2092
2155
  this.ctx.fillStyle = "white", this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
2093
2156
  }
2094
2157
  }
2095
- class T {
2158
+ class E {
2096
2159
  constructor(i, n, a) {
2097
2160
  this.touchPoint = null, this.swipeTimeout = 250, this.onResize = () => {
2098
2161
  this.update();
2099
- }, this.onMouseDown = (d) => {
2100
- if (this.checkTarget(d.target)) {
2101
- const c = this.getMousePos(d.clientX, d.clientY);
2102
- this.app.startUserTouch(c), d.preventDefault();
2162
+ }, this.onMouseDown = (c) => {
2163
+ if (this.checkTarget(c.target)) {
2164
+ const g = this.getMousePos(c.clientX, c.clientY);
2165
+ this.app.startUserTouch(g), c.preventDefault();
2103
2166
  }
2104
- }, this.onTouchStart = (d) => {
2105
- if (this.checkTarget(d.target) && d.changedTouches.length > 0) {
2106
- const c = d.changedTouches[0], v = this.getMousePos(c.clientX, c.clientY);
2107
- this.touchPoint = { point: v, time: Date.now() }, setTimeout(() => {
2108
- this.touchPoint !== null && this.app.startUserTouch(v);
2109
- }, this.swipeTimeout), this.app.getSettings().mobileScrollSupport || d.preventDefault();
2167
+ }, this.onTouchStart = (c) => {
2168
+ if (this.checkTarget(c.target) && c.changedTouches.length > 0) {
2169
+ const g = c.changedTouches[0], y = this.getMousePos(g.clientX, g.clientY);
2170
+ this.touchPoint = { point: y, time: Date.now() }, setTimeout(() => {
2171
+ this.touchPoint !== null && this.app.startUserTouch(y);
2172
+ }, this.swipeTimeout), this.app.getSettings().mobileScrollSupport || c.preventDefault();
2110
2173
  }
2111
- }, this.onMouseUp = (d) => {
2112
- const c = this.getMousePos(d.clientX, d.clientY);
2113
- this.app.userStop(c);
2114
- }, this.onMouseMove = (d) => {
2115
- const c = this.getMousePos(d.clientX, d.clientY);
2116
- this.app.userMove(c, !1);
2117
- }, this.onTouchMove = (d) => {
2118
- if (d.changedTouches.length > 0) {
2119
- const c = d.changedTouches[0], v = this.getMousePos(c.clientX, c.clientY);
2120
- this.app.getSettings().mobileScrollSupport ? (this.touchPoint !== null && (Math.abs(this.touchPoint.point.x - v.x) > 10 || this.app.getState() !== "read") && d.cancelable && this.app.userMove(v, !0), this.app.getState() !== "read" && d.preventDefault()) : this.app.userMove(v, !0);
2174
+ }, this.onMouseUp = (c) => {
2175
+ const g = this.getMousePos(c.clientX, c.clientY);
2176
+ this.app.userStop(g);
2177
+ }, this.onMouseMove = (c) => {
2178
+ const g = this.getMousePos(c.clientX, c.clientY);
2179
+ this.app.userMove(g, !1);
2180
+ }, this.onTouchMove = (c) => {
2181
+ if (c.changedTouches.length > 0) {
2182
+ const g = c.changedTouches[0], y = this.getMousePos(g.clientX, g.clientY);
2183
+ this.app.getSettings().mobileScrollSupport ? (this.touchPoint !== null && (Math.abs(this.touchPoint.point.x - y.x) > 10 || this.app.getState() !== "read") && c.cancelable && this.app.userMove(y, !0), this.app.getState() !== "read" && c.preventDefault()) : this.app.userMove(y, !0);
2121
2184
  }
2122
- }, this.onTouchEnd = (d) => {
2123
- if (d.changedTouches.length > 0) {
2124
- const c = d.changedTouches[0], v = this.getMousePos(c.clientX, c.clientY);
2125
- let y = !1;
2185
+ }, this.onTouchEnd = (c) => {
2186
+ if (c.changedTouches.length > 0) {
2187
+ const g = c.changedTouches[0], y = this.getMousePos(g.clientX, g.clientY);
2188
+ let f = !1;
2126
2189
  if (this.touchPoint !== null) {
2127
- const A = v.x - this.touchPoint.point.x, R = Math.abs(v.y - this.touchPoint.point.y);
2128
- Math.abs(A) > this.swipeDistance && R < 2 * this.swipeDistance && Date.now() - this.touchPoint.time < this.swipeTimeout && (A > 0 ? this.app.flipPrev(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom") : this.app.flipNext(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom"), y = !0), this.touchPoint = null;
2190
+ const C = y.x - this.touchPoint.point.x, R = Math.abs(y.y - this.touchPoint.point.y);
2191
+ Math.abs(C) > this.swipeDistance && R < 2 * this.swipeDistance && Date.now() - this.touchPoint.time < this.swipeTimeout && (C > 0 ? this.app.flipPrev(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom") : this.app.flipNext(this.touchPoint.point.y < this.app.getRender().getRect().height / 2 ? "top" : "bottom"), f = !0), this.touchPoint = null;
2129
2192
  }
2130
- this.app.userStop(v, y);
2193
+ this.app.userStop(y, f);
2131
2194
  }
2132
2195
  }, this.parentElement = i, i.classList.add("stf__parent"), i.insertAdjacentHTML("afterbegin", '<div class="stf__wrapper"></div>'), this.wrapper = i.querySelector(".stf__wrapper"), this.app = n;
2133
2196
  const l = this.app.getSettings().usePortrait ? 1 : 2;
@@ -2159,10 +2222,10 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2159
2222
  return !this.app.getSettings().clickEventForward || !["a", "button"].includes(i.tagName.toLowerCase());
2160
2223
  }
2161
2224
  }
2162
- class F extends T {
2225
+ class W extends E {
2163
2226
  constructor(i, n, a, l) {
2164
2227
  super(i, n, a), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = i.querySelector(".stf__block"), this.items = l;
2165
- for (const d of l) this.distElement.appendChild(d);
2228
+ for (const c of l) this.distElement.appendChild(c);
2166
2229
  this.setHandlers();
2167
2230
  }
2168
2231
  clear() {
@@ -2177,7 +2240,7 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2177
2240
  this.app.getRender().update();
2178
2241
  }
2179
2242
  }
2180
- class B extends T {
2243
+ class B extends E {
2181
2244
  constructor(i, n, a) {
2182
2245
  super(i, n, a), this.wrapper.innerHTML = '<canvas class="stf__canvas"></canvas>', this.canvas = i.querySelectorAll("canvas")[0], this.distElement = this.canvas, this.resizeCanvas(), this.setHandlers();
2183
2246
  }
@@ -2192,7 +2255,7 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2192
2255
  this.resizeCanvas(), this.app.getRender().update();
2193
2256
  }
2194
2257
  }
2195
- class H extends $ {
2258
+ class N extends S {
2196
2259
  constructor(i, n, a) {
2197
2260
  super(i, n), this.outerShadow = null, this.innerShadow = null, this.hardShadow = null, this.hardInnerShadow = null, this.element = a, this.createShadows();
2198
2261
  }
@@ -2241,14 +2304,14 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2241
2304
  a += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0) rotateY(180deg);" : "transform: translate3d(0, 0, 0);", this.hardShadow.style.cssText = a;
2242
2305
  }
2243
2306
  drawInnerShadow() {
2244
- const i = this.getRect(), n = 3 * this.shadow.width / 4, a = this.getDirection() === 0 ? n : 0, l = this.getDirection() === 0 ? "to left" : "to right", d = this.convertToGlobal(this.shadow.pos), c = this.shadow.angle + 3 * Math.PI / 2, v = [this.pageRect.topLeft, this.pageRect.topRight, this.pageRect.bottomRight, this.pageRect.bottomLeft];
2245
- let y = "polygon( ";
2246
- for (const R of v) {
2247
- let W = this.getDirection() === 1 ? { x: -R.x + this.shadow.pos.x, y: R.y - this.shadow.pos.y } : { x: R.x - this.shadow.pos.x, y: R.y - this.shadow.pos.y };
2248
- W = g.GetRotatedPoint(W, { x: a, y: 100 }, c), y += W.x + "px " + W.y + "px, ";
2307
+ const i = this.getRect(), n = 3 * this.shadow.width / 4, a = this.getDirection() === 0 ? n : 0, l = this.getDirection() === 0 ? "to left" : "to right", c = this.convertToGlobal(this.shadow.pos), g = this.shadow.angle + 3 * Math.PI / 2, y = [this.pageRect.topLeft, this.pageRect.topRight, this.pageRect.bottomRight, this.pageRect.bottomLeft];
2308
+ let f = "polygon( ";
2309
+ for (const R of y) {
2310
+ let F = this.getDirection() === 1 ? { x: -R.x + this.shadow.pos.x, y: R.y - this.shadow.pos.y } : { x: R.x - this.shadow.pos.x, y: R.y - this.shadow.pos.y };
2311
+ F = p.GetRotatedPoint(F, { x: a, y: 100 }, g), f += F.x + "px " + F.y + "px, ";
2249
2312
  }
2250
- y = y.slice(0, -2), y += ")";
2251
- const A = `
2313
+ f = f.slice(0, -2), f += ")";
2314
+ const C = `
2252
2315
  display: block;
2253
2316
  z-index: ${(this.getSettings().startZIndex + 10).toString(10)};
2254
2317
  width: ${n}px;
@@ -2259,32 +2322,32 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2259
2322
  rgba(0, 0, 0, ${this.shadow.opacity}) 35%,
2260
2323
  rgba(0, 0, 0, 0) 100%);
2261
2324
  transform-origin: ${a}px 100px;
2262
- transform: translate3d(${d.x - a}px, ${d.y - 100}px, 0) rotate(${c}rad);
2263
- clip-path: ${y};
2264
- -webkit-clip-path: ${y};
2325
+ transform: translate3d(${c.x - a}px, ${c.y - 100}px, 0) rotate(${g}rad);
2326
+ clip-path: ${f};
2327
+ -webkit-clip-path: ${f};
2265
2328
  `;
2266
- this.innerShadow.style.cssText = A;
2329
+ this.innerShadow.style.cssText = C;
2267
2330
  }
2268
2331
  drawOuterShadow() {
2269
- const i = this.getRect(), n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.shadow.angle + 3 * Math.PI / 2, l = this.getDirection() === 1 ? this.shadow.width : 0, d = this.getDirection() === 0 ? "to right" : "to left", c = [{ x: 0, y: 0 }, { x: i.pageWidth, y: 0 }, { x: i.pageWidth, y: i.height }, { x: 0, y: i.height }];
2270
- let v = "polygon( ";
2271
- for (const A of c) if (A !== null) {
2272
- let R = this.getDirection() === 1 ? { x: -A.x + this.shadow.pos.x, y: A.y - this.shadow.pos.y } : { x: A.x - this.shadow.pos.x, y: A.y - this.shadow.pos.y };
2273
- R = g.GetRotatedPoint(R, { x: l, y: 100 }, a), v += R.x + "px " + R.y + "px, ";
2332
+ const i = this.getRect(), n = this.convertToGlobal({ x: this.shadow.pos.x, y: this.shadow.pos.y }), a = this.shadow.angle + 3 * Math.PI / 2, l = this.getDirection() === 1 ? this.shadow.width : 0, c = this.getDirection() === 0 ? "to right" : "to left", g = [{ x: 0, y: 0 }, { x: i.pageWidth, y: 0 }, { x: i.pageWidth, y: i.height }, { x: 0, y: i.height }];
2333
+ let y = "polygon( ";
2334
+ for (const C of g) if (C !== null) {
2335
+ let R = this.getDirection() === 1 ? { x: -C.x + this.shadow.pos.x, y: C.y - this.shadow.pos.y } : { x: C.x - this.shadow.pos.x, y: C.y - this.shadow.pos.y };
2336
+ R = p.GetRotatedPoint(R, { x: l, y: 100 }, a), y += R.x + "px " + R.y + "px, ";
2274
2337
  }
2275
- v = v.slice(0, -2), v += ")";
2276
- const y = `
2338
+ y = y.slice(0, -2), y += ")";
2339
+ const f = `
2277
2340
  display: block;
2278
2341
  z-index: ${(this.getSettings().startZIndex + 10).toString(10)};
2279
2342
  width: ${this.shadow.width}px;
2280
2343
  height: ${2 * i.height}px;
2281
- background: linear-gradient(${d}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
2344
+ background: linear-gradient(${c}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
2282
2345
  transform-origin: ${l}px 100px;
2283
2346
  transform: translate3d(${n.x - l}px, ${n.y - 100}px, 0) rotate(${a}rad);
2284
- clip-path: ${v};
2285
- -webkit-clip-path: ${v};
2347
+ clip-path: ${y};
2348
+ -webkit-clip-path: ${y};
2286
2349
  `;
2287
- this.outerShadow.style.cssText = y;
2350
+ this.outerShadow.style.cssText = f;
2288
2351
  }
2289
2352
  drawLeftPage() {
2290
2353
  this.orientation !== "portrait" && this.leftPage !== null && (this.direction === 1 && this.flippingPage !== null && this.flippingPage.getDrawingDensity() === "hard" ? (this.leftPage.getElement().style.zIndex = (this.getSettings().startZIndex + 5).toString(10), this.leftPage.setHardDrawingAngle(180 + this.flippingPage.getHardAngle()), this.leftPage.draw(this.flippingPage.getDrawingDensity())) : this.leftPage.simpleDraw(0));
@@ -2307,7 +2370,7 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2307
2370
  super.update(), this.rightPage !== null && this.rightPage.setOrientation(1), this.leftPage !== null && this.leftPage.setOrientation(0);
2308
2371
  }
2309
2372
  }
2310
- class N {
2373
+ class H {
2311
2374
  constructor() {
2312
2375
  this._default = { startPage: 0, size: "fixed", width: 0, height: 0, minWidth: 0, maxWidth: 0, minHeight: 0, maxHeight: 0, drawShadow: !0, flippingTime: 1e3, usePortrait: !0, startZIndex: 0, autoSize: !0, maxShadowOpacity: 1, showCover: !1, mobileScrollSupport: !0, swipeDistance: 30, clickEventForward: !0, useMouseEvents: !0, showPageCorners: !0, disableFlipByClick: !1 };
2313
2376
  }
@@ -2319,12 +2382,12 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2319
2382
  return n.size === "stretch" ? (n.minWidth <= 0 && (n.minWidth = 100), n.maxWidth < n.minWidth && (n.maxWidth = 2e3), n.minHeight <= 0 && (n.minHeight = 100), n.maxHeight < n.minHeight && (n.maxHeight = 2e3)) : (n.minWidth = n.width, n.maxWidth = n.width, n.minHeight = n.height, n.maxHeight = n.height), n;
2320
2383
  }
2321
2384
  }
2322
- (function(f, i) {
2385
+ (function(m, i) {
2323
2386
  i === void 0 && (i = {});
2324
2387
  var n = i.insertAt;
2325
2388
  if (typeof document < "u") {
2326
2389
  var a = document.head || document.getElementsByTagName("head")[0], l = document.createElement("style");
2327
- l.type = "text/css", n === "top" && a.firstChild ? a.insertBefore(l, a.firstChild) : a.appendChild(l), l.styleSheet ? l.styleSheet.cssText = f : l.appendChild(document.createTextNode(f));
2390
+ l.type = "text/css", n === "top" && a.firstChild ? a.insertBefore(l, a.firstChild) : a.appendChild(l), l.styleSheet ? l.styleSheet.cssText = m : l.appendChild(document.createTextNode(m));
2328
2391
  }
2329
2392
  })(`.stf__parent {
2330
2393
  position: relative;
@@ -2390,18 +2453,18 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2390
2453
  constructor() {
2391
2454
  this.events = /* @__PURE__ */ new Map();
2392
2455
  }
2393
- on(f, i) {
2394
- return this.events.has(f) ? this.events.get(f).push(i) : this.events.set(f, [i]), this;
2456
+ on(m, i) {
2457
+ return this.events.has(m) ? this.events.get(m).push(i) : this.events.set(m, [i]), this;
2395
2458
  }
2396
- off(f) {
2397
- this.events.delete(f);
2459
+ off(m) {
2460
+ this.events.delete(m);
2398
2461
  }
2399
- trigger(f, i, n = null) {
2400
- if (this.events.has(f)) for (const a of this.events.get(f)) a({ data: n, object: i });
2462
+ trigger(m, i, n = null) {
2463
+ if (this.events.has(m)) for (const a of this.events.get(m)) a({ data: n, object: i });
2401
2464
  }
2402
2465
  } {
2403
- constructor(f, i) {
2404
- super(), this.isUserTouch = !1, this.isUserMove = !1, this.setting = null, this.pages = null, this.setting = new N().getSettings(i), this.block = f;
2466
+ constructor(m, i) {
2467
+ super(), this.isUserTouch = !1, this.isUserMove = !1, this.setting = null, this.pages = null, this.setting = new H().getSettings(i), this.block = m;
2405
2468
  }
2406
2469
  destroy() {
2407
2470
  this.ui.destroy(), this.block.remove();
@@ -2409,25 +2472,25 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2409
2472
  update() {
2410
2473
  this.render.update(), this.pages.show();
2411
2474
  }
2412
- loadFromImages(f) {
2475
+ loadFromImages(m) {
2413
2476
  this.ui = new B(this.block, this, this.setting);
2414
2477
  const i = this.ui.getCanvas();
2415
- this.render = new C(this, this.setting, i), this.flipController = new D(this.render, this), this.pages = new u(this, this.render, f), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
2478
+ this.render = new T(this, this.setting, i), this.flipController = new I(this.render, this), this.pages = new u(this, this.render, m), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
2416
2479
  this.ui.update(), this.trigger("init", this, { page: this.setting.startPage, mode: this.render.getOrientation() });
2417
2480
  }, 1);
2418
2481
  }
2419
- loadFromHTML(f) {
2420
- this.ui = new F(this.block, this, this.setting, f), this.render = new H(this, this.setting, this.ui.getDistElement()), this.flipController = new D(this.render, this), this.pages = new P(this, this.render, this.ui.getDistElement(), f), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
2482
+ loadFromHTML(m) {
2483
+ this.ui = new W(this.block, this, this.setting, m), this.render = new N(this, this.setting, this.ui.getDistElement()), this.flipController = new I(this.render, this), this.pages = new x(this, this.render, this.ui.getDistElement(), m), this.pages.load(), this.render.start(), this.pages.show(this.setting.startPage), setTimeout(() => {
2421
2484
  this.ui.update(), this.trigger("init", this, { page: this.setting.startPage, mode: this.render.getOrientation() });
2422
2485
  }, 1);
2423
2486
  }
2424
- updateFromImages(f) {
2487
+ updateFromImages(m) {
2425
2488
  const i = this.pages.getCurrentPageIndex();
2426
- this.pages.destroy(), this.pages = new u(this, this.render, f), this.pages.load(), this.pages.show(i), this.trigger("update", this, { page: i, mode: this.render.getOrientation() });
2489
+ this.pages.destroy(), this.pages = new u(this, this.render, m), this.pages.load(), this.pages.show(i), this.trigger("update", this, { page: i, mode: this.render.getOrientation() });
2427
2490
  }
2428
- updateFromHtml(f) {
2491
+ updateFromHtml(m) {
2429
2492
  const i = this.pages.getCurrentPageIndex();
2430
- this.pages.destroy(), this.pages = new P(this, this.render, this.ui.getDistElement(), f), this.pages.load(), this.ui.updateItems(f), this.render.reload(), this.pages.show(i), this.trigger("update", this, { page: i, mode: this.render.getOrientation() });
2493
+ this.pages.destroy(), this.pages = new x(this, this.render, this.ui.getDistElement(), m), this.pages.load(), this.ui.updateItems(m), this.render.reload(), this.pages.show(i), this.trigger("update", this, { page: i, mode: this.render.getOrientation() });
2431
2494
  }
2432
2495
  clear() {
2433
2496
  this.pages.destroy(), this.ui.clear();
@@ -2438,26 +2501,26 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2438
2501
  turnToNextPage() {
2439
2502
  this.pages.showNext();
2440
2503
  }
2441
- turnToPage(f) {
2442
- this.pages.show(f);
2504
+ turnToPage(m) {
2505
+ this.pages.show(m);
2443
2506
  }
2444
- flipNext(f = "top") {
2445
- this.flipController.flipNext(f);
2507
+ flipNext(m = "top") {
2508
+ this.flipController.flipNext(m);
2446
2509
  }
2447
- flipPrev(f = "top") {
2448
- this.flipController.flipPrev(f);
2510
+ flipPrev(m = "top") {
2511
+ this.flipController.flipPrev(m);
2449
2512
  }
2450
- flip(f, i = "top") {
2451
- this.flipController.flipToPage(f, i);
2513
+ flip(m, i = "top") {
2514
+ this.flipController.flipToPage(m, i);
2452
2515
  }
2453
- updateState(f) {
2454
- this.trigger("changeState", this, f);
2516
+ updateState(m) {
2517
+ this.trigger("changeState", this, m);
2455
2518
  }
2456
- updatePageIndex(f) {
2457
- this.trigger("flip", this, f);
2519
+ updatePageIndex(m) {
2520
+ this.trigger("flip", this, m);
2458
2521
  }
2459
- updateOrientation(f) {
2460
- this.ui.setOrientationStyle(f), this.update(), this.trigger("changeOrientation", this, f);
2522
+ updateOrientation(m) {
2523
+ this.ui.setOrientationStyle(m), this.update(), this.trigger("changeOrientation", this, m);
2461
2524
  }
2462
2525
  getPageCount() {
2463
2526
  return this.pages.getPageCount();
@@ -2465,8 +2528,8 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2465
2528
  getCurrentPageIndex() {
2466
2529
  return this.pages.getCurrentPageIndex();
2467
2530
  }
2468
- getPage(f) {
2469
- return this.pages.getPage(f);
2531
+ getPage(m) {
2532
+ return this.pages.getPage(m);
2470
2533
  }
2471
2534
  getRender() {
2472
2535
  return this.render;
@@ -2492,21 +2555,21 @@ var hi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2492
2555
  getPageCollection() {
2493
2556
  return this.pages;
2494
2557
  }
2495
- startUserTouch(f) {
2496
- this.mousePosition = f, this.isUserTouch = !0, this.isUserMove = !1;
2558
+ startUserTouch(m) {
2559
+ this.mousePosition = m, this.isUserTouch = !0, this.isUserMove = !1;
2497
2560
  }
2498
- userMove(f, i) {
2499
- this.isUserTouch || i || !this.setting.showPageCorners ? this.isUserTouch && g.GetDistanceBetweenTwoPoint(this.mousePosition, f) > 5 && (this.isUserMove = !0, this.flipController.fold(f)) : this.flipController.showCorner(f);
2561
+ userMove(m, i) {
2562
+ this.isUserTouch || i || !this.setting.showPageCorners ? this.isUserTouch && p.GetDistanceBetweenTwoPoint(this.mousePosition, m) > 5 && (this.isUserMove = !0, this.flipController.fold(m)) : this.flipController.showCorner(m);
2500
2563
  }
2501
- userStop(f, i = !1) {
2502
- this.isUserTouch && (this.isUserTouch = !1, i || (this.isUserMove ? this.flipController.stopMove() : this.flipController.flip(f)));
2564
+ userStop(m, i = !1) {
2565
+ this.isUserTouch && (this.isUserTouch = !1, i || (this.isUserMove ? this.flipController.stopMove() : this.flipController.flip(m)));
2503
2566
  }
2504
2567
  }, Object.defineProperty(s, "__esModule", { value: !0 });
2505
2568
  });
2506
2569
  })(Dt, Dt.exports);
2507
- var li = Dt.exports;
2570
+ var gi = Dt.exports;
2508
2571
  /**
2509
- * @license FlipbookEngine v0.5.4
2572
+ * @license FlipbookEngine v0.6.0
2510
2573
  * Copyright (c) 2026 Murat Dogan
2511
2574
  *
2512
2575
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -2519,24 +2582,24 @@ var li = Dt.exports;
2519
2582
  * you must purchase a Commercial License from:
2520
2583
  * https://flipbookengine.com/pricing
2521
2584
  */
2522
- function ci() {
2585
+ function pi() {
2523
2586
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2524
2587
  }
2525
- function di(e, t = ci()) {
2588
+ function fi(e, t = pi()) {
2526
2589
  return t ? 0 : typeof e == "number" && e >= 0 ? e : 1e3;
2527
2590
  }
2528
- class ui {
2591
+ class mi {
2529
2592
  constructor(t, s, o) {
2530
- m(this, "pageFlip", null);
2531
- m(this, "bookContainer");
2532
- m(this, "options");
2533
- m(this, "store");
2534
- m(this, "unsubs", []);
2535
- m(this, "audioEl", null);
2536
- m(this, "audioUnlockHandler", null);
2537
- m(this, "isLibraryFlipping", !1);
2538
- m(this, "autoPlayTimer", null);
2539
- m(this, "layoutUpdateTimer", null);
2593
+ v(this, "pageFlip", null);
2594
+ v(this, "bookContainer");
2595
+ v(this, "options");
2596
+ v(this, "store");
2597
+ v(this, "unsubs", []);
2598
+ v(this, "audioEl", null);
2599
+ v(this, "audioUnlockHandler", null);
2600
+ v(this, "isLibraryFlipping", !1);
2601
+ v(this, "autoPlayTimer", null);
2602
+ v(this, "layoutUpdateTimer", null);
2540
2603
  this.bookContainer = t, this.options = s, this.store = o, s.soundUrl && (this.audioEl = new Audio(s.soundUrl), this.unlockAudio());
2541
2604
  }
2542
2605
  unlockAudio() {
@@ -2554,7 +2617,7 @@ class ui {
2554
2617
  this.audioUnlockHandler = t, document.addEventListener("touchstart", t, { once: !0 }), document.addEventListener("click", t, { once: !0 });
2555
2618
  }
2556
2619
  init(t, s) {
2557
- this.pageFlip = new li.PageFlip(this.bookContainer, {
2620
+ this.pageFlip = new gi.PageFlip(this.bookContainer, {
2558
2621
  width: t,
2559
2622
  height: s,
2560
2623
  size: "stretch",
@@ -2567,7 +2630,7 @@ class ui {
2567
2630
  usePortrait: !0,
2568
2631
  mobileScrollSupport: !1,
2569
2632
  maxShadowOpacity: this.options.maxShadowOpacity || 0.5,
2570
- flippingTime: di(this.options.flippingTime)
2633
+ flippingTime: fi(this.options.flippingTime)
2571
2634
  });
2572
2635
  const o = this.bookContainer.querySelectorAll(".bz-page");
2573
2636
  this.pageFlip.loadFromHTML(Array.from(o)), this.bindEvents(), this.setupSignalSync();
@@ -2588,7 +2651,7 @@ class ui {
2588
2651
  if (!this.pageFlip || this.isLibraryFlipping || s !== "read") return;
2589
2652
  const o = this.pageFlip.getCurrentPageIndex();
2590
2653
  if (o !== t && !this.store.isSingleMode.value) {
2591
- const r = (g) => g === 0 ? 0 : Math.ceil(g / 2), h = r(t), u = r(o);
2654
+ const r = (p) => p === 0 ? 0 : Math.ceil(p / 2), h = r(t), u = r(o);
2592
2655
  h === u + 1 ? this.pageFlip.flipNext() : h === u - 1 ? this.pageFlip.flipPrev() : h !== u && this.pageFlip.turnToPage(t);
2593
2656
  }
2594
2657
  })
@@ -2639,7 +2702,7 @@ class ui {
2639
2702
  }
2640
2703
  }
2641
2704
  /**
2642
- * @license FlipbookEngine v0.5.4
2705
+ * @license FlipbookEngine v0.6.0
2643
2706
  * Copyright (c) 2026 Murat Dogan
2644
2707
  *
2645
2708
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -2652,18 +2715,18 @@ class ui {
2652
2715
  * you must purchase a Commercial License from:
2653
2716
  * https://flipbookengine.com/pricing
2654
2717
  */
2655
- class gi {
2718
+ class wi {
2656
2719
  constructor(t, s) {
2657
- m(this, "wrapperElement", null);
2658
- m(this, "sizerElement", null);
2659
- m(this, "pageViewport");
2660
- m(this, "store");
2661
- m(this, "resizeObserver", null);
2662
- m(this, "orientationMediaQuery", null);
2663
- m(this, "orientationChangeHandler", null);
2664
- m(this, "unsubs", []);
2665
- m(this, "updateTimer", null);
2666
- m(this, "onResizeCallback");
2720
+ v(this, "wrapperElement", null);
2721
+ v(this, "sizerElement", null);
2722
+ v(this, "pageViewport");
2723
+ v(this, "store");
2724
+ v(this, "resizeObserver", null);
2725
+ v(this, "orientationMediaQuery", null);
2726
+ v(this, "orientationChangeHandler", null);
2727
+ v(this, "unsubs", []);
2728
+ v(this, "updateTimer", null);
2729
+ v(this, "onResizeCallback");
2667
2730
  this.pageViewport = t, this.store = s;
2668
2731
  }
2669
2732
  init(t, s) {
@@ -2695,10 +2758,10 @@ class gi {
2695
2758
  const t = this.wrapperElement.clientWidth, s = this.wrapperElement.clientHeight;
2696
2759
  if (t === 0 || s === 0) return;
2697
2760
  const o = this.pageViewport.width, r = this.pageViewport.height, u = this.store.isDoublePageLayout.value ? o * 2 / r : o / r;
2698
- let g = t, x = t / u;
2699
- x > s && (x = s, g = s * u);
2700
- let P = Math.ceil(g);
2701
- P % 2 !== 0 && (P += 1), this.sizerElement.style.width = `${P}px`, this.sizerElement.style.height = `${Math.floor(x)}px`, this.sizerElement.style.aspectRatio = "", this.onResizeCallback && this.onResizeCallback();
2761
+ let p = t, b = t / u;
2762
+ b > s && (b = s, p = s * u);
2763
+ let x = Math.ceil(p);
2764
+ x % 2 !== 0 && (x += 1), this.sizerElement.style.width = `${x}px`, this.sizerElement.style.height = `${Math.floor(b)}px`, this.sizerElement.style.aspectRatio = "", this.onResizeCallback && this.onResizeCallback();
2702
2765
  }
2703
2766
  destroy() {
2704
2767
  this.updateTimer && (clearTimeout(this.updateTimer), this.updateTimer = null), this.unsubs.forEach((t) => t()), this.unsubs = [], this.resizeObserver && this.wrapperElement && (this.resizeObserver.unobserve(this.wrapperElement), this.resizeObserver.disconnect(), this.resizeObserver = null), this.orientationMediaQuery && (this.orientationChangeHandler && (this.orientationMediaQuery.removeEventListener ? this.orientationMediaQuery.removeEventListener("change", this.orientationChangeHandler) : this.orientationMediaQuery.removeListener(this.orientationChangeHandler)), this.orientationChangeHandler = null, this.orientationMediaQuery = null);
@@ -2710,7 +2773,7 @@ class gi {
2710
2773
  }
2711
2774
  }
2712
2775
  /**
2713
- * @license FlipbookEngine v0.5.4
2776
+ * @license FlipbookEngine v0.6.0
2714
2777
  * Copyright (c) 2026 Murat Dogan
2715
2778
  *
2716
2779
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -2723,14 +2786,14 @@ class gi {
2723
2786
  * you must purchase a Commercial License from:
2724
2787
  * https://flipbookengine.com/pricing
2725
2788
  */
2726
- class pi {
2789
+ class vi {
2727
2790
  constructor(t, s, o) {
2728
- m(this, "container");
2729
- m(this, "pageFlipAdapter");
2730
- m(this, "store");
2731
- m(this, "touchStartX", null);
2732
- m(this, "unsubs", []);
2733
- m(this, "listenerAbortController");
2791
+ v(this, "container");
2792
+ v(this, "pageFlipAdapter");
2793
+ v(this, "store");
2794
+ v(this, "touchStartX", null);
2795
+ v(this, "unsubs", []);
2796
+ v(this, "listenerAbortController");
2734
2797
  var h;
2735
2798
  this.container = t, this.pageFlipAdapter = s, this.store = o;
2736
2799
  const r = ((h = t.ownerDocument.defaultView) == null ? void 0 : h.AbortController) ?? globalThis.AbortController;
@@ -2760,8 +2823,8 @@ class pi {
2760
2823
  this.store.zoomState.value.isActive && (t = !0, s = u.clientX, o = u.clientY, r = this.store.zoomState.value.translateX, h = this.store.zoomState.value.translateY, this.container.style.cursor = "grabbing");
2761
2824
  }, { signal: this.listenerAbortController.signal }), window.addEventListener("mousemove", (u) => {
2762
2825
  if (!t || !this.store.zoomState.value.isActive) return;
2763
- const g = u.clientX - s, x = u.clientY - o;
2764
- this.updateZoomPan(r + g, h + x);
2826
+ const p = u.clientX - s, b = u.clientY - o;
2827
+ this.updateZoomPan(r + p, h + b);
2765
2828
  }, { signal: this.listenerAbortController.signal }), window.addEventListener("mouseup", () => {
2766
2829
  t && (t = !1, this.container.style.cursor = this.store.zoomState.value.isActive ? "grab" : "");
2767
2830
  }, { signal: this.listenerAbortController.signal });
@@ -2814,86 +2877,101 @@ class pi {
2814
2877
  this.listenerAbortController.abort(), this.unsubs.forEach((t) => t()), this.unsubs = [];
2815
2878
  }
2816
2879
  }
2880
+ function ve(e, t, s) {
2881
+ if (!e || typeof e.title != "string" || !e.title.trim() || !Number.isFinite(e.pageIndex)) return null;
2882
+ const o = Math.max(0, t - 1), r = Array.isArray(e.children) ? e.children.map((h, u) => ve(h, t, s + "-" + u)).filter((h) => h !== null) : [];
2883
+ return {
2884
+ id: e.id ?? s,
2885
+ title: e.title.trim(),
2886
+ pageIndex: Math.max(0, Math.min(o, Math.trunc(e.pageIndex))),
2887
+ ...r.length ? { children: r } : {}
2888
+ };
2889
+ }
2890
+ function ye(e, t) {
2891
+ return Array.isArray(e) ? e.map((s, o) => ve(s, t, "toc-" + o)).filter((s) => s !== null) : [];
2892
+ }
2817
2893
  /**
2818
- * @license FlipbookEngine v0.5.4
2894
+ * @license FlipbookEngine v0.6.0
2819
2895
  * Copyright (c) 2026 Murat Dogan
2820
2896
  *
2821
2897
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
2822
2898
  */
2823
2899
  const Kt = () => ({ isActive: !1, translateX: 0, translateY: 0, isDragging: !1, scale: 1 });
2824
- function me() {
2825
- const e = M(0), t = M(0), s = M(!1), o = M(!0), r = M(!0), h = M("landscape"), u = M("read"), g = M("auto"), x = M(!0), P = M(!1), b = M("#7367f0"), D = M(!1), $ = M(!1), C = M(!1), T = M(3e3), F = M(!0), B = M("en"), H = M({}), N = M(Kt()), f = M([]), i = w(() => !s.value && h.value === "landscape"), n = w(() => i.value && e.value === 0), a = w(() => i.value && e.value >= t.value - 1);
2826
- return { currentPage: e, totalPages: t, isSingleMode: s, showThumbs: o, showArrows: r, orientation: h, flipState: u, themeMode: g, allowDownload: x, hasDownloadUrl: P, primaryColor: b, whiteLabel: D, isZoomed: $, isAutoPlaying: C, autoPlayInterval: T, soundEnabled: F, locale: B, messages: H, zoomState: N, pages: f, isDoublePageLayout: i, isFrontCover: n, isBackCover: a, init: (c, v, y, A) => {
2827
- t.value = v, f.value = y, P.value = A, c.theme !== void 0 && (g.value = c.theme), c.primaryColor !== void 0 && (b.value = c.primaryColor), c.showThumbs !== void 0 && (o.value = c.showThumbs), c.showArrows !== void 0 && (r.value = c.showArrows), c.allowDownload !== void 0 && (x.value = c.allowDownload), c.whiteLabel !== void 0 && (D.value = c.whiteLabel), c.soundEnabled !== void 0 && (F.value = c.soundEnabled), c.locale !== void 0 && (B.value = c.locale), c.messages !== void 0 && (H.value = c.messages), c.isSingleMode !== void 0 && (s.value = c.isSingleMode), c.singleMode !== void 0 && (s.value = c.singleMode), c.autoPlay !== void 0 && (C.value = c.autoPlay), c.autoPlayInterval !== void 0 && (T.value = c.autoPlayInterval), e.value = 0;
2900
+ function be() {
2901
+ const e = D(0), t = D(0), s = D(!1), o = D(!0), r = D(!1), h = D(!0), u = D("landscape"), p = D("read"), b = D("auto"), x = D(!0), M = D(!1), I = D("#7367f0"), S = D(!1), T = D(!1), E = D(!1), W = D(3e3), B = D(!0), N = D("en"), H = D({}), m = D(Kt()), i = D([]), n = D([]), a = w(() => !s.value && u.value === "landscape"), l = w(() => a.value && e.value === 0), c = w(() => a.value && e.value >= t.value - 1);
2902
+ return { currentPage: e, totalPages: t, isSingleMode: s, showThumbs: o, showToc: r, showArrows: h, orientation: u, flipState: p, themeMode: b, allowDownload: x, hasDownloadUrl: M, primaryColor: I, whiteLabel: S, isZoomed: T, isAutoPlaying: E, autoPlayInterval: W, soundEnabled: B, locale: N, messages: H, zoomState: m, pages: i, toc: n, isDoublePageLayout: a, isFrontCover: l, isBackCover: c, init: (f, C, R, F) => {
2903
+ t.value = C, i.value = R, M.value = F, f.theme !== void 0 && (b.value = f.theme), f.primaryColor !== void 0 && (I.value = f.primaryColor), f.showThumbs !== void 0 && (o.value = f.showThumbs), f.showToc !== void 0 && (r.value = f.showToc), n.value = ye(f.toc ?? [], C), f.showArrows !== void 0 && (h.value = f.showArrows), f.allowDownload !== void 0 && (x.value = f.allowDownload), f.whiteLabel !== void 0 && (S.value = f.whiteLabel), f.soundEnabled !== void 0 && (B.value = f.soundEnabled), f.locale !== void 0 && (N.value = f.locale), f.messages !== void 0 && (H.value = f.messages), f.isSingleMode !== void 0 && (s.value = f.isSingleMode), f.singleMode !== void 0 && (s.value = f.singleMode), f.autoPlay !== void 0 && (E.value = f.autoPlay), f.autoPlayInterval !== void 0 && (W.value = f.autoPlayInterval), e.value = 0;
2828
2904
  }, reset: () => {
2829
- e.value = 0, t.value = 0, s.value = !1, o.value = !0, r.value = !0, h.value = "landscape", u.value = "read", g.value = "auto", x.value = !0, P.value = !1, b.value = "#7367f0", D.value = !1, $.value = !1, C.value = !1, T.value = 3e3, F.value = !0, B.value = "en", H.value = {}, N.value = Kt(), f.value = [];
2905
+ e.value = 0, t.value = 0, s.value = !1, o.value = !0, h.value = !0, u.value = "landscape", p.value = "read", b.value = "auto", x.value = !0, M.value = !1, I.value = "#7367f0", S.value = !1, T.value = !1, E.value = !1, W.value = 3e3, B.value = !0, N.value = "en", H.value = {}, m.value = Kt(), i.value = [], n.value = [];
2830
2906
  } };
2831
2907
  }
2832
- const E = me();
2833
- E.currentPage;
2834
- E.totalPages;
2835
- E.isSingleMode;
2836
- E.showThumbs;
2837
- E.showArrows;
2838
- E.orientation;
2839
- E.flipState;
2840
- E.themeMode;
2841
- E.allowDownload;
2842
- E.hasDownloadUrl;
2843
- E.primaryColor;
2844
- E.whiteLabel;
2845
- E.isZoomed;
2846
- E.isAutoPlaying;
2847
- E.autoPlayInterval;
2848
- E.soundEnabled;
2849
- E.locale;
2850
- E.messages;
2851
- E.zoomState;
2852
- E.pages;
2853
- E.isDoublePageLayout;
2854
- E.isFrontCover;
2855
- E.isBackCover;
2856
- function fi(e) {
2908
+ const k = be();
2909
+ k.currentPage;
2910
+ k.totalPages;
2911
+ k.isSingleMode;
2912
+ k.showThumbs;
2913
+ k.showToc;
2914
+ k.showArrows;
2915
+ k.orientation;
2916
+ k.flipState;
2917
+ k.themeMode;
2918
+ k.allowDownload;
2919
+ k.hasDownloadUrl;
2920
+ k.primaryColor;
2921
+ k.whiteLabel;
2922
+ k.isZoomed;
2923
+ k.isAutoPlaying;
2924
+ k.autoPlayInterval;
2925
+ k.soundEnabled;
2926
+ k.locale;
2927
+ k.messages;
2928
+ k.zoomState;
2929
+ k.pages;
2930
+ k.toc;
2931
+ k.isDoublePageLayout;
2932
+ k.isFrontCover;
2933
+ k.isBackCover;
2934
+ function yi(e) {
2857
2935
  if (!e || typeof e != "object") return !1;
2858
2936
  const t = e;
2859
2937
  return typeof t.normal == "string" && typeof t.low == "string" && typeof t.thumb == "string";
2860
2938
  }
2861
- function mi(e) {
2939
+ function bi(e) {
2862
2940
  return Array.isArray(e.pageNumbers) && e.pageNumbers.length > 0 ? e.pageNumbers : typeof e.pageNumber == "number" ? e.kind === "spread" ? [e.pageNumber, e.pageNumber + 1] : [e.pageNumber] : [];
2863
2941
  }
2864
- function wi(e) {
2942
+ function xi(e) {
2865
2943
  return e === "rtl" ? ["right", "left"] : ["left", "right"];
2866
2944
  }
2867
- function vi(e) {
2945
+ function Pi(e) {
2868
2946
  const t = [];
2869
2947
  let s = 1;
2870
2948
  return e.forEach((o, r) => {
2871
- const h = o.kind ?? "single", u = o.id ?? `asset-${r}`, g = o.splitDirection ?? "ltr", x = mi(o);
2949
+ const h = o.kind ?? "single", u = o.id ?? `asset-${r}`, p = o.splitDirection ?? "ltr", b = bi(o);
2872
2950
  if (h === "spread") {
2873
- const b = x.length >= 2 ? x.slice(0, 2) : [s, s + 1], D = wi(g);
2874
- b.forEach(($, C) => {
2951
+ const M = b.length >= 2 ? b.slice(0, 2) : [s, s + 1], I = xi(p);
2952
+ M.forEach((S, T) => {
2875
2953
  t.push({
2876
2954
  index: t.length,
2877
2955
  assetId: u,
2878
- pageNumber: $,
2879
- cropMode: D[C] ?? "full",
2956
+ pageNumber: S,
2957
+ cropMode: I[T] ?? "full",
2880
2958
  normal: o.normal,
2881
2959
  low: o.low,
2882
2960
  thumb: o.thumb
2883
2961
  });
2884
- }), s = b[b.length - 1] + 1;
2962
+ }), s = M[M.length - 1] + 1;
2885
2963
  return;
2886
2964
  }
2887
- const P = x[0] ?? s;
2965
+ const x = b[0] ?? s;
2888
2966
  t.push({
2889
2967
  index: t.length,
2890
2968
  assetId: u,
2891
- pageNumber: P,
2969
+ pageNumber: x,
2892
2970
  cropMode: "full",
2893
2971
  normal: o.normal,
2894
2972
  low: o.low,
2895
2973
  thumb: o.thumb
2896
- }), s = P + 1;
2974
+ }), s = x + 1;
2897
2975
  }), t;
2898
2976
  }
2899
2977
  function Jt(e, t) {
@@ -2904,11 +2982,11 @@ function Jt(e, t) {
2904
2982
  e.style.setProperty(h, r);
2905
2983
  });
2906
2984
  }
2907
- class yi {
2985
+ class Si {
2908
2986
  constructor(t = 32) {
2909
- m(this, "entries", /* @__PURE__ */ new Map());
2910
- m(this, "hits", 0);
2911
- m(this, "misses", 0);
2987
+ v(this, "entries", /* @__PURE__ */ new Map());
2988
+ v(this, "hits", 0);
2989
+ v(this, "misses", 0);
2912
2990
  if (this.maxEntries = t, !Number.isInteger(t) || t < 0)
2913
2991
  throw new RangeError("PDF render cache size must be a non-negative integer.");
2914
2992
  }
@@ -2938,12 +3016,12 @@ class yi {
2938
3016
  return { size: this.size, maxEntries: this.maxEntries, hits: this.hits, misses: this.misses };
2939
3017
  }
2940
3018
  }
2941
- class bi {
3019
+ class Ti {
2942
3020
  constructor(t = {}) {
2943
- m(this, "pdfDoc", null);
2944
- m(this, "loadingTask", null);
2945
- m(this, "options");
2946
- m(this, "cache");
3021
+ v(this, "pdfDoc", null);
3022
+ v(this, "loadingTask", null);
3023
+ v(this, "options");
3024
+ v(this, "cache");
2947
3025
  const s = Number.isFinite(t.cacheSize) ? Math.max(0, Math.floor(t.cacheSize)) : 32;
2948
3026
  this.options = {
2949
3027
  scale: t.scale || 1.5,
@@ -2952,7 +3030,7 @@ class bi {
2952
3030
  workerSrc: t.workerSrc || "",
2953
3031
  concurrency: Math.max(1, Math.floor(t.concurrency || 3)),
2954
3032
  cacheSize: s
2955
- }, this.cache = new yi(this.options.cacheSize), this.options.workerSrc && (Bt.GlobalWorkerOptions.workerSrc = this.options.workerSrc);
3033
+ }, this.cache = new Si(this.options.cacheSize), this.options.workerSrc && (Bt.GlobalWorkerOptions.workerSrc = this.options.workerSrc);
2956
3034
  }
2957
3035
  /** Loads a PDF document and cancels PDF.js loading when the signal aborts. */
2958
3036
  async loadDocument(t, s) {
@@ -2983,20 +3061,20 @@ class bi {
2983
3061
  this.throwIfAborted(s);
2984
3062
  const h = r.getViewport({ scale: this.options.scale }), u = document.createElement("canvas");
2985
3063
  u.width = h.width, u.height = h.height;
2986
- const g = u.getContext("2d");
2987
- if (g) {
2988
- const x = r.render({ canvasContext: g, viewport: h }), P = () => {
2989
- var D;
2990
- return (D = x.cancel) == null ? void 0 : D.call(x);
3064
+ const p = u.getContext("2d");
3065
+ if (p) {
3066
+ const b = r.render({ canvasContext: p, viewport: h }), x = () => {
3067
+ var I;
3068
+ return (I = b.cancel) == null ? void 0 : I.call(b);
2991
3069
  };
2992
- s == null || s.addEventListener("abort", P, { once: !0 });
3070
+ s == null || s.addEventListener("abort", x, { once: !0 });
2993
3071
  try {
2994
- await x.promise, this.throwIfAborted(s);
3072
+ await b.promise, this.throwIfAborted(s);
2995
3073
  } finally {
2996
- s == null || s.removeEventListener("abort", P);
3074
+ s == null || s.removeEventListener("abort", x);
2997
3075
  }
2998
- const b = u.toDataURL(this.options.format, this.options.quality);
2999
- return this.cache.set(t, b), b;
3076
+ const M = u.toDataURL(this.options.format, this.options.quality);
3077
+ return this.cache.set(t, M), M;
3000
3078
  }
3001
3079
  throw new Error("Unable to create a PDF canvas rendering context.");
3002
3080
  } catch (r) {
@@ -3015,24 +3093,24 @@ class bi {
3015
3093
  this.throwIfAborted(t);
3016
3094
  const o = this.pdfDoc.numPages, r = new Array(o);
3017
3095
  let h = 1, u = 0;
3018
- const g = async () => {
3096
+ const p = async () => {
3019
3097
  for (; ; ) {
3020
3098
  this.throwIfAborted(t);
3021
- const P = h++;
3022
- if (P > o) return;
3023
- const b = await this.renderPageToDataUrl(P, t);
3024
- r[P - 1] = {
3025
- index: P - 1,
3026
- assetId: `pdf-page-${P}`,
3027
- pageNumber: P,
3099
+ const x = h++;
3100
+ if (x > o) return;
3101
+ const M = await this.renderPageToDataUrl(x, t);
3102
+ r[x - 1] = {
3103
+ index: x - 1,
3104
+ assetId: `pdf-page-${x}`,
3105
+ pageNumber: x,
3028
3106
  cropMode: "full",
3029
- normal: b,
3030
- low: b,
3031
- thumb: b
3107
+ normal: M,
3108
+ low: M,
3109
+ thumb: M
3032
3110
  }, u++, s == null || s({ completed: u, total: o });
3033
3111
  }
3034
- }, x = Math.min(this.options.concurrency, o);
3035
- return await Promise.all(Array.from({ length: x }, () => g())), this.throwIfAborted(t), r;
3112
+ }, b = Math.min(this.options.concurrency, o);
3113
+ return await Promise.all(Array.from({ length: b }, () => p())), this.throwIfAborted(t), r;
3036
3114
  }
3037
3115
  getCacheStats() {
3038
3116
  return this.cache.getStats();
@@ -3050,7 +3128,7 @@ class bi {
3050
3128
  }
3051
3129
  }
3052
3130
  /**
3053
- * @license FlipbookEngine v0.5.4
3131
+ * @license FlipbookEngine v0.6.0
3054
3132
  * Copyright (c) 2026 Murat Dogan
3055
3133
  *
3056
3134
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -3065,26 +3143,26 @@ class bi {
3065
3143
  */
3066
3144
  const mt = class mt {
3067
3145
  constructor(t, s = {}) {
3068
- m(this, "container", null);
3069
- m(this, "options");
3070
- m(this, "store", me());
3146
+ v(this, "container", null);
3147
+ v(this, "options");
3148
+ v(this, "store", be());
3071
3149
  // Core Managers
3072
- m(this, "pageFlipAdapter", null);
3073
- m(this, "layoutManager", null);
3074
- m(this, "interactionManager", null);
3075
- m(this, "pdfRenderer", null);
3076
- m(this, "listeners", {});
3077
- m(this, "initializationTimer", null);
3078
- m(this, "initGeneration", 0);
3079
- m(this, "initAbortController", null);
3080
- m(this, "eventsReady", !1);
3081
- m(this, "lastEventState", { currentPage: 0, zoom: 1, zoomActive: !1, showThumbs: !0, isSingle: !1, orientation: "" });
3082
- m(this, "eventSyncStop", null);
3083
- m(this, "qualityObserver", null);
3084
- m(this, "pdfLazyStop", null);
3085
- m(this, "hasActiveSession", !1);
3086
- m(this, "pdfPageRequests", /* @__PURE__ */ new Map());
3087
- m(this, "pdfRenderedPages", /* @__PURE__ */ new Set());
3150
+ v(this, "pageFlipAdapter", null);
3151
+ v(this, "layoutManager", null);
3152
+ v(this, "interactionManager", null);
3153
+ v(this, "pdfRenderer", null);
3154
+ v(this, "listeners", {});
3155
+ v(this, "initializationTimer", null);
3156
+ v(this, "initGeneration", 0);
3157
+ v(this, "initAbortController", null);
3158
+ v(this, "eventsReady", !1);
3159
+ v(this, "lastEventState", { currentPage: 0, zoom: 1, zoomActive: !1, showThumbs: !0, showToc: !1, isSingle: !1, orientation: "" });
3160
+ v(this, "eventSyncStop", null);
3161
+ v(this, "qualityObserver", null);
3162
+ v(this, "pdfLazyStop", null);
3163
+ v(this, "hasActiveSession", !1);
3164
+ v(this, "pdfPageRequests", /* @__PURE__ */ new Map());
3165
+ v(this, "pdfRenderedPages", /* @__PURE__ */ new Set());
3088
3166
  this.selector = t, this.options = {
3089
3167
  allowDownload: !0,
3090
3168
  showThumbs: !0,
@@ -3108,21 +3186,21 @@ const mt = class mt {
3108
3186
  let h = [], u = { ...mt.DEFAULT_PAGE_VIEWPORT };
3109
3187
  if (s && s.length > 0) {
3110
3188
  if (r.signal.aborted) return;
3111
- const C = s.filter(fi);
3112
- h = vi(C);
3113
- const T = h[0];
3114
- if (T) {
3115
- const F = await this.loadImageSize(T.low || T.normal);
3116
- if (F) {
3117
- const H = (T.cropMode !== "full" ? F.width / 2 : F.width) / F.height, N = 420;
3118
- u = H >= 1 ? { width: Math.round(N * H), height: N } : { width: N, height: Math.round(N / H) };
3189
+ const T = s.filter(yi);
3190
+ h = Pi(T);
3191
+ const E = h[0];
3192
+ if (E) {
3193
+ const W = await this.loadImageSize(E.low || E.normal);
3194
+ if (W) {
3195
+ const N = (E.cropMode !== "full" ? W.width / 2 : W.width) / W.height, H = 420;
3196
+ u = N >= 1 ? { width: Math.round(H * N), height: H } : { width: H, height: Math.round(H / N) };
3119
3197
  }
3120
3198
  }
3121
3199
  } else if (t) {
3122
3200
  if (r.signal.aborted) return;
3123
- let C = "load";
3201
+ let T = "load";
3124
3202
  try {
3125
- this.pdfRenderer = new bi({
3203
+ this.pdfRenderer = new Ti({
3126
3204
  scale: this.options.pdfRenderScale,
3127
3205
  quality: this.options.pdfRenderQuality,
3128
3206
  format: this.options.pdfRenderFormat,
@@ -3130,26 +3208,26 @@ const mt = class mt {
3130
3208
  cacheSize: this.options.pdfRenderCacheSize,
3131
3209
  workerSrc: this.options.pdfWorkerSrc
3132
3210
  }), this.emit("progress", { phase: "loading", completed: 0, total: 0 });
3133
- const T = await this.pdfRenderer.loadDocument(t, r.signal);
3134
- C = "render", this.emit("progress", { phase: "loading", completed: 1, total: T }), u = await this.pdfRenderer.calculateViewportDimensions(), h = Array.from({ length: T }, (F, B) => this.createPdfPlaceholder(B + 1));
3135
- } catch (T) {
3136
- r.signal.aborted || (console.error("PDF load failed:", T), this.emit("error", {
3137
- code: C === "load" ? "PDF_LOAD_FAILED" : "PDF_RENDER_FAILED",
3138
- message: T instanceof Error ? T.message : "Unable to load PDF.",
3139
- cause: T
3211
+ const E = await this.pdfRenderer.loadDocument(t, r.signal);
3212
+ T = "render", this.emit("progress", { phase: "loading", completed: 1, total: E }), u = await this.pdfRenderer.calculateViewportDimensions(), h = Array.from({ length: E }, (W, B) => this.createPdfPlaceholder(B + 1));
3213
+ } catch (E) {
3214
+ r.signal.aborted || (console.error("PDF load failed:", E), this.emit("error", {
3215
+ code: T === "load" ? "PDF_LOAD_FAILED" : "PDF_RENDER_FAILED",
3216
+ message: E instanceof Error ? E.message : "Unable to load PDF.",
3217
+ cause: E
3140
3218
  }));
3141
3219
  return;
3142
3220
  }
3143
3221
  }
3144
3222
  if (r.signal.aborted || o !== this.initGeneration || !h.length) return;
3145
3223
  this.store.init(this.options, h.length, h, !!t), Jt(this.container, this.options), this.container.innerHTML = "";
3146
- let g, x, P;
3147
- const b = { current: null }, D = { current: null }, $ = ai({
3148
- pageFlipAdapterRef: b,
3149
- interactionManagerRef: D,
3150
- bookWrapperRef: (C) => g = C,
3151
- bookSizerRef: (C) => x = C,
3152
- bookContainerRef: (C) => P = C,
3224
+ let p, b, x;
3225
+ const M = { current: null }, I = { current: null }, S = di({
3226
+ pageFlipAdapterRef: M,
3227
+ interactionManagerRef: I,
3228
+ bookWrapperRef: (T) => p = T,
3229
+ bookSizerRef: (T) => b = T,
3230
+ bookContainerRef: (T) => x = T,
3153
3231
  className: this.options.className,
3154
3232
  store: this.store,
3155
3233
  onToggleFullscreen: () => this.toggleFullscreen(),
@@ -3157,29 +3235,29 @@ const mt = class mt {
3157
3235
  t && (this.options.onDownload ? this.options.onDownload(t) : window.open(t, "_blank"));
3158
3236
  }
3159
3237
  });
3160
- this.container.appendChild($), this.setupQualityLoading(), this.layoutManager = new gi(u, this.store), this.layoutManager.onResizeCallback = () => {
3238
+ this.container.appendChild(S), this.setupQualityLoading(), this.layoutManager = new wi(u, this.store), this.layoutManager.onResizeCallback = () => {
3161
3239
  this.pageFlipAdapter && this.pageFlipAdapter.update();
3162
- }, this.layoutManager.init(g, x), this.pageFlipAdapter = new ui(P, this.options, this.store), b.current = this.pageFlipAdapter, await new Promise((C) => {
3163
- const T = () => {
3164
- r.signal.removeEventListener("abort", T), C();
3240
+ }, this.layoutManager.init(p, b), this.pageFlipAdapter = new mi(x, this.options, this.store), M.current = this.pageFlipAdapter, await new Promise((T) => {
3241
+ const E = () => {
3242
+ r.signal.removeEventListener("abort", E), T();
3165
3243
  };
3166
- r.signal.addEventListener("abort", T, { once: !0 }), this.initializationTimer = setTimeout(async () => {
3167
- if (this.initializationTimer = null, r.signal.removeEventListener("abort", T), r.signal.aborted || o !== this.initGeneration || !this.pageFlipAdapter) {
3168
- C();
3244
+ r.signal.addEventListener("abort", E, { once: !0 }), this.initializationTimer = setTimeout(async () => {
3245
+ if (this.initializationTimer = null, r.signal.removeEventListener("abort", E), r.signal.aborted || o !== this.initGeneration || !this.pageFlipAdapter) {
3246
+ T();
3169
3247
  return;
3170
3248
  }
3171
- if (this.pageFlipAdapter.init(u.width, u.height), this.interactionManager = new pi(g, this.pageFlipAdapter, this.store), this.interactionManager.init(), D.current = this.interactionManager, this.setupPdfLazyLoading(), this.pdfRenderer && t)
3249
+ if (this.pageFlipAdapter.init(u.width, u.height), this.interactionManager = new vi(p, this.pageFlipAdapter, this.store), this.interactionManager.init(), I.current = this.interactionManager, this.setupPdfLazyLoading(), this.pdfRenderer && t)
3172
3250
  try {
3173
3251
  await this.renderPdfPage(1, r.signal);
3174
3252
  } catch {
3175
- C();
3253
+ T();
3176
3254
  return;
3177
3255
  }
3178
3256
  if (r.signal.aborted || o !== this.initGeneration) {
3179
- C();
3257
+ T();
3180
3258
  return;
3181
3259
  }
3182
- this.eventsReady = !0, this.captureEventState(), this.hasActiveSession = !0, this.emit("init", { totalPages: h.length }), C();
3260
+ this.eventsReady = !0, this.captureEventState(), this.hasActiveSession = !0, this.emit("init", { totalPages: h.length }), T();
3183
3261
  }, 10);
3184
3262
  }), this.initAbortController === r && (this.initAbortController = null);
3185
3263
  }
@@ -3201,23 +3279,23 @@ const mt = class mt {
3201
3279
  const h = this.pdfPageRequests.get(t);
3202
3280
  if (h) return h;
3203
3281
  if (this.pdfRenderedPages.has(t)) return Promise.resolve("");
3204
- const u = o.renderPageToDataUrl(t, s).then((g) => {
3205
- var x;
3282
+ const u = o.renderPageToDataUrl(t, s).then((p) => {
3283
+ var b;
3206
3284
  if (r !== this.initGeneration || s != null && s.aborted) throw this.createAbortError();
3207
- if (!g) throw new Error("PDF page " + t + " produced no image.");
3208
- return this.pdfRenderedPages.add(t), (x = this.container) == null || x.querySelectorAll('img[data-pdf-page="' + t + '"]').forEach((P) => {
3209
- P.src = g, delete P.dataset.pdfPage;
3285
+ if (!p) throw new Error("PDF page " + t + " produced no image.");
3286
+ return this.pdfRenderedPages.add(t), (b = this.container) == null || b.querySelectorAll('img[data-pdf-page="' + t + '"]').forEach((x) => {
3287
+ x.src = p, delete x.dataset.pdfPage;
3210
3288
  }), this.emit("progress", {
3211
3289
  phase: "rendering",
3212
3290
  completed: this.pdfRenderedPages.size,
3213
3291
  total: this.store.totalPages.value
3214
- }), g;
3215
- }).catch((g) => {
3216
- throw r !== this.initGeneration && (g == null ? void 0 : g.name) !== "AbortError" ? this.createAbortError() : ((g == null ? void 0 : g.name) === "AbortError" || this.emit("error", {
3292
+ }), p;
3293
+ }).catch((p) => {
3294
+ throw r !== this.initGeneration && (p == null ? void 0 : p.name) !== "AbortError" ? this.createAbortError() : ((p == null ? void 0 : p.name) === "AbortError" || this.emit("error", {
3217
3295
  code: "PDF_RENDER_FAILED",
3218
- message: g instanceof Error ? g.message : "Unable to render PDF page.",
3219
- cause: g
3220
- }), g);
3296
+ message: p instanceof Error ? p.message : "Unable to render PDF page.",
3297
+ cause: p
3298
+ }), p);
3221
3299
  }).finally(() => {
3222
3300
  this.pdfPageRequests.get(t) === u && this.pdfPageRequests.delete(t);
3223
3301
  });
@@ -3280,7 +3358,7 @@ const mt = class mt {
3280
3358
  this.store.isSingleMode.value = t;
3281
3359
  }
3282
3360
  updateOptions(t) {
3283
- this.options = { ...this.options, ...t }, t.theme !== void 0 && (this.store.themeMode.value = t.theme), t.primaryColor !== void 0 && (this.store.primaryColor.value = t.primaryColor), t.showThumbs !== void 0 && (this.store.showThumbs.value = t.showThumbs), t.showArrows !== void 0 && (this.store.showArrows.value = t.showArrows), t.allowDownload !== void 0 && (this.store.allowDownload.value = t.allowDownload), t.whiteLabel !== void 0 && (this.store.whiteLabel.value = t.whiteLabel), t.soundEnabled !== void 0 && (this.store.soundEnabled.value = t.soundEnabled), t.locale !== void 0 && (this.store.locale.value = t.locale), t.messages !== void 0 && (this.store.messages.value = t.messages), t.singleMode !== void 0 && (this.store.isSingleMode.value = t.singleMode), t.isSingleMode !== void 0 && (this.store.isSingleMode.value = t.isSingleMode), t.autoPlay !== void 0 && (this.store.isAutoPlaying.value = t.autoPlay), t.autoPlayInterval !== void 0 && (this.store.autoPlayInterval.value = t.autoPlayInterval), this.container && Jt(this.container, this.options);
3361
+ this.options = { ...this.options, ...t }, t.theme !== void 0 && (this.store.themeMode.value = t.theme), t.primaryColor !== void 0 && (this.store.primaryColor.value = t.primaryColor), t.showThumbs !== void 0 && (this.store.showThumbs.value = t.showThumbs), t.showToc !== void 0 && (this.store.showToc.value = t.showToc), t.toc !== void 0 && (this.store.toc.value = ye(t.toc, this.store.totalPages.value)), t.showArrows !== void 0 && (this.store.showArrows.value = t.showArrows), t.allowDownload !== void 0 && (this.store.allowDownload.value = t.allowDownload), t.whiteLabel !== void 0 && (this.store.whiteLabel.value = t.whiteLabel), t.soundEnabled !== void 0 && (this.store.soundEnabled.value = t.soundEnabled), t.locale !== void 0 && (this.store.locale.value = t.locale), t.messages !== void 0 && (this.store.messages.value = t.messages), t.singleMode !== void 0 && (this.store.isSingleMode.value = t.singleMode), t.isSingleMode !== void 0 && (this.store.isSingleMode.value = t.isSingleMode), t.autoPlay !== void 0 && (this.store.isAutoPlaying.value = t.autoPlay), t.autoPlayInterval !== void 0 && (this.store.autoPlayInterval.value = t.autoPlayInterval), this.container && Jt(this.container, this.options);
3284
3362
  }
3285
3363
  async setPages(t, s) {
3286
3364
  if (!(t != null && t.length)) {
@@ -3299,21 +3377,21 @@ const mt = class mt {
3299
3377
  });
3300
3378
  return;
3301
3379
  }
3302
- const g = h.dataset.src;
3303
- g && (h.src = g, delete h.dataset.src);
3380
+ const p = h.dataset.src;
3381
+ p && (h.src = p, delete h.dataset.src);
3304
3382
  }, o = (r = this.container.ownerDocument.defaultView) == null ? void 0 : r.IntersectionObserver;
3305
3383
  if (!o) {
3306
3384
  const h = /* @__PURE__ */ new Set();
3307
3385
  t.forEach((u) => {
3308
- const g = Number(u.dataset.pdfPage);
3309
- Number.isInteger(g) && g > 0 ? h.size < 2 && (h.add(g), s(u)) : s(u);
3386
+ const p = Number(u.dataset.pdfPage);
3387
+ Number.isInteger(p) && p > 0 ? h.size < 2 && (h.add(p), s(u)) : s(u);
3310
3388
  });
3311
3389
  return;
3312
3390
  }
3313
3391
  this.qualityObserver = new o((h) => {
3314
3392
  h.forEach((u) => {
3315
- var g;
3316
- u.isIntersecting && (s(u.target), (g = this.qualityObserver) == null || g.unobserve(u.target));
3393
+ var p;
3394
+ u.isIntersecting && (s(u.target), (p = this.qualityObserver) == null || p.unobserve(u.target));
3317
3395
  });
3318
3396
  }, { root: this.container, rootMargin: "240px" }), t.forEach((h) => {
3319
3397
  var u;
@@ -3331,6 +3409,7 @@ const mt = class mt {
3331
3409
  zoom: this.store.zoomState.value.scale,
3332
3410
  zoomActive: this.store.zoomState.value.isActive,
3333
3411
  showThumbs: this.store.showThumbs.value,
3412
+ showToc: this.store.showToc.value,
3334
3413
  isSingle: this.store.isSingleMode.value,
3335
3414
  orientation: this.store.orientation.value
3336
3415
  };
@@ -3343,7 +3422,7 @@ const mt = class mt {
3343
3422
  pageNumber: t.currentPage + 1,
3344
3423
  totalPages: this.store.totalPages.value,
3345
3424
  isSingle: t.isSingle
3346
- }), (t.zoom !== this.lastEventState.zoom || t.zoomActive !== this.lastEventState.zoomActive) && this.emit("zoomChange", { zoom: t.zoom, isActive: t.zoomActive }), t.showThumbs !== this.lastEventState.showThumbs && this.emit("thumbsToggle", { showThumbs: t.showThumbs }), t.isSingle !== this.lastEventState.isSingle && this.emit("singlePageModeChange", { isSingle: t.isSingle }), t.orientation !== this.lastEventState.orientation && this.emit("orientationChange", { orientation: t.orientation }), this.lastEventState = t;
3425
+ }), (t.zoom !== this.lastEventState.zoom || t.zoomActive !== this.lastEventState.zoomActive) && this.emit("zoomChange", { zoom: t.zoom, isActive: t.zoomActive }), t.showThumbs !== this.lastEventState.showThumbs && this.emit("thumbsToggle", { showThumbs: t.showThumbs }), t.showToc !== this.lastEventState.showToc && this.emit("tocToggle", { showToc: t.showToc }), t.isSingle !== this.lastEventState.isSingle && this.emit("singlePageModeChange", { isSingle: t.isSingle }), t.orientation !== this.lastEventState.orientation && this.emit("orientationChange", { orientation: t.orientation }), this.lastEventState = t;
3347
3426
  });
3348
3427
  }
3349
3428
  captureEventState() {
@@ -3352,6 +3431,7 @@ const mt = class mt {
3352
3431
  zoom: this.store.zoomState.value.scale,
3353
3432
  zoomActive: this.store.zoomState.value.isActive,
3354
3433
  showThumbs: this.store.showThumbs.value,
3434
+ showToc: this.store.showToc.value,
3355
3435
  isSingle: this.store.isSingleMode.value,
3356
3436
  orientation: this.store.orientation.value
3357
3437
  };
@@ -3380,14 +3460,15 @@ const mt = class mt {
3380
3460
  });
3381
3461
  }
3382
3462
  };
3383
- m(mt, "DEFAULT_PAGE_VIEWPORT", { width: 420, height: 594 });
3463
+ v(mt, "DEFAULT_PAGE_VIEWPORT", { width: 420, height: 594 });
3384
3464
  let Rt = mt;
3385
- const we = globalThis, ve = we.FlipbookEngine || {};
3386
- ve.FlipbookEngine = Rt;
3387
- we.FlipbookEngine = ve;
3465
+ const xe = globalThis, Pe = xe.FlipbookEngine || {};
3466
+ Pe.FlipbookEngine = Rt;
3467
+ xe.FlipbookEngine = Pe;
3388
3468
  export {
3389
3469
  Rt as F,
3390
- fi as i,
3391
- vi as n
3470
+ ye as a,
3471
+ yi as i,
3472
+ Pi as n
3392
3473
  };
3393
- //# sourceMappingURL=engine-7jWE07Zq.js.map
3474
+ //# sourceMappingURL=engine-MdZzt6R9.js.map