flipbookengine 0.5.3 → 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 ve = Object.defineProperty;
1
+ var Se = Object.defineProperty;
2
2
  var Nt = (e) => {
3
3
  throw TypeError(e);
4
4
  };
5
- var ye = (e, t, s) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
6
- var m = (e, t, s) => ye(e, typeof t != "symbol" ? t + "" : t, s), yt = (e, t, s) => t.has(e) || Nt("Cannot " + s);
7
- var B = (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);
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
+ 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 be = Symbol.for("preact-signals");
9
+ var ke = Symbol.for("preact-signals");
10
10
  function It() {
11
11
  if (j > 1)
12
12
  j--;
@@ -20,7 +20,7 @@ function It() {
20
20
  var s = tt;
21
21
  for (tt = void 0, lt++; s !== void 0; ) {
22
22
  var o = s.u;
23
- if (s.u = void 0, s.f &= -3, !(8 & s.f) && ee(s)) try {
23
+ if (s.u = void 0, s.f &= -3, !(8 & s.f) && ie(s)) try {
24
24
  s.c();
25
25
  } catch (r) {
26
26
  t || (e = r, t = !0);
@@ -31,41 +31,41 @@ function It() {
31
31
  if (lt = 0, j--, t) throw e;
32
32
  }
33
33
  }
34
- var C = void 0;
34
+ var A = void 0;
35
35
  function wt(e) {
36
- var t = C;
37
- C = void 0;
36
+ var t = A;
37
+ A = void 0;
38
38
  try {
39
39
  return e();
40
40
  } finally {
41
- C = 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
- function te(e) {
46
- if (C !== void 0) {
45
+ function ee(e) {
46
+ if (A !== void 0) {
47
47
  var t = e.n;
48
- if (t === void 0 || t.t !== C)
49
- return t = { i: 0, S: e, p: C.s, n: void 0, t: C, e: void 0, x: void 0, r: t }, C.s !== void 0 && (C.s.n = t), C.s = t, e.n = t, 32 & C.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 = C.s, t.n = void 0, C.s.n = t, C.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 = be;
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,32 +75,32 @@ 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
- return _(function() {
80
+ return G(function() {
81
81
  var s = t.value;
82
82
  wt(function() {
83
83
  return e(s);
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() {
103
- var e = te(this);
102
+ Object.defineProperty(L.prototype, "value", { get: function() {
103
+ var e = ee(this);
104
104
  return e !== void 0 && (e.i = this.i), this.v;
105
105
  }, set: function(e) {
106
106
  if (e !== this.v) {
@@ -115,14 +115,14 @@ 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
- function ee(e) {
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;
123
123
  return !1;
124
124
  }
125
- function ie(e) {
125
+ function se(e) {
126
126
  for (var t = e.s; t !== void 0; t = t.n) {
127
127
  var s = t.S.n;
128
128
  if (s !== void 0 && (t.r = s), t.S.n = t, t.i = -1, t.n === void 0) {
@@ -131,7 +131,7 @@ function ie(e) {
131
131
  }
132
132
  }
133
133
  }
134
- function se(e) {
134
+ function ne(e) {
135
135
  for (var t = e.s, s = void 0; t !== void 0; ) {
136
136
  var o = t.p;
137
137
  t.i === -1 ? (t.S.U(t), o !== void 0 && (o.n = t.n), t.n !== void 0 && (t.n.p = o)) : s = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = o;
@@ -139,33 +139,33 @@ function se(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
- if (this.g = dt, this.f |= 1, this.i > 0 && !ee(this))
148
+ if (this.g = dt, this.f |= 1, this.i > 0 && !ie(this))
149
149
  return this.f &= -2, !0;
150
- var e = C;
150
+ var e = A;
151
151
  try {
152
- ie(this), C = 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 C = e, se(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
  }
@@ -178,35 +178,35 @@ q.prototype.N = function() {
178
178
  };
179
179
  Object.defineProperty(q.prototype, "value", { get: function() {
180
180
  if (1 & this.f) throw new Error("Cycle detected");
181
- var e = te(this);
181
+ var e = ee(this);
182
182
  if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
183
183
  return this.v;
184
184
  } });
185
185
  function w(e, t) {
186
186
  return new q(e, t);
187
187
  }
188
- function ne(e) {
188
+ 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 = C;
193
- C = 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
- C = s, It();
199
+ A = s, It();
200
200
  }
201
201
  }
202
202
  }
203
203
  function Lt(e) {
204
204
  for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
205
- e.x = void 0, e.s = void 0, ne(e);
205
+ e.x = void 0, e.s = void 0, oe(e);
206
206
  }
207
- function xe(e) {
208
- if (C !== this) throw new Error("Out-of-order effect");
209
- se(this), C = 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;
@@ -223,9 +223,9 @@ X.prototype.c = function() {
223
223
  };
224
224
  X.prototype.S = function() {
225
225
  if (1 & this.f) throw new Error("Cycle detected");
226
- this.f |= 1, this.f &= -9, ne(this), ie(this), j++;
227
- var e = C;
228
- return C = this, xe.bind(this, e);
226
+ this.f |= 1, this.f &= -9, oe(this), se(this), j++;
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);
@@ -236,7 +236,7 @@ X.prototype.d = function() {
236
236
  X.prototype.dispose = function() {
237
237
  this.d();
238
238
  };
239
- function _(e, t) {
239
+ function G(e, t) {
240
240
  var s = new X(e, t);
241
241
  try {
242
242
  s.c();
@@ -246,46 +246,46 @@ function _(e, t) {
246
246
  var o = s.d.bind(s);
247
247
  return o[Symbol.dispose] = o, o;
248
248
  }
249
- var oe = /* @__PURE__ */ Symbol.for("Serenity.initPropHook");
250
- function Pe(e) {
249
+ var re = /* @__PURE__ */ Symbol.for("Serenity.initPropHook");
250
+ function Ae(e) {
251
251
  return !!(e && typeof e.nodeType == "number");
252
252
  }
253
253
  function vt(e) {
254
254
  return typeof e == "string";
255
255
  }
256
- function re(e) {
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 Se(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 Ce(e) {
269
- return typeof e == "function" && typeof e[oe] == "function";
268
+ function Me(e) {
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 ke(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
- ke(e) ? e.current = t : typeof e == "function" && e(t);
281
+ De(e) ? e.current = t : typeof e == "function" && e(t);
282
282
  }
283
- function Te(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 Ae = "http://www.w3.org/1998/Math/MathML", Ee = /* @__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"]), Me = /* @__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,33 +350,33 @@ var Ae = "http://www.w3.org/1998/Math/MathML", Ee = /* @__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)/, De = "http://www.w3.org/2000/svg", Ut = /* @__PURE__ */ Symbol.for("Serenity.jsxNamespaceURI");
354
- function Re(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 Ie = /* @__PURE__ */ Symbol.for("Serenity.jsxTypeKey"), Le = "ShadowRoot";
359
- function ze(e) {
360
- return e != null && e[Ie] === Le;
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) && Fe(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 Fe(e, t) {
369
+ function Ne(e, t) {
370
370
  if (!e)
371
371
  return;
372
372
  const s = Ot();
373
373
  function o(r) {
374
- const l = s.get(r);
375
- if (l) {
374
+ const h = s.get(r);
375
+ if (h) {
376
376
  s.delete(r), r.removeEventListener("disposing", Wt);
377
- for (const d of l)
377
+ for (const u of h)
378
378
  try {
379
- d.callback(r);
379
+ u.callback(r);
380
380
  } catch {
381
381
  }
382
382
  }
@@ -393,23 +393,23 @@ function kt(e, t, s) {
393
393
  callback: t,
394
394
  regKey: s
395
395
  }]), e.addEventListener("disposing", Wt, { once: !0 })), e;
396
- const l = r.find((d) => d.callback === t);
397
- return l ? (l.regKey, e) : (r.push({ callback: t, regKey: s }), e);
396
+ const h = r.find((u) => u.callback === t);
397
+ return h ? (h.regKey, e) : (r.push({ callback: t, regKey: s }), e);
398
398
  }
399
399
  function jt(e, t, s) {
400
400
  if (!e || !t)
401
401
  return e;
402
402
  const o = Ot(), r = o.get(e);
403
403
  if (r) {
404
- for (let l = r.length - 1; l >= 0; l--) {
405
- const d = r[l];
406
- t && t === d.callback && r.splice(l, 1);
404
+ for (let h = r.length - 1; h >= 0; h--) {
405
+ const u = r[h];
406
+ t && t === u.callback && r.splice(h, 1);
407
407
  }
408
408
  r.length === 0 && (o.delete(e), typeof e.removeEventListener == "function" && e.removeEventListener("disposing", Wt));
409
409
  }
410
410
  return e;
411
411
  }
412
- function Oe(...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,64 +419,64 @@ function Oe(...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, F, G, Tt, At, Jt, We = (Jt = class {
422
+ var ot, $, U, Ct, At, te, _e = (te = class {
423
423
  constructor(e, t, s) {
424
- rt(this, G);
424
+ rt(this, U);
425
425
  rt(this, ot);
426
- rt(this, F);
427
- this.signal = e, this.isInitial = !0, this.hasChanged = !1, this.lifecycleRoot = t, at(this, F, 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 B(this, F);
430
+ return _(this, $);
431
431
  }
432
432
  get effectDisposer() {
433
- return B(this, ot);
433
+ return _(this, ot);
434
434
  }
435
435
  set effectDisposer(e) {
436
- J(this, G, Tt).call(this), at(this, ot, e), J(this, G, 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 !== B(this, F) && (J(this, G, Tt).call(this), at(this, F, e), J(this, G, 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(), F = new WeakMap(), G = new WeakSet(), Tt = function() {
441
+ }, ot = new WeakMap(), $ = new WeakMap(), U = new WeakSet(), Ct = function() {
442
442
  var e;
443
- jt(B(this, F), this.effectDisposer), jt(B(this, F), (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(B(this, F), this.effectDisposer), kt(B(this, F), (e = this.signal) == null ? void 0 : e.derivedDisposer);
447
- }, Jt);
446
+ kt(_(this, $), this.effectDisposer), kt(_(this, $), (e = this.signal) == null ? void 0 : e.derivedDisposer);
447
+ }, te);
448
448
  function nt(e, t, s) {
449
- const o = s != null && s.useLifecycleRoot ? Oe() : void 0, r = new We(e, o, s == null ? void 0 : s.lifecycleNode), l = r.signal.subscribe(function(d) {
450
- r.newValue = d, r.isInitial && (this != null && this.dispose) && (r.effectDisposer = this.dispose.bind(this)), r.hasChanged = !r.isInitial && r.prevValue !== r.newValue;
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
+ 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);
453
453
  } finally {
454
454
  r.prevValue = r.newValue, r.isInitial = !1;
455
455
  }
456
456
  });
457
- return l && !r.effectDisposer && (r.effectDisposer = l), r.effectDisposer;
457
+ return h && !r.effectDisposer && (r.effectDisposer = h), r.effectDisposer;
458
458
  }
459
459
  function Vt(e, t) {
460
460
  e instanceof window.HTMLTemplateElement ? e.content.appendChild(t) : e.appendChild(t);
461
461
  }
462
462
  var Pt = 0, Et = "__domwisefrag_";
463
- function ae(e) {
463
+ function he(e) {
464
464
  return e instanceof Comment && e.data.startsWith(Et);
465
465
  }
466
466
  function Zt(e) {
467
- return e instanceof DocumentFragment && ae(e.firstChild);
467
+ return e instanceof DocumentFragment && he(e.firstChild);
468
468
  }
469
- function $e(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 He(e, t) {
476
+ function Ue(e, t) {
477
477
  let s;
478
478
  nt(t, (o) => {
479
- var d;
479
+ var u;
480
480
  if (o.isInitial) {
481
481
  s = qt(o.newValue);
482
482
  let p = Zt(s) ? s.firstChild : s;
@@ -486,13 +486,13 @@ function He(e, t) {
486
486
  if (!o.hasChanged)
487
487
  return;
488
488
  const r = qt(o.newValue);
489
- if (ae(s)) {
489
+ if (he(s)) {
490
490
  let p;
491
- for (; (p = s.nextSibling) && ((d = p.parentNode) == null || d.removeChild(p), !(p instanceof Comment && p.data === s.data)); )
491
+ for (; (p = s.nextSibling) && ((u = p.parentNode) == null || u.removeChild(p), !(p instanceof Comment && p.data === s.data)); )
492
492
  ;
493
493
  }
494
- let l = Zt(r) ? r.firstChild : r;
495
- $e(s, r), o.lifecycleNode = (s = l) ?? e;
494
+ let h = Zt(r) ? r.firstChild : r;
495
+ Ge(s, r), o.lifecycleNode = (s = h) ?? e;
496
496
  });
497
497
  }
498
498
  function ut(e, t) {
@@ -500,51 +500,51 @@ function ut(e, t) {
500
500
  if (zt(t))
501
501
  for (const s of [...t])
502
502
  ut(e, s);
503
- else if (vt(t) || re(t))
503
+ else if (vt(t) || ae(t))
504
504
  Vt(e, document.createTextNode(t));
505
- else if (Pe(t))
505
+ else if (Ae(t))
506
506
  Vt(e, t);
507
- else if (ze(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) && He(e, t);
510
+ } else Z(t) && Ue(e, t);
511
511
  }
512
- function he(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]) => {
512
+ function le(e) {
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 Ne(e, t) {
517
+ function je(e, t) {
518
518
  if (t == null || t === !1 || t === !0)
519
519
  return;
520
- t = he(t);
520
+ t = le(t);
521
521
  const s = (st(t) ?? "").split(" ");
522
522
  for (let o of s)
523
523
  o && e.classList.remove(o);
524
524
  }
525
- function Be(e, t, s) {
525
+ function Ve(e, t, s) {
526
526
  if (t == null || t === !1) {
527
- Ne(e, s);
527
+ je(e, s);
528
528
  return;
529
529
  }
530
- s = he(s), zt(t) ? t = Array.from(t).map((o) => {
530
+ s = le(s), zt(t) ? t = Array.from(t).map((o) => {
531
531
  let r = o;
532
- return Z(o) && nt(o, (l) => {
533
- if (l.isInitial) {
534
- r = l.newValue;
532
+ return Z(o) && nt(o, (h) => {
533
+ if (h.isInitial) {
534
+ r = h.newValue;
535
535
  return;
536
536
  }
537
- St(e, l.newValue, l.prevValue);
537
+ St(e, h.newValue, h.prevValue);
538
538
  }, {
539
539
  lifecycleNode: e
540
540
  }), r;
541
- }) : z(t) && (t = { ...t }, Object.entries(t).forEach(([o, r]) => {
542
- Z(r) && nt(r, (l) => {
543
- if (l.isInitial) {
544
- t[o] = l.newValue;
541
+ }) : O(t) && (t = { ...t }, Object.entries(t).forEach(([o, r]) => {
542
+ Z(r) && nt(r, (h) => {
543
+ if (h.isInitial) {
544
+ t[o] = h.newValue;
545
545
  return;
546
546
  }
547
- St(e, !!l.newValue && o, !!l.prevValue && o);
547
+ St(e, !!h.newValue && o, !!h.prevValue && o);
548
548
  }, {
549
549
  lifecycleNode: e
550
550
  });
@@ -554,16 +554,16 @@ function St(e, t, s) {
554
554
  const o = (st(t) ?? "").split(" ");
555
555
  if (s) {
556
556
  const r = (st(s) ?? "").split(" ");
557
- for (let l of r)
558
- l && !o.includes(l) && e.classList.remove(l);
557
+ for (let h of r)
558
+ h && !o.includes(h) && e.classList.remove(h);
559
559
  }
560
560
  for (let r of o)
561
561
  r && e.classList.add(r);
562
562
  }
563
- function _e(e, t) {
563
+ function Ze(e, t) {
564
564
  return e + t.charAt(0).toUpperCase() + t.substring(1);
565
565
  }
566
- var Ge = /* @__PURE__ */ (() => {
566
+ var qe = /* @__PURE__ */ (() => {
567
567
  let e = {
568
568
  animationIterationCount: 0,
569
569
  borderImageOutset: 0,
@@ -612,12 +612,12 @@ var Ge = /* @__PURE__ */ (() => {
612
612
  const t = ["Webkit", "ms", "Moz", "O"];
613
613
  return Object.keys(e).forEach((s) => {
614
614
  t.forEach((o) => {
615
- e[_e(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) : re(s) && Ge[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 Ue(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,22 +639,22 @@ function Ue(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
- Z(r) ? nt(r, (l) => Mt(e, o, l.newValue), {
646
+ Z(r) ? nt(r, (h) => Mt(e, o, h.newValue), {
647
647
  lifecycleNode: e
648
648
  }) : Mt(e, o, r);
649
649
  });
650
650
  return;
651
651
  }
652
652
  }
653
- var je = "http://www.w3.org/1999/xlink", Ve = "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 Ze = /* @__PURE__ */ new Map([
657
+ var Ke = /* @__PURE__ */ new Map([
658
658
  ["autoComplete", "autocomplete"],
659
659
  ["autoFocus", "autofocus"],
660
660
  ["className", "class"],
@@ -676,17 +676,17 @@ var Ze = /* @__PURE__ */ new Map([
676
676
  function Yt(e, t, s, o) {
677
677
  switch (t) {
678
678
  case "dataset":
679
- o != null && Object.entries(o).forEach(([l, d]) => {
680
- d != null && delete e.dataset[l];
681
- }), Object.entries(s).forEach(([l, d]) => {
682
- d != null && (e.dataset[l] = d);
679
+ o != null && Object.entries(o).forEach(([h, u]) => {
680
+ u != null && delete e.dataset[h];
681
+ }), Object.entries(s).forEach(([h, u]) => {
682
+ u != null && (e.dataset[h] = u);
683
683
  });
684
684
  return;
685
685
  case "textContent":
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
- Be(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,15 +717,15 @@ function Yt(e, t, s, o) {
717
717
  case "namespaceURI":
718
718
  return;
719
719
  case "style":
720
- Ue(e, s, o);
720
+ Xe(e, s, o);
721
721
  return;
722
722
  case "on":
723
723
  case "onCapture":
724
724
  const r = t === "onCapture";
725
- o != null && Object.entries(o).forEach(([l, d]) => {
726
- (s == null || s[l] !== d) && e.removeEventListener(l, d, r);
727
- }), Object.entries(s).forEach(([l, d]) => {
728
- (o == null || o[l] !== d) && e.addEventListener(l, d, r);
725
+ o != null && Object.entries(o).forEach(([h, u]) => {
726
+ (s == null || s[h] !== u) && e.removeEventListener(h, u, r);
727
+ }), Object.entries(s).forEach(([h, u]) => {
728
+ (o == null || o[h] !== u) && e.addEventListener(h, u, r);
729
729
  });
730
730
  return;
731
731
  case "xlinkActuate":
@@ -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(je, 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(Ve, ht(t, ":"), s);
746
+ e.setAttributeNS(Qe, ht(t, ":"), s);
747
747
  return;
748
748
  }
749
749
  if (typeof s == "function") {
@@ -751,14 +751,14 @@ function Yt(e, t, s, o) {
751
751
  if (o != null && o === s)
752
752
  return;
753
753
  let r = t.toLowerCase();
754
- const l = r.endsWith("capture");
755
- let d;
756
- !l && (e[r] === null || o != null && e[r] === o) ? (e[r] = s, kt(e, Xe.bind(e, r))) : l ? (d = r.substring(2, r.length - 7), o != null && e.removeEventListener(d, o, !0), e.addEventListener(d, s, !0)) : (r in window ? d = r.substring(2) : d = r[2] + t.slice(3), o != null && e.removeEventListener(d, o), e.addEventListener(d, s));
754
+ const h = r.endsWith("capture");
755
+ let u;
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 qe(e, t) {
786
+ function Je(e, t) {
787
787
  for (let [s, o] of Object.entries(t))
788
- s = Ze.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
- }) : Ce(o) ? o[oe](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 Xe(e) {
793
+ function ti(e) {
794
794
  this[e] = null;
795
795
  }
796
- function g(e, t) {
796
+ function d(e, t) {
797
797
  let { children: s, ...o } = t || {}, r = o.namespaceURI;
798
- r || (Me.has(e) ? r = De : Ee.has(e) ? r = Ae : r = Re());
799
- let l;
798
+ r || (ze.has(e) ? r = Fe : Le.has(e) ? r = Ie : r = Oe());
799
+ let h;
800
800
  if (vt(e)) {
801
- if (l = r ? document.createElementNS(r, e) : document.createElement(e), qe(l, o), ut(l, s), l 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 d = o.value.map((p) => String(p));
804
- l.querySelectorAll("option").forEach((p) => p.selected = d.includes(p.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
- l.value = o.value;
807
- Ft(o.ref, l);
806
+ h.value = o.value;
807
+ Ft(o.ref, h);
808
808
  } else if (typeof e == "function")
809
- z(e.defaultProps) && (o = { ...e.defaultProps, ...o }), l = Se(e) ? Te(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
- return l;
812
+ return h;
813
813
  }
814
- var Ye = /* @__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--;
@@ -825,7 +825,7 @@ function $t() {
825
825
  var s = et;
826
826
  for (et = void 0, gt++; s !== void 0; ) {
827
827
  var o = s.u;
828
- if (s.u = void 0, s.f &= -3, !(8 & s.f) && de(s)) try {
828
+ if (s.u = void 0, s.f &= -3, !(8 & s.f) && ue(s)) try {
829
829
  s.c();
830
830
  } catch (r) {
831
831
  t || (e = r, t = !0);
@@ -837,7 +837,7 @@ function $t() {
837
837
  }
838
838
  }
839
839
  var P = void 0;
840
- function le(e) {
840
+ function ce(e) {
841
841
  var t = P;
842
842
  P = void 0;
843
843
  try {
@@ -847,7 +847,7 @@ function le(e) {
847
847
  }
848
848
  }
849
849
  var et = void 0, V = 0, gt = 0, Qt = 0, pt = void 0, ft = 0;
850
- function ce(e) {
850
+ function de(e) {
851
851
  if (P !== void 0) {
852
852
  var t = e.n;
853
853
  if (t === void 0 || t.t !== P)
@@ -856,33 +856,33 @@ function ce(e) {
856
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 = Ye;
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
- s !== e && e.e === void 0 && (e.x = s, this.t = e, s !== void 0 ? s.e = e : le(function() {
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;
877
- s !== void 0 && (s.x = o, e.e = void 0), o !== void 0 && (o.e = s, e.x = void 0), e === this.t && (this.t = o, o === void 0 && le(function() {
877
+ s !== void 0 && (s.x = o, e.e = void 0), o !== void 0 && (o.e = s, e.x = void 0), e === this.t && (this.t = o, o === void 0 && ce(function() {
878
878
  var r;
879
879
  (r = t.Z) == null || r.call(t);
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 Ke(function() {
885
+ return si(function() {
886
886
  var s = t.value, o = P;
887
887
  P = void 0;
888
888
  try {
@@ -892,16 +892,16 @@ L.prototype.subscribe = function(e) {
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() {
904
+ z.prototype.peek = function() {
905
905
  var e = P;
906
906
  P = void 0;
907
907
  try {
@@ -910,8 +910,8 @@ L.prototype.peek = function() {
910
910
  P = e;
911
911
  }
912
912
  };
913
- Object.defineProperty(L.prototype, "value", { get: function() {
914
- var e = ce(this);
913
+ Object.defineProperty(z.prototype, "value", { get: function() {
914
+ var e = de(this);
915
915
  return e !== void 0 && (e.i = this.i), this.v;
916
916
  }, set: function(e) {
917
917
  if (e !== this.v) {
@@ -926,11 +926,11 @@ Object.defineProperty(L.prototype, "value", { get: function() {
926
926
  }
927
927
  }
928
928
  } });
929
- function de(e) {
929
+ function ue(e) {
930
930
  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;
931
931
  return !1;
932
932
  }
933
- function ue(e) {
933
+ function ge(e) {
934
934
  for (var t = e.s; t !== void 0; t = t.n) {
935
935
  var s = t.S.n;
936
936
  if (s !== void 0 && (t.r = s), t.S.n = t, t.i = -1, t.n === void 0) {
@@ -939,7 +939,7 @@ function ue(e) {
939
939
  }
940
940
  }
941
941
  }
942
- function ge(e) {
942
+ function pe(e) {
943
943
  for (var t = e.s, s = void 0; t !== void 0; ) {
944
944
  var o = t.p;
945
945
  t.i === -1 ? (t.S.U(t), o !== void 0 && (o.n = t.n), t.n !== void 0 && (t.n.p = o)) : s = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = o;
@@ -947,33 +947,33 @@ function ge(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
- if (this.g = ft, this.f |= 1, this.i > 0 && !de(this))
956
+ if (this.g = ft, this.f |= 1, this.i > 0 && !ue(this))
957
957
  return this.f &= -2, !0;
958
958
  var e = P;
959
959
  try {
960
- ue(this), P = 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 P = e, ge(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
  }
@@ -986,11 +986,11 @@ Y.prototype.N = function() {
986
986
  };
987
987
  Object.defineProperty(Y.prototype, "value", { get: function() {
988
988
  if (1 & this.f) throw new Error("Cycle detected");
989
- var e = ce(this);
989
+ var e = de(this);
990
990
  if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
991
991
  return this.v;
992
992
  } });
993
- function pe(e) {
993
+ function fe(e) {
994
994
  var t = e.m;
995
995
  if (e.m = void 0, typeof t == "function") {
996
996
  V++;
@@ -1007,11 +1007,11 @@ function pe(e) {
1007
1007
  }
1008
1008
  function Ht(e) {
1009
1009
  for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);
1010
- e.x = void 0, e.s = void 0, pe(e);
1010
+ e.x = void 0, e.s = void 0, fe(e);
1011
1011
  }
1012
- function Qe(e) {
1012
+ function ii(e) {
1013
1013
  if (P !== this) throw new Error("Out-of-order effect");
1014
- ge(this), P = e, this.f &= -2, 8 & this.f && Ht(this), $t();
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;
@@ -1028,9 +1028,9 @@ Q.prototype.c = function() {
1028
1028
  };
1029
1029
  Q.prototype.S = function() {
1030
1030
  if (1 & this.f) throw new Error("Cycle detected");
1031
- this.f |= 1, this.f &= -9, pe(this), ue(this), V++;
1031
+ this.f |= 1, this.f &= -9, fe(this), ge(this), V++;
1032
1032
  var e = P;
1033
- return P = this, Qe.bind(this, e);
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 Ke(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 Ke(e, t) {
1051
1051
  var o = s.d.bind(s);
1052
1052
  return o[Symbol.dispose] = o, o;
1053
1053
  }
1054
- const Je = {
1054
+ const ni = {
1055
1055
  emptyStateTitle: "No data available.",
1056
1056
  thumbnails: "Thumbnails",
1057
1057
  singlePageMode: "Single Page Mode",
@@ -1064,8 +1064,9 @@ const Je = {
1064
1064
  settings: "Settings",
1065
1065
  downloadCatalog: "Download Catalog",
1066
1066
  play: "Play",
1067
- pause: "Pause"
1068
- }, ti = {
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 Je = {
1078
1079
  settings: "Ayarlar",
1079
1080
  downloadCatalog: "Kataloğu İndir",
1080
1081
  play: "Otomatik Oynat",
1081
- pause: "Duraklat"
1082
- }, Ct = {
1083
- en: Je,
1084
- tr: ti
1082
+ pause: "Duraklat",
1083
+ tableOfContents: "İçindekiler"
1084
+ }, Tt = {
1085
+ en: ni,
1086
+ tr: oi
1085
1087
  };
1086
- function ei(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 ii(e) {
1096
- const t = w(() => ei({ locale: e.store.locale.value, messages: e.store.messages.value }));
1097
- return /* @__PURE__ */ g("div", { class: "bk-toolbar", role: "toolbar", "aria-label": "Flipbook controls", children: [
1098
- /* @__PURE__ */ g("div", { class: "bk-btn-group", children: [
1099
- /* @__PURE__ */ g(
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 ii(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__ */ g("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__ */ g("rect", { x: "3", y: "3", width: "7", height: "7" }),
1110
- /* @__PURE__ */ g("rect", { x: "14", y: "3", width: "7", height: "7" }),
1111
- /* @__PURE__ */ g("rect", { x: "14", y: "14", width: "7", height: "7" }),
1112
- /* @__PURE__ */ g("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__ */ g(
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 ii(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__ */ g("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__ */ g("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
1127
- /* @__PURE__ */ g("polyline", { points: "14 2 14 8 20 8" }),
1128
- /* @__PURE__ */ g("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
1129
- /* @__PURE__ */ g("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
1130
- /* @__PURE__ */ g("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__ */ g(
1155
+ /* @__PURE__ */ d(
1135
1156
  "button",
1136
1157
  {
1137
1158
  type: "button",
@@ -1141,34 +1162,34 @@ function ii(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__ */ g("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__ */ g("rect", { x: "6", y: "4", width: "4", height: "16" }),
1146
- /* @__PURE__ */ g("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__ */ g("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__ */ g("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__ */ g("div", { class: "bk-btn-group bk-btn-group--center", children: [
1154
- /* @__PURE__ */ g("button", { type: "button", class: "bk-btn", onClick: e.onPrevPage, "aria-label": w(() => t.value.previous || "Previous"), title: w(() => t.value.previous || "Previous"), children: /* @__PURE__ */ g("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__ */ g("polyline", { points: "15 18 9 12 15 6" }) }) }),
1155
- /* @__PURE__ */ g("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__ */ g("button", { type: "button", class: "bk-btn", onClick: e.onNextPage, "aria-label": w(() => t.value.next || "Next"), title: w(() => t.value.next || "Next"), children: /* @__PURE__ */ g("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__ */ g("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__ */ g("div", { class: "bk-btn-group", children: [
1165
- /* @__PURE__ */ g("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__ */ g("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__ */ g("circle", { cx: "11", cy: "11", r: "8" }),
1167
- /* @__PURE__ */ g("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1168
- /* @__PURE__ */ g("line", { x1: "11", y1: "8", x2: "11", y2: "14" }),
1169
- /* @__PURE__ */ g("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__ */ g(
1192
+ /* @__PURE__ */ d(
1172
1193
  "button",
1173
1194
  {
1174
1195
  type: "button",
@@ -1176,20 +1197,20 @@ function ii(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__ */ g("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__ */ g("circle", { cx: "11", cy: "11", r: "8" }),
1181
- /* @__PURE__ */ g("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" }),
1182
- /* @__PURE__ */ g("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__ */ g("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__ */ g("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__ */ g("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__ */ g("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__ */ g("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__ */ g("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1189
- /* @__PURE__ */ g("polyline", { points: "7 10 12 15 17 10" }),
1190
- /* @__PURE__ */ g("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__ */ g(
1213
+ /* @__PURE__ */ d(
1193
1214
  "button",
1194
1215
  {
1195
1216
  type: "button",
@@ -1199,15 +1220,15 @@ function ii(e) {
1199
1220
  "aria-pressed": w(() => e.store.soundEnabled.value ? "true" : "false"),
1200
1221
  title: "Sound",
1201
1222
  children: [
1202
- /* @__PURE__ */ g("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__ */ g("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1204
- /* @__PURE__ */ g("path", { d: "M15.54 8.46a5 5 0 0 1 0 7.07" }),
1205
- /* @__PURE__ */ g("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__ */ g("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__ */ g("polygon", { points: "11 5 6 9 2 9 2 15 6 15 11 19 11 5" }),
1209
- /* @__PURE__ */ g("line", { x1: "23", y1: "9", x2: "17", y2: "15" }),
1210
- /* @__PURE__ */ g("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,16 +1236,16 @@ function ii(e) {
1215
1236
  ] })
1216
1237
  ] });
1217
1238
  }
1218
- function si(e) {
1219
- return /* @__PURE__ */ g("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)
1223
1244
  return r === s;
1224
- const l = r % 2 === 1 ? r : r - 1;
1225
- return s === l || s === l + 1;
1245
+ const h = r % 2 === 1 ? r : r - 1;
1246
+ return s === h || s === h + 1;
1226
1247
  };
1227
- return /* @__PURE__ */ g(
1248
+ return /* @__PURE__ */ d(
1228
1249
  "div",
1229
1250
  {
1230
1251
  class: w(() => `thumb-item ${o() ? "active" : ""}`),
@@ -1237,7 +1258,7 @@ function si(e) {
1237
1258
  (r.key === "Enter" || r.key === " ") && (r.preventDefault(), e.onThumbClick(s));
1238
1259
  },
1239
1260
  children: [
1240
- /* @__PURE__ */ g("div", { class: "thumb-img-wrapper", children: /* @__PURE__ */ g(
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 si(e) {
1250
1271
  }
1251
1272
  }
1252
1273
  ) }),
1253
- /* @__PURE__ */ g("span", { children: s + 1 })
1274
+ /* @__PURE__ */ d("span", { children: s + 1 })
1254
1275
  ]
1255
1276
  }
1256
1277
  );
1257
1278
  }) });
1258
1279
  }
1259
- function ni(e) {
1260
- return /* @__PURE__ */ g(
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 ni(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__ */ g(
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__ */ g(
1333
+ /* @__PURE__ */ d(
1277
1334
  "div",
1278
1335
  {
1279
1336
  ref: e.bookContainerRef,
@@ -1281,14 +1338,14 @@ function ni(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__ */ g(
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__ */ g("div", { class: "bz-page-content", style: "position:relative; width:100%; height:100%; overflow:hidden;", children: [
1291
- /* @__PURE__ */ g(
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 ni(e) {
1299
1356
  loading: "lazy"
1300
1357
  }
1301
1358
  ),
1302
- /* @__PURE__ */ g("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__ */ g(
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__ */ g(
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 ni(e) {
1332
1389
  }
1333
1390
  );
1334
1391
  }
1335
- function oi(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__ */ g("div", { class: "bk-nav-arrows", style: w(() => e.store.showArrows.value ? "display: flex;" : "display: none;"), children: [
1338
- /* @__PURE__ */ g(
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 oi(e) {
1345
1402
  o.preventDefault(), e.onPrevPage();
1346
1403
  },
1347
1404
  "aria-label": "Previous Page",
1348
- children: /* @__PURE__ */ g("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__ */ g(
1408
+ /* @__PURE__ */ d(
1352
1409
  "button",
1353
1410
  {
1354
1411
  type: "button",
@@ -1358,42 +1415,46 @@ function oi(e) {
1358
1415
  o.preventDefault(), e.onNextPage();
1359
1416
  },
1360
1417
  "aria-label": "Next Page",
1361
- children: /* @__PURE__ */ g("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 ri(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();
1376
- }, l = () => {
1377
- var b;
1378
- (b = e.interactionManagerRef.current) == null || b.zoomOut();
1379
- }, d = () => e.onToggleFullscreen(), p = (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
- }, S = () => {
1386
- var b;
1387
- (b = e.pageFlipAdapterRef.current) == null || b.turnToPrevPage();
1431
+ e.store.isAutoPlaying.value = !e.store.isAutoPlaying.value;
1432
+ }, h = () => {
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__ */ g(
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__ */ g("div", { class: "bk-main-area", children: [
1395
- /* @__PURE__ */ g(
1396
- ni,
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 ri(e) {
1401
1462
  bookContainerRef: e.bookContainerRef
1402
1463
  }
1403
1464
  ),
1404
- /* @__PURE__ */ g(
1405
- oi,
1465
+ /* @__PURE__ */ d(
1466
+ ci,
1406
1467
  {
1407
1468
  store: e.store,
1408
- onPrevPage: S,
1409
- onNextPage: x
1469
+ onPrevPage: I,
1470
+ onNextPage: M
1410
1471
  }
1411
1472
  ),
1412
- e.store.whiteLabel.value ? null : /* @__PURE__ */ g("div", { class: "bk-watermark", children: [
1473
+ e.store.whiteLabel.value ? null : /* @__PURE__ */ d("div", { class: "bk-watermark", children: [
1413
1474
  "Powered by ",
1414
- /* @__PURE__ */ g("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__ */ g(
1418
- ii,
1479
+ /* @__PURE__ */ d(
1480
+ ri,
1419
1481
  {
1420
1482
  store: e.store,
1421
1483
  onToggleThumbs: t,
1422
- onToggleSingleMode: s,
1423
- onZoomIn: r,
1424
- onZoomOut: l,
1484
+ onToggleToc: s,
1485
+ onToggleSingleMode: o,
1486
+ onZoomIn: h,
1487
+ onZoomOut: u,
1425
1488
  onDownload: e.onDownload,
1426
- onNextPage: x,
1427
- onPrevPage: S,
1489
+ onNextPage: M,
1490
+ onPrevPage: I,
1428
1491
  onSoundToggle: () => e.store.soundEnabled.value = !e.store.soundEnabled.value,
1429
- onToggleAutoPlay: o,
1430
- onToggleFullscreen: d
1492
+ onToggleAutoPlay: r,
1493
+ onToggleFullscreen: p
1431
1494
  }
1432
1495
  ),
1433
- /* @__PURE__ */ g(
1434
- si,
1496
+ /* @__PURE__ */ d(
1497
+ ai,
1435
1498
  {
1436
1499
  store: e.store,
1437
- onThumbClick: p
1500
+ onThumbClick: x
1438
1501
  }
1439
1502
  )
1440
1503
  ]
1441
1504
  }
1442
1505
  );
1443
1506
  }
1444
- var ai = 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
- })(ai, 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 ai = 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), c = this.render.getRect().pageWidth, h = 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 u of this.state.area) u !== null && (u = this.render.convertToGlobal(u), n.lineTo(u.x - a.x, u.y - a.y));
1495
- n.rotate(this.state.angle), n.clip(), this.isLoad ? n.drawImage(this.image, 0, 0, c, h) : this.drawLoader(n, { x: 0, y: 0 }, c, h), 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(), c = n.pageWidth, h = n.height, u = i === 1 ? n.left + n.pageWidth : n.left, v = n.top;
1499
- this.isLoad ? a.drawImage(this.image, u, v, c, h) : this.drawLoader(a, { x: u, y: v }, c, h);
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
- drawLoader(i, n, a, c) {
1502
- 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, c - 1), i.stroke(), i.fill();
1503
- const h = { x: n.x + a / 2, y: n.y + c / 2 };
1504
- i.beginPath(), i.lineWidth = 10, i.arc(h.x, h.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);
1564
+ drawLoader(i, n, a, l) {
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();
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 = () => {
@@ -1517,7 +1580,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1517
1580
  hideTemporaryCopy() {
1518
1581
  }
1519
1582
  }
1520
- class l {
1583
+ class h {
1521
1584
  constructor(i, n) {
1522
1585
  this.pages = [], this.currentPageIndex = 0, this.currentSpreadIndex = 0, this.landscapeSpread = [], this.portraitSpread = [], this.render = n, this.app = i, this.currentPageIndex = 0, this.isShowCover = this.app.getSettings().showCover;
1523
1586
  }
@@ -1599,7 +1662,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1599
1662
  i.length === 2 ? (this.render.setLeftPage(this.pages[i[0]]), this.render.setRightPage(this.pages[i[1]])) : this.render.getOrientation() === "landscape" && i[0] === this.pages.length - 1 ? (this.render.setLeftPage(this.pages[i[0]]), this.render.setRightPage(null)) : (this.render.setLeftPage(null), this.render.setRightPage(this.pages[i[0]])), this.currentPageIndex = i[0], this.app.updatePageIndex(this.currentPageIndex);
1600
1663
  }
1601
1664
  }
1602
- class d extends l {
1665
+ class u extends h {
1603
1666
  constructor(i, n, a) {
1604
1667
  super(i, n), this.imagesHref = a;
1605
1668
  }
@@ -1619,8 +1682,8 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1619
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, c = n[0].y - n[1].y, h = i[1].x - i[0].x, u = n[1].x - n[0].x;
1623
- return Math.acos((a * c + h * u) / (Math.sqrt(a * a + h * h) * Math.sqrt(c * c + u * u)));
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;
@@ -1630,36 +1693,36 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1630
1693
  }
1631
1694
  static LimitPointToCircle(i, n, a) {
1632
1695
  if (p.GetDistanceBetweenTwoPoint(i, a) <= n) return a;
1633
- const c = i.x, h = i.y, u = a.x, v = a.y;
1634
- let y = Math.sqrt(Math.pow(n, 2) * Math.pow(c - u, 2) / (Math.pow(c - u, 2) + Math.pow(h - v, 2))) + c;
1635
- a.x < 0 && (y *= -1);
1636
- let E = (y - c) * (h - v) / (c - u) + h;
1637
- return c - u + h === 0 && (E = n), { x: y, y: E };
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
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, c = n[0].y - n[1].y, h = i[1].x - i[0].x, u = 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, E = a * y - c * v, R = h * y - u * v, W = -(v * u - y * h) / (a * u - c * h), K = -(a * y - c * v) / (a * u - c * h);
1644
- if (isFinite(W) && isFinite(K)) return { x: W, y: K };
1645
- if (Math.abs(E - 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), c = Math.abs(i.y - n.y), h = Math.max(a, c), u = [i];
1650
- function v(y, E, R, W, K) {
1651
- return E > y ? y + K * (R / W) : E < 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 <= h; y += 1) u.push({ x: v(i.x, n.x, a, h, y), y: v(i.y, n.y, c, h, y) });
1654
- return u;
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,20 +1731,20 @@ var ai = 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), c = this.render.getRect().pageWidth, h = 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 u = `
1736
+ const g = `
1674
1737
  display: block;
1675
1738
  z-index: ${this.element.style.zIndex};
1676
1739
  left: 0;
1677
1740
  top: 0;
1678
- width: ${c}px;
1679
- height: ${h}px;
1741
+ width: ${l}px;
1742
+ height: ${c}px;
1680
1743
  `;
1681
- n === "hard" ? this.drawHard(u) : this.drawSoft(a, u);
1744
+ n === "hard" ? this.drawHard(g) : this.drawSoft(a, g);
1682
1745
  }
1683
1746
  drawHard(i = "") {
1684
- const n = this.render.getRect().left + this.render.getRect().width / 2, a = this.state.hardDrawingAngle, c = i + `
1747
+ const n = this.render.getRect().left + this.render.getRect().width / 2, a = this.state.hardDrawingAngle, l = i + `
1685
1748
  backface-visibility: hidden;
1686
1749
  -webkit-backface-visibility: hidden;
1687
1750
  clip-path: none;
@@ -1689,26 +1752,26 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1689
1752
  ` + (this.orientation === 0 ? `transform-origin: ${this.render.getRect().pageWidth}px 0;
1690
1753
  transform: translate3d(0, 0, 0) rotateY(${a}deg);` : `transform-origin: 0 0;
1691
1754
  transform: translate3d(${n}px, 0, 0) rotateY(${a}deg);`);
1692
- this.element.style.cssText = c;
1755
+ this.element.style.cssText = l;
1693
1756
  }
1694
1757
  drawSoft(i, n = "") {
1695
1758
  let a = "polygon( ";
1696
- for (const h of this.state.area) if (h !== null) {
1697
- let u = this.render.getDirection() === 1 ? { x: -h.x + this.state.position.x, y: h.y - this.state.position.y } : { x: h.x - this.state.position.x, y: h.y - this.state.position.y };
1698
- u = p.GetRotatedPoint(u, { x: 0, y: 0 }, this.state.angle), a += u.x + "px " + u.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
- const c = 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
- this.element.style.cssText = c;
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);`);
1765
+ this.element.style.cssText = l;
1703
1766
  }
1704
1767
  simpleDraw(i) {
1705
- const n = this.render.getRect(), a = n.pageWidth, c = n.height, h = i === 1 ? n.left + n.pageWidth : n.left, u = 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
- height: ${c}px;
1710
- left: ${h}px;
1711
- top: ${u}px;
1772
+ height: ${l}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,21 +1788,21 @@ var ai = 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 S extends l {
1729
- constructor(i, n, a, c) {
1730
- super(i, n), this.element = a, this.pagesElement = c;
1791
+ class x extends h {
1792
+ constructor(i, n, a, l) {
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 {
1741
- constructor(i, n, a, c) {
1742
- this.direction = i, this.corner = n, this.topIntersectPoint = null, this.sideIntersectPoint = null, this.bottomIntersectPoint = null, this.pageWidth = parseInt(a, 10), this.pageHeight = parseInt(c, 10);
1803
+ class M {
1804
+ constructor(i, n, a, l) {
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
  }
1744
1807
  calc(i) {
1745
1808
  try {
@@ -1798,11 +1861,11 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1798
1861
  }
1799
1862
  calculateAngle(i) {
1800
1863
  const n = this.pageWidth - i.x + 1, a = this.corner === "bottom" ? this.pageHeight - i.y : i.y;
1801
- let c = 2 * Math.acos(n / Math.sqrt(a * a + n * n));
1802
- a < 0 && (c = -c);
1803
- const h = Math.PI - c;
1804
- if (!isFinite(c) || h >= 0 && h < 3e-3) throw new Error("The G point is too small");
1805
- return this.corner === "bottom" && (c = -c), c;
1864
+ let l = 2 * Math.acos(n / Math.sqrt(a * a + n * n));
1865
+ a < 0 && (l = -l);
1866
+ const c = Math.PI - l;
1867
+ if (!isFinite(l) || c >= 0 && c < 3e-3) throw new Error("The G point is too small");
1868
+ return this.corner === "bottom" && (l = -l), l;
1806
1869
  }
1807
1870
  getPageRect(i) {
1808
1871
  return this.corner === "top" ? this.getRectFromBasePoint([{ x: 0, y: 0 }, { x: this.pageWidth, y: 0 }, { x: 0, y: this.pageHeight }, { x: this.pageWidth, y: this.pageHeight }], i) : this.getRectFromBasePoint([{ x: 0, y: -this.pageHeight }, { x: this.pageWidth, y: -this.pageHeight }, { x: 0, y: 0 }, { x: this.pageWidth, y: 0 }], i);
@@ -1818,23 +1881,23 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1818
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
- let c = i;
1822
- const h = p.LimitPointToCircle(n, this.pageWidth, c);
1823
- c !== h && (c = h, this.updateAngleAndGeometry(c));
1824
- const u = 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 E = p.LimitPointToCircle(a, u, y);
1828
- E !== c && (c = E, this.updateAngleAndGeometry(c));
1884
+ let l = i;
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
- return c;
1893
+ return l;
1831
1894
  }
1832
1895
  getSegmentToShadowLine() {
1833
1896
  const i = this.getShadowStartPoint();
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 ai = 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, c = this.calc.getCorner() === "bottom" ? n.height - a : a, h = this.calc.getCorner() === "bottom" ? n.height : 0;
1849
- this.calc.calc({ x: n.pageWidth - a, y: c }), this.animateFlippingTo({ x: n.pageWidth - a, y: c }, { x: -n.pageWidth, y: h }, !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(), c = this.getDirectionByPoint(n), h = n.y >= a.height / 2 ? "bottom" : "top";
1854
- if (!this.checkDirection(c)) return !1;
1916
+ const n = this.render.convertToBook(i), a = this.getBoundsRect(), l = this.getDirectionByPoint(n), c = n.y >= a.height / 2 ? "bottom" : "top";
1917
+ if (!this.checkDirection(l)) return !1;
1855
1918
  try {
1856
- if (this.flippingPage = this.app.getPageCollection().getFlippingPage(c), this.bottomPage = this.app.getPageCollection().getBottomPage(c), this.render.getOrientation() === "landscape") if (c === 1) {
1857
- const u = this.app.getPageCollection().nextBy(this.flippingPage);
1858
- u !== null && this.flippingPage.getDensity() !== u.getDensity() && (this.flippingPage.setDrawingDensity("hard"), u.setDrawingDensity("hard"));
1919
+ if (this.flippingPage = this.app.getPageCollection().getFlippingPage(l), this.bottomPage = this.app.getPageCollection().getBottomPage(l), this.render.getOrientation() === "landscape") if (l === 1) {
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 u = this.app.getPageCollection().prevBy(this.flippingPage);
1861
- u !== null && this.flippingPage.getDensity() !== u.getDensity() && (this.flippingPage.setDrawingDensity("hard"), u.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(c), this.calc = new b(c, h, 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
  }
@@ -1872,9 +1935,9 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
1872
1935
  }
1873
1936
  }
1874
1937
  flipToPage(i, n) {
1875
- const a = this.app.getPageCollection().getCurrentSpreadIndex(), c = this.app.getPageCollection().getSpreadIndexByPage(i);
1938
+ const a = this.app.getPageCollection().getCurrentSpreadIndex(), l = this.app.getPageCollection().getSpreadIndexByPage(i);
1876
1939
  try {
1877
- c > a && (this.app.getPageCollection().setCurrentSpreadIndex(c - 1), this.flipNext(n)), c < a && (this.app.getPageCollection().setCurrentSpreadIndex(c + 1), this.flipPrev(n));
1940
+ l > a && (this.app.getPageCollection().setCurrentSpreadIndex(l - 1), this.flipNext(n)), l < a && (this.app.getPageCollection().setCurrentSpreadIndex(l + 1), this.flipPrev(n));
1878
1941
  } catch {
1879
1942
  }
1880
1943
  }
@@ -1895,17 +1958,17 @@ var ai = 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 c = 50, h = this.calc.getCorner() === "bottom" ? n.height - 1 : 1, u = this.calc.getCorner() === "bottom" ? n.height - c : c;
1899
- this.animateFlippingTo({ x: a - 1, y: h }, { x: a - c, y: u }, !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
- animateFlippingTo(i, n, a, c = !0) {
1904
- const h = p.GetCordsFromTwoPoint(i, n), u = [];
1905
- for (const y of h) u.push(() => this.do(y));
1906
- const v = this.getAnimationDuration(h.length);
1907
- this.render.startAnimation(u, v, () => {
1908
- this.calc && (a && (this.calc.getDirection() === 1 ? this.app.turnToPrevPage() : this.app.turnToNextPage()), c && (this.render.setBottomPage(null), this.render.setFlippingPage(null), this.render.clearShadow(), this.setState("read"), this.reset()));
1966
+ animateFlippingTo(i, n, a, l = !0) {
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, () => {
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
  }
1911
1974
  getCalculation() {
@@ -1942,11 +2005,11 @@ var ai = 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, c = Math.sqrt(Math.pow(a, 2) + Math.pow(n.height, 2)) / 5, h = this.render.convertToBook(i);
1946
- return h.x > 0 && h.y > 0 && h.x < n.width && h.y < n.height && (h.x < c || h.x > n.width - c) && (h.y < c || h.y > n.height - c);
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 ai = 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, c = this.getBlockHeight() / 2, h = this.setting.width / this.setting.height;
1983
- let u = this.setting.width, v = this.setting.height, y = a - u;
1984
- return this.setting.size === "stretch" ? (n < 2 * this.setting.minWidth && this.app.getSettings().usePortrait && (i = "portrait"), u = i === "portrait" ? this.getBlockWidth() : this.getBlockWidth() / 2, u > this.setting.maxWidth && (u = this.setting.maxWidth), v = u / h, v > this.getBlockHeight() && (v = this.getBlockHeight(), u = v * h), y = i === "portrait" ? a - u / 2 - u : a - u) : n < 2 * u && this.app.getSettings().usePortrait && (i = "portrait", y = a - u / 2 - u), this.boundsRect = { left: y, top: c - v / 2, width: 2 * u, height: v, pageWidth: u }, 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
- setShadowData(i, n, a, c) {
2049
+ setShadowData(i, n, a, l) {
1987
2050
  if (!this.app.getSettings().drawShadow) return;
1988
- const h = 100 * this.getSettings().maxShadowOpacity;
1989
- this.shadow = { pos: i, angle: n, width: 3 * this.getRect().pageWidth / 4 * a / 100, opacity: (100 - a) * h / 100 / 100, direction: c, 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 ai = 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 k 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
  }
@@ -2069,8 +2132,8 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2069
2132
  this.ctx.rect(i.left, i.top, i.width, i.height);
2070
2133
  const a = { x: i.left + i.width / 2 - n / 2, y: 0 };
2071
2134
  this.ctx.translate(a.x, a.y);
2072
- const c = this.ctx.createLinearGradient(0, 0, n, 0);
2073
- c.addColorStop(0, "rgba(0, 0, 0, 0)"), c.addColorStop(0.4, "rgba(0, 0, 0, 0.2)"), c.addColorStop(0.49, "rgba(0, 0, 0, 0.1)"), c.addColorStop(0.5, "rgba(0, 0, 0, 0.5)"), c.addColorStop(0.51, "rgba(0, 0, 0, 0.4)"), c.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.clip(), this.ctx.fillStyle = c, this.ctx.fillRect(0, 0, n, 2 * i.height), this.ctx.restore();
2135
+ const l = this.ctx.createLinearGradient(0, 0, n, 0);
2136
+ l.addColorStop(0, "rgba(0, 0, 0, 0)"), l.addColorStop(0.4, "rgba(0, 0, 0, 0.2)"), l.addColorStop(0.49, "rgba(0, 0, 0, 0.1)"), l.addColorStop(0.5, "rgba(0, 0, 0, 0.5)"), l.addColorStop(0.51, "rgba(0, 0, 0, 0.4)"), l.addColorStop(1, "rgba(0, 0, 0, 0)"), this.ctx.clip(), this.ctx.fillStyle = l, this.ctx.fillRect(0, 0, n, 2 * i.height), this.ctx.restore();
2074
2137
  }
2075
2138
  drawOuterShadow() {
2076
2139
  const i = this.getRect();
@@ -2085,53 +2148,53 @@ var ai = 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 c = 3 * this.shadow.width / 4, h = this.ctx.createLinearGradient(0, 0, c, 0);
2089
- this.shadow.direction === 0 ? (this.ctx.translate(-c, -100), h.addColorStop(1, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), h.addColorStop(0.9, "rgba(0, 0, 0, 0.05)"), h.addColorStop(0.7, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), h.addColorStop(0, "rgba(0, 0, 0, 0)")) : (this.ctx.translate(0, -100), h.addColorStop(0, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), h.addColorStop(0.1, "rgba(0, 0, 0, 0.05)"), h.addColorStop(0.3, "rgba(0, 0, 0, " + this.shadow.opacity + ")"), h.addColorStop(1, "rgba(0, 0, 0, 0)")), this.ctx.clip(), this.ctx.fillStyle = h, this.ctx.fillRect(0, 0, c, 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 A {
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 = (h) => {
2100
- if (this.checkTarget(h.target)) {
2101
- const u = this.getMousePos(h.clientX, h.clientY);
2102
- this.app.startUserTouch(u), h.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 = (h) => {
2105
- if (this.checkTarget(h.target) && h.changedTouches.length > 0) {
2106
- const u = h.changedTouches[0], v = this.getMousePos(u.clientX, u.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 || h.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 = (h) => {
2112
- const u = this.getMousePos(h.clientX, h.clientY);
2113
- this.app.userStop(u);
2114
- }, this.onMouseMove = (h) => {
2115
- const u = this.getMousePos(h.clientX, h.clientY);
2116
- this.app.userMove(u, !1);
2117
- }, this.onTouchMove = (h) => {
2118
- if (h.changedTouches.length > 0) {
2119
- const u = h.changedTouches[0], v = this.getMousePos(u.clientX, u.clientY);
2120
- this.app.getSettings().mobileScrollSupport ? (this.touchPoint !== null && (Math.abs(this.touchPoint.point.x - v.x) > 10 || this.app.getState() !== "read") && h.cancelable && this.app.userMove(v, !0), this.app.getState() !== "read" && h.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 = (h) => {
2123
- if (h.changedTouches.length > 0) {
2124
- const u = h.changedTouches[0], v = this.getMousePos(u.clientX, u.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 E = v.x - this.touchPoint.point.x, R = Math.abs(v.y - this.touchPoint.point.y);
2128
- Math.abs(E) > this.swipeDistance && R < 2 * this.swipeDistance && Date.now() - this.touchPoint.time < this.swipeTimeout && (E > 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
- const c = this.app.getSettings().usePortrait ? 1 : 2;
2134
- i.style.minWidth = a.minWidth * c + "px", i.style.minHeight = a.minHeight + "px", a.size === "fixed" && (i.style.minWidth = a.width * c + "px", i.style.minHeight = a.height + "px"), a.autoSize && (i.style.width = "100%", i.style.maxWidth = 2 * a.maxWidth + "px"), i.style.display = "block", window.addEventListener("resize", this.onResize, !1), this.swipeDistance = a.swipeDistance;
2196
+ const l = this.app.getSettings().usePortrait ? 1 : 2;
2197
+ i.style.minWidth = a.minWidth * l + "px", i.style.minHeight = a.minHeight + "px", a.size === "fixed" && (i.style.minWidth = a.width * l + "px", i.style.minHeight = a.height + "px"), a.autoSize && (i.style.width = "100%", i.style.maxWidth = 2 * a.maxWidth + "px"), i.style.display = "block", window.addEventListener("resize", this.onResize, !1), this.swipeDistance = a.swipeDistance;
2135
2198
  }
2136
2199
  destroy() {
2137
2200
  this.app.getSettings().useMouseEvents && this.removeHandlers(), this.distElement.remove(), this.wrapper.remove();
@@ -2159,10 +2222,10 @@ var ai = 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 O extends A {
2163
- constructor(i, n, a, c) {
2164
- super(i, n, a), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = i.querySelector(".stf__block"), this.items = c;
2165
- for (const h of c) this.distElement.appendChild(h);
2225
+ class W extends E {
2226
+ constructor(i, n, a, l) {
2227
+ super(i, n, a), this.wrapper.insertAdjacentHTML("afterbegin", '<div class="stf__block"></div>'), this.distElement = i.querySelector(".stf__block"), this.items = l;
2228
+ for (const c of l) this.distElement.appendChild(c);
2166
2229
  this.setHandlers();
2167
2230
  }
2168
2231
  clear() {
@@ -2177,7 +2240,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2177
2240
  this.app.getRender().update();
2178
2241
  }
2179
2242
  }
2180
- class U extends A {
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 ai = 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
  }
@@ -2212,7 +2275,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2212
2275
  const i = this.getRect(), n = this.shadow.progress > 100 ? 200 - this.shadow.progress : this.shadow.progress;
2213
2276
  let a = (100 - n) * (2.5 * i.pageWidth) / 100 + 20;
2214
2277
  a > i.pageWidth && (a = i.pageWidth);
2215
- let c = `
2278
+ let l = `
2216
2279
  display: block;
2217
2280
  z-index: ${(this.getSettings().startZIndex + 5).toString(10)};
2218
2281
  width: ${a}px;
@@ -2223,7 +2286,7 @@ var ai = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
2223
2286
  left: ${i.left + i.width / 2}px;
2224
2287
  transform-origin: 0 0;
2225
2288
  `;
2226
- c += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0);" : "transform: translate3d(0, 0, 0) rotateY(180deg);", this.hardInnerShadow.style.cssText = c;
2289
+ l += this.getDirection() === 0 && this.shadow.progress > 100 || this.getDirection() === 1 && this.shadow.progress <= 100 ? "transform: translate3d(0, 0, 0);" : "transform: translate3d(0, 0, 0) rotateY(180deg);", this.hardInnerShadow.style.cssText = l;
2227
2290
  }
2228
2291
  drawHardOuterShadow() {
2229
2292
  const i = this.getRect();
@@ -2241,50 +2304,50 @@ var ai = 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, c = this.getDirection() === 0 ? "to left" : "to right", h = this.convertToGlobal(this.shadow.pos), u = 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 = p.GetRotatedPoint(W, { x: a, y: 100 }, u), 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 E = `
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;
2255
2318
  height: ${2 * i.height}px;
2256
- background: linear-gradient(${c},
2319
+ background: linear-gradient(${l},
2257
2320
  rgba(0, 0, 0, ${this.shadow.opacity}) 5%,
2258
2321
  rgba(0, 0, 0, 0.05) 15%,
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(${h.x - a}px, ${h.y - 100}px, 0) rotate(${u}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 = E;
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, c = this.getDirection() === 1 ? this.shadow.width : 0, h = this.getDirection() === 0 ? "to right" : "to left", u = [{ 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 E of u) if (E !== null) {
2272
- let R = this.getDirection() === 1 ? { x: -E.x + this.shadow.pos.x, y: E.y - this.shadow.pos.y } : { x: E.x - this.shadow.pos.x, y: E.y - this.shadow.pos.y };
2273
- R = p.GetRotatedPoint(R, { x: c, 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(${h}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
2282
- transform-origin: ${c}px 100px;
2283
- transform: translate3d(${n.x - c}px, ${n.y - 100}px, 0) rotate(${a}rad);
2284
- clip-path: ${v};
2285
- -webkit-clip-path: ${v};
2344
+ background: linear-gradient(${c}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
2345
+ transform-origin: ${l}px 100px;
2346
+ transform: translate3d(${n.x - l}px, ${n.y - 100}px, 0) rotate(${a}rad);
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 ai = 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 ai = 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
- var a = document.head || document.getElementsByTagName("head")[0], c = document.createElement("style");
2327
- c.type = "text/css", n === "top" && a.firstChild ? a.insertBefore(c, a.firstChild) : a.appendChild(c), c.styleSheet ? c.styleSheet.cssText = f : c.appendChild(document.createTextNode(f));
2389
+ var a = document.head || document.getElementsByTagName("head")[0], l = document.createElement("style");
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 ai = 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 ai = 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) {
2413
- this.ui = new U(this.block, this, this.setting);
2475
+ loadFromImages(m) {
2476
+ this.ui = new B(this.block, this, this.setting);
2414
2477
  const i = this.ui.getCanvas();
2415
- this.render = new k(this, this.setting, i), this.flipController = new D(this.render, this), this.pages = new d(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 O(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 S(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 d(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 S(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 ai = 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 ai = 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 ai = 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 && p.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 hi = Dt.exports;
2570
+ var gi = Dt.exports;
2508
2571
  /**
2509
- * @license FlipbookEngine v0.2.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,23 +2582,24 @@ var hi = Dt.exports;
2519
2582
  * you must purchase a Commercial License from:
2520
2583
  * https://flipbookengine.com/pricing
2521
2584
  */
2522
- function li() {
2585
+ function pi() {
2523
2586
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2524
2587
  }
2525
- function ci(e, t = li()) {
2588
+ function fi(e, t = pi()) {
2526
2589
  return t ? 0 : typeof e == "number" && e >= 0 ? e : 1e3;
2527
2590
  }
2528
- class di {
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);
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);
2539
2603
  this.bookContainer = t, this.options = s, this.store = o, s.soundUrl && (this.audioEl = new Audio(s.soundUrl), this.unlockAudio());
2540
2604
  }
2541
2605
  unlockAudio() {
@@ -2553,7 +2617,7 @@ class di {
2553
2617
  this.audioUnlockHandler = t, document.addEventListener("touchstart", t, { once: !0 }), document.addEventListener("click", t, { once: !0 });
2554
2618
  }
2555
2619
  init(t, s) {
2556
- this.pageFlip = new hi.PageFlip(this.bookContainer, {
2620
+ this.pageFlip = new gi.PageFlip(this.bookContainer, {
2557
2621
  width: t,
2558
2622
  height: s,
2559
2623
  size: "stretch",
@@ -2566,7 +2630,7 @@ class di {
2566
2630
  usePortrait: !0,
2567
2631
  mobileScrollSupport: !1,
2568
2632
  maxShadowOpacity: this.options.maxShadowOpacity || 0.5,
2569
- flippingTime: ci(this.options.flippingTime)
2633
+ flippingTime: fi(this.options.flippingTime)
2570
2634
  });
2571
2635
  const o = this.bookContainer.querySelectorAll(".bz-page");
2572
2636
  this.pageFlip.loadFromHTML(Array.from(o)), this.bindEvents(), this.setupSignalSync();
@@ -2582,23 +2646,23 @@ class di {
2582
2646
  }
2583
2647
  setupSignalSync() {
2584
2648
  this.unsubs.push(
2585
- _(() => {
2649
+ G(() => {
2586
2650
  const t = this.store.currentPage.value, s = this.store.flipState.peek();
2587
2651
  if (!this.pageFlip || this.isLibraryFlipping || s !== "read") return;
2588
2652
  const o = this.pageFlip.getCurrentPageIndex();
2589
2653
  if (o !== t && !this.store.isSingleMode.value) {
2590
- const r = (p) => p === 0 ? 0 : Math.ceil(p / 2), l = r(t), d = r(o);
2591
- l === d + 1 ? this.pageFlip.flipNext() : l === d - 1 ? this.pageFlip.flipPrev() : l !== d && this.pageFlip.turnToPage(t);
2654
+ const r = (p) => p === 0 ? 0 : Math.ceil(p / 2), h = r(t), u = r(o);
2655
+ h === u + 1 ? this.pageFlip.flipNext() : h === u - 1 ? this.pageFlip.flipPrev() : h !== u && this.pageFlip.turnToPage(t);
2592
2656
  }
2593
2657
  })
2594
2658
  ), this.unsubs.push(
2595
- _(() => {
2596
- this.store.isSingleMode.value, this.pageFlip && setTimeout(() => {
2597
- this.pageFlip && this.pageFlip.update(), window.dispatchEvent(new Event("resize"));
2598
- }, 50);
2659
+ G(() => {
2660
+ this.store.isSingleMode.value, this.pageFlip && (this.layoutUpdateTimer && clearTimeout(this.layoutUpdateTimer), this.layoutUpdateTimer = setTimeout(() => {
2661
+ this.layoutUpdateTimer = null, this.pageFlip && this.pageFlip.update(), window.dispatchEvent(new Event("resize"));
2662
+ }, 50));
2599
2663
  })
2600
2664
  ), this.unsubs.push(
2601
- _(() => {
2665
+ G(() => {
2602
2666
  const t = this.store.isAutoPlaying.value, s = this.store.autoPlayInterval.value || 3e3;
2603
2667
  this.autoPlayTimer && (clearInterval(this.autoPlayTimer), this.autoPlayTimer = null), t && (this.autoPlayTimer = setInterval(() => {
2604
2668
  const o = this.store.pages.value.length - 1;
@@ -2631,14 +2695,14 @@ class di {
2631
2695
  }
2632
2696
  }
2633
2697
  update() {
2634
- this.pageFlip && this.pageFlip.update();
2698
+ this.pageFlip && this.pageFlip.update(), this.layoutUpdateTimer && (clearTimeout(this.layoutUpdateTimer), this.layoutUpdateTimer = null);
2635
2699
  }
2636
2700
  destroy() {
2637
2701
  this.autoPlayTimer && (clearInterval(this.autoPlayTimer), this.autoPlayTimer = null), this.audioUnlockHandler && (document.removeEventListener("touchstart", this.audioUnlockHandler), document.removeEventListener("click", this.audioUnlockHandler), this.audioUnlockHandler = null), this.unsubs.forEach((t) => t()), this.unsubs = [], this.pageFlip && (this.pageFlip.destroy(), this.pageFlip = null);
2638
2702
  }
2639
2703
  }
2640
2704
  /**
2641
- * @license FlipbookEngine v0.2.4
2705
+ * @license FlipbookEngine v0.6.0
2642
2706
  * Copyright (c) 2026 Murat Dogan
2643
2707
  *
2644
2708
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -2651,17 +2715,18 @@ class di {
2651
2715
  * you must purchase a Commercial License from:
2652
2716
  * https://flipbookengine.com/pricing
2653
2717
  */
2654
- class ui {
2718
+ class wi {
2655
2719
  constructor(t, s) {
2656
- m(this, "wrapperElement", null);
2657
- m(this, "sizerElement", null);
2658
- m(this, "pageViewport");
2659
- m(this, "store");
2660
- m(this, "resizeObserver", null);
2661
- m(this, "orientationMediaQuery", null);
2662
- m(this, "orientationChangeHandler", null);
2663
- m(this, "unsubs", []);
2664
- 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");
2665
2730
  this.pageViewport = t, this.store = s;
2666
2731
  }
2667
2732
  init(t, s) {
@@ -2669,8 +2734,8 @@ class ui {
2669
2734
  }
2670
2735
  setupStateSync() {
2671
2736
  this.unsubs.push(
2672
- _(() => {
2673
- this.store.isSingleMode.value, this.store.orientation.value, setTimeout(() => this.updateBookAspectRatio(), 10);
2737
+ G(() => {
2738
+ this.store.isSingleMode.value, this.store.orientation.value, this.scheduleAspectRatioUpdate();
2674
2739
  })
2675
2740
  );
2676
2741
  }
@@ -2692,18 +2757,23 @@ class ui {
2692
2757
  if (!this.wrapperElement || !this.sizerElement) return;
2693
2758
  const t = this.wrapperElement.clientWidth, s = this.wrapperElement.clientHeight;
2694
2759
  if (t === 0 || s === 0) return;
2695
- const o = this.pageViewport.width, r = this.pageViewport.height, d = this.store.isDoublePageLayout.value ? o * 2 / r : o / r;
2696
- let p = t, x = t / d;
2697
- x > s && (x = s, p = s * d);
2698
- let S = Math.ceil(p);
2699
- S % 2 !== 0 && (S += 1), this.sizerElement.style.width = `${S}px`, this.sizerElement.style.height = `${Math.floor(x)}px`, this.sizerElement.style.aspectRatio = "", this.onResizeCallback && this.onResizeCallback();
2760
+ const o = this.pageViewport.width, r = this.pageViewport.height, u = this.store.isDoublePageLayout.value ? o * 2 / r : o / r;
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();
2700
2765
  }
2701
2766
  destroy() {
2702
- 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);
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);
2768
+ }
2769
+ scheduleAspectRatioUpdate() {
2770
+ this.updateTimer && clearTimeout(this.updateTimer), this.updateTimer = setTimeout(() => {
2771
+ this.updateTimer = null, this.updateBookAspectRatio();
2772
+ }, 10);
2703
2773
  }
2704
2774
  }
2705
2775
  /**
2706
- * @license FlipbookEngine v0.2.4
2776
+ * @license FlipbookEngine v0.6.0
2707
2777
  * Copyright (c) 2026 Murat Dogan
2708
2778
  *
2709
2779
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -2716,17 +2786,17 @@ class ui {
2716
2786
  * you must purchase a Commercial License from:
2717
2787
  * https://flipbookengine.com/pricing
2718
2788
  */
2719
- class gi {
2789
+ class vi {
2720
2790
  constructor(t, s, o) {
2721
- m(this, "container");
2722
- m(this, "pageFlipAdapter");
2723
- m(this, "store");
2724
- m(this, "touchStartX", null);
2725
- m(this, "unsubs", []);
2726
- m(this, "listenerAbortController");
2727
- var l;
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");
2797
+ var h;
2728
2798
  this.container = t, this.pageFlipAdapter = s, this.store = o;
2729
- const r = ((l = t.ownerDocument.defaultView) == null ? void 0 : l.AbortController) ?? globalThis.AbortController;
2799
+ const r = ((h = t.ownerDocument.defaultView) == null ? void 0 : h.AbortController) ?? globalThis.AbortController;
2730
2800
  this.listenerAbortController = new r();
2731
2801
  }
2732
2802
  init() {
@@ -2734,7 +2804,7 @@ class gi {
2734
2804
  }
2735
2805
  setupStateSync() {
2736
2806
  this.unsubs.push(
2737
- _(() => {
2807
+ G(() => {
2738
2808
  this.store.isZoomed.value = this.store.zoomState.value.isActive, this.store.zoomState.value.isActive ? (this.container.style.transform = `translate(${this.store.zoomState.value.translateX}px, ${this.store.zoomState.value.translateY}px) scale(${this.store.zoomState.value.scale})`, this.container.style.transition = "none") : (this.container.style.transform = "", this.container.style.transition = "transform 0.3s ease");
2739
2809
  })
2740
2810
  );
@@ -2748,13 +2818,13 @@ class gi {
2748
2818
  }, { passive: !1, signal: this.listenerAbortController.signal });
2749
2819
  }
2750
2820
  bindMouseDrag() {
2751
- let t = !1, s = 0, o = 0, r = 0, l = 0;
2752
- this.container.addEventListener("mousedown", (d) => {
2753
- this.store.zoomState.value.isActive && (t = !0, s = d.clientX, o = d.clientY, r = this.store.zoomState.value.translateX, l = this.store.zoomState.value.translateY, this.container.style.cursor = "grabbing");
2754
- }, { signal: this.listenerAbortController.signal }), window.addEventListener("mousemove", (d) => {
2821
+ let t = !1, s = 0, o = 0, r = 0, h = 0;
2822
+ this.container.addEventListener("mousedown", (u) => {
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");
2824
+ }, { signal: this.listenerAbortController.signal }), window.addEventListener("mousemove", (u) => {
2755
2825
  if (!t || !this.store.zoomState.value.isActive) return;
2756
- const p = d.clientX - s, x = d.clientY - o;
2757
- this.updateZoomPan(r + p, l + x);
2826
+ const p = u.clientX - s, b = u.clientY - o;
2827
+ this.updateZoomPan(r + p, h + b);
2758
2828
  }, { signal: this.listenerAbortController.signal }), window.addEventListener("mouseup", () => {
2759
2829
  t && (t = !1, this.container.style.cursor = this.store.zoomState.value.isActive ? "grab" : "");
2760
2830
  }, { signal: this.listenerAbortController.signal });
@@ -2767,19 +2837,19 @@ class gi {
2767
2837
  this.touchStartX = r.touches[0].clientX;
2768
2838
  else {
2769
2839
  t = !0, this.touchStartX = r.touches[0].clientX;
2770
- const l = r.touches[0].clientY;
2771
- s = this.store.zoomState.value.translateX, o = this.store.zoomState.value.translateY, this.container._touchStartY = l;
2840
+ const h = r.touches[0].clientY;
2841
+ s = this.store.zoomState.value.translateX, o = this.store.zoomState.value.translateY, this.container._touchStartY = h;
2772
2842
  }
2773
2843
  }, { passive: !0, signal: this.listenerAbortController.signal }), this.container.addEventListener("touchmove", (r) => {
2774
2844
  if (t && this.store.zoomState.value.isActive && r.touches.length === 1 && this.touchStartX !== null) {
2775
2845
  r.preventDefault();
2776
- const l = r.touches[0].clientX - this.touchStartX, d = r.touches[0].clientY - this.container._touchStartY;
2777
- this.updateZoomPan(s + l, o + d);
2846
+ const h = r.touches[0].clientX - this.touchStartX, u = r.touches[0].clientY - this.container._touchStartY;
2847
+ this.updateZoomPan(s + h, o + u);
2778
2848
  }
2779
2849
  }, { passive: !1, signal: this.listenerAbortController.signal }), this.container.addEventListener("touchend", (r) => {
2780
2850
  if (this.touchStartX !== null && !this.store.zoomState.value.isActive && this.store.isSingleMode.value && r.changedTouches.length === 1) {
2781
- const l = r.changedTouches[0].clientX - this.touchStartX;
2782
- l > 50 && this.store.currentPage.value > 0 ? this.pageFlipAdapter.turnToPrevPage() : l < -50 && this.store.currentPage.value < this.store.totalPages.value - 1 && this.pageFlipAdapter.turnToNextPage();
2851
+ const h = r.changedTouches[0].clientX - this.touchStartX;
2852
+ h > 50 && this.store.currentPage.value > 0 ? this.pageFlipAdapter.turnToPrevPage() : h < -50 && this.store.currentPage.value < this.store.totalPages.value - 1 && this.pageFlipAdapter.turnToNextPage();
2783
2853
  }
2784
2854
  this.touchStartX = null, t = !1;
2785
2855
  }, { passive: !0, signal: this.listenerAbortController.signal });
@@ -2807,99 +2877,116 @@ class gi {
2807
2877
  this.listenerAbortController.abort(), this.unsubs.forEach((t) => t()), this.unsubs = [];
2808
2878
  }
2809
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
+ }
2810
2893
  /**
2811
- * @license FlipbookEngine v0.2.4
2894
+ * @license FlipbookEngine v0.6.0
2812
2895
  * Copyright (c) 2026 Murat Dogan
2813
2896
  *
2814
2897
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
2815
2898
  */
2816
- const pi = () => ({ isActive: !1, translateX: 0, translateY: 0, isDragging: !1, scale: 1 });
2817
- function fe() {
2818
- const e = M(0), t = M(0), s = M(!1), o = M(!0), r = M(!0), l = M("landscape"), d = M("read"), p = M("auto"), x = M(!0), S = M(!1), b = M("#7367f0"), D = M(!1), $ = M(!1), k = M(!1), A = M(3e3), O = M(!0), U = M("en"), H = M({}), N = M(pi()), f = M([]), i = w(() => !s.value && l.value === "landscape"), n = w(() => i.value && e.value === 0), a = w(() => i.value && e.value >= t.value - 1);
2819
- return { currentPage: e, totalPages: t, isSingleMode: s, showThumbs: o, showArrows: r, orientation: l, flipState: d, themeMode: p, allowDownload: x, hasDownloadUrl: S, primaryColor: b, whiteLabel: D, isZoomed: $, isAutoPlaying: k, autoPlayInterval: A, soundEnabled: O, locale: U, messages: H, zoomState: N, pages: f, isDoublePageLayout: i, isFrontCover: n, isBackCover: a, init: (h, u, v, y) => {
2820
- t.value = u, f.value = v, S.value = y, h.theme !== void 0 && (p.value = h.theme), h.primaryColor !== void 0 && (b.value = h.primaryColor), h.showThumbs !== void 0 && (o.value = h.showThumbs), h.showArrows !== void 0 && (r.value = h.showArrows), h.allowDownload !== void 0 && (x.value = h.allowDownload), h.whiteLabel !== void 0 && (D.value = h.whiteLabel), h.soundEnabled !== void 0 && (O.value = h.soundEnabled), h.locale !== void 0 && (U.value = h.locale), h.messages !== void 0 && (H.value = h.messages), h.isSingleMode !== void 0 && (s.value = h.isSingleMode), h.singleMode !== void 0 && (s.value = h.singleMode), h.autoPlay !== void 0 && (k.value = h.autoPlay), h.autoPlayInterval !== void 0 && (A.value = h.autoPlayInterval), e.value = 0;
2899
+ const Kt = () => ({ isActive: !1, translateX: 0, translateY: 0, isDragging: !1, scale: 1 });
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;
2904
+ }, reset: () => {
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 = [];
2821
2906
  } };
2822
2907
  }
2823
- const T = fe();
2824
- T.currentPage;
2825
- T.totalPages;
2826
- T.isSingleMode;
2827
- T.showThumbs;
2828
- T.showArrows;
2829
- T.orientation;
2830
- T.flipState;
2831
- T.themeMode;
2832
- T.allowDownload;
2833
- T.hasDownloadUrl;
2834
- T.primaryColor;
2835
- T.whiteLabel;
2836
- T.isZoomed;
2837
- T.isAutoPlaying;
2838
- T.autoPlayInterval;
2839
- T.soundEnabled;
2840
- T.locale;
2841
- T.messages;
2842
- T.zoomState;
2843
- T.pages;
2844
- T.isDoublePageLayout;
2845
- T.isFrontCover;
2846
- T.isBackCover;
2847
- 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) {
2848
2935
  if (!e || typeof e != "object") return !1;
2849
2936
  const t = e;
2850
2937
  return typeof t.normal == "string" && typeof t.low == "string" && typeof t.thumb == "string";
2851
2938
  }
2852
- function mi(e) {
2939
+ function bi(e) {
2853
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] : [];
2854
2941
  }
2855
- function wi(e) {
2942
+ function xi(e) {
2856
2943
  return e === "rtl" ? ["right", "left"] : ["left", "right"];
2857
2944
  }
2858
- function vi(e) {
2945
+ function Pi(e) {
2859
2946
  const t = [];
2860
2947
  let s = 1;
2861
2948
  return e.forEach((o, r) => {
2862
- const l = o.kind ?? "single", d = o.id ?? `asset-${r}`, p = o.splitDirection ?? "ltr", x = mi(o);
2863
- if (l === "spread") {
2864
- const b = x.length >= 2 ? x.slice(0, 2) : [s, s + 1], D = wi(p);
2865
- b.forEach(($, k) => {
2949
+ const h = o.kind ?? "single", u = o.id ?? `asset-${r}`, p = o.splitDirection ?? "ltr", b = bi(o);
2950
+ if (h === "spread") {
2951
+ const M = b.length >= 2 ? b.slice(0, 2) : [s, s + 1], I = xi(p);
2952
+ M.forEach((S, T) => {
2866
2953
  t.push({
2867
2954
  index: t.length,
2868
- assetId: d,
2869
- pageNumber: $,
2870
- cropMode: D[k] ?? "full",
2955
+ assetId: u,
2956
+ pageNumber: S,
2957
+ cropMode: I[T] ?? "full",
2871
2958
  normal: o.normal,
2872
2959
  low: o.low,
2873
2960
  thumb: o.thumb
2874
2961
  });
2875
- }), s = b[b.length - 1] + 1;
2962
+ }), s = M[M.length - 1] + 1;
2876
2963
  return;
2877
2964
  }
2878
- const S = x[0] ?? s;
2965
+ const x = b[0] ?? s;
2879
2966
  t.push({
2880
2967
  index: t.length,
2881
- assetId: d,
2882
- pageNumber: S,
2968
+ assetId: u,
2969
+ pageNumber: x,
2883
2970
  cropMode: "full",
2884
2971
  normal: o.normal,
2885
2972
  low: o.low,
2886
2973
  thumb: o.thumb
2887
- }), s = S + 1;
2974
+ }), s = x + 1;
2888
2975
  }), t;
2889
2976
  }
2890
- function Kt(e, t) {
2977
+ function Jt(e, t) {
2891
2978
  e.classList.add("bk-container"), e.classList.remove("bk-theme-light", "bk-theme-dark"), t.theme === "light" && e.classList.add("bk-theme-light"), t.theme === "dark" && e.classList.add("bk-theme-dark"), t.primaryColor && e.style.setProperty("--flipbook-accent", t.primaryColor);
2892
2979
  const s = t.cssVariables ?? {};
2893
2980
  Object.entries(s).forEach(([o, r]) => {
2894
- const l = o.startsWith("--") ? o : `--${o}`;
2895
- e.style.setProperty(l, r);
2981
+ const h = o.startsWith("--") ? o : `--${o}`;
2982
+ e.style.setProperty(h, r);
2896
2983
  });
2897
2984
  }
2898
- class yi {
2985
+ class Si {
2899
2986
  constructor(t = 32) {
2900
- m(this, "entries", /* @__PURE__ */ new Map());
2901
- m(this, "hits", 0);
2902
- m(this, "misses", 0);
2987
+ v(this, "entries", /* @__PURE__ */ new Map());
2988
+ v(this, "hits", 0);
2989
+ v(this, "misses", 0);
2903
2990
  if (this.maxEntries = t, !Number.isInteger(t) || t < 0)
2904
2991
  throw new RangeError("PDF render cache size must be a non-negative integer.");
2905
2992
  }
@@ -2929,12 +3016,12 @@ class yi {
2929
3016
  return { size: this.size, maxEntries: this.maxEntries, hits: this.hits, misses: this.misses };
2930
3017
  }
2931
3018
  }
2932
- class bi {
3019
+ class Ti {
2933
3020
  constructor(t = {}) {
2934
- m(this, "pdfDoc", null);
2935
- m(this, "loadingTask", null);
2936
- m(this, "options");
2937
- m(this, "cache");
3021
+ v(this, "pdfDoc", null);
3022
+ v(this, "loadingTask", null);
3023
+ v(this, "options");
3024
+ v(this, "cache");
2938
3025
  const s = Number.isFinite(t.cacheSize) ? Math.max(0, Math.floor(t.cacheSize)) : 32;
2939
3026
  this.options = {
2940
3027
  scale: t.scale || 1.5,
@@ -2943,7 +3030,7 @@ class bi {
2943
3030
  workerSrc: t.workerSrc || "",
2944
3031
  concurrency: Math.max(1, Math.floor(t.concurrency || 3)),
2945
3032
  cacheSize: s
2946
- }, 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);
2947
3034
  }
2948
3035
  /** Loads a PDF document and cancels PDF.js loading when the signal aborts. */
2949
3036
  async loadDocument(t, s) {
@@ -2951,14 +3038,14 @@ class bi {
2951
3038
  const o = Bt.getDocument(t);
2952
3039
  this.loadingTask = o;
2953
3040
  const r = () => {
2954
- var l;
2955
- return (l = o.destroy) == null ? void 0 : l.call(o);
3041
+ var h;
3042
+ return (h = o.destroy) == null ? void 0 : h.call(o);
2956
3043
  };
2957
3044
  s == null || s.addEventListener("abort", r, { once: !0 });
2958
3045
  try {
2959
3046
  return this.pdfDoc = await o.promise, this.throwIfAborted(s), this.pdfDoc.numPages;
2960
- } catch (l) {
2961
- throw s != null && s.aborted ? this.createAbortError() : l;
3047
+ } catch (h) {
3048
+ throw s != null && s.aborted ? this.createAbortError() : h;
2962
3049
  } finally {
2963
3050
  s == null || s.removeEventListener("abort", r), this.loadingTask === o && (this.loadingTask = null);
2964
3051
  }
@@ -2972,28 +3059,27 @@ class bi {
2972
3059
  try {
2973
3060
  const r = await this.pdfDoc.getPage(t);
2974
3061
  this.throwIfAborted(s);
2975
- const l = r.getViewport({ scale: this.options.scale }), d = document.createElement("canvas");
2976
- d.width = l.width, d.height = l.height;
2977
- const p = d.getContext("2d");
3062
+ const h = r.getViewport({ scale: this.options.scale }), u = document.createElement("canvas");
3063
+ u.width = h.width, u.height = h.height;
3064
+ const p = u.getContext("2d");
2978
3065
  if (p) {
2979
- const x = r.render({ canvasContext: p, viewport: l }), S = () => {
2980
- var D;
2981
- return (D = x.cancel) == null ? void 0 : D.call(x);
3066
+ const b = r.render({ canvasContext: p, viewport: h }), x = () => {
3067
+ var I;
3068
+ return (I = b.cancel) == null ? void 0 : I.call(b);
2982
3069
  };
2983
- s == null || s.addEventListener("abort", S, { once: !0 });
3070
+ s == null || s.addEventListener("abort", x, { once: !0 });
2984
3071
  try {
2985
- await x.promise, this.throwIfAborted(s);
3072
+ await b.promise, this.throwIfAborted(s);
2986
3073
  } finally {
2987
- s == null || s.removeEventListener("abort", S);
3074
+ s == null || s.removeEventListener("abort", x);
2988
3075
  }
2989
- const b = d.toDataURL(this.options.format, this.options.quality);
2990
- 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;
2991
3078
  }
3079
+ throw new Error("Unable to create a PDF canvas rendering context.");
2992
3080
  } catch (r) {
2993
- if (s != null && s.aborted) throw this.createAbortError();
2994
- console.error(`PDF page ${t} render error:`, r);
3081
+ throw s != null && s.aborted ? this.createAbortError() : r;
2995
3082
  }
2996
- return "";
2997
3083
  }
2998
3084
  /** Calculates the best viewport dimensions based on the first page. */
2999
3085
  async calculateViewportDimensions(t = 420) {
@@ -3006,25 +3092,25 @@ class bi {
3006
3092
  if (!this.pdfDoc) return [];
3007
3093
  this.throwIfAborted(t);
3008
3094
  const o = this.pdfDoc.numPages, r = new Array(o);
3009
- let l = 1, d = 0;
3095
+ let h = 1, u = 0;
3010
3096
  const p = async () => {
3011
3097
  for (; ; ) {
3012
3098
  this.throwIfAborted(t);
3013
- const S = l++;
3014
- if (S > o) return;
3015
- const b = await this.renderPageToDataUrl(S, t);
3016
- r[S - 1] = {
3017
- index: S - 1,
3018
- assetId: `pdf-page-${S}`,
3019
- pageNumber: S,
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,
3020
3106
  cropMode: "full",
3021
- normal: b,
3022
- low: b,
3023
- thumb: b
3024
- }, d++, s == null || s({ completed: d, total: o });
3107
+ normal: M,
3108
+ low: M,
3109
+ thumb: M
3110
+ }, u++, s == null || s({ completed: u, total: o });
3025
3111
  }
3026
- }, x = Math.min(this.options.concurrency, o);
3027
- return await Promise.all(Array.from({ length: x }, () => p())), 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;
3028
3114
  }
3029
3115
  getCacheStats() {
3030
3116
  return this.cache.getStats();
@@ -3042,7 +3128,7 @@ class bi {
3042
3128
  }
3043
3129
  }
3044
3130
  /**
3045
- * @license FlipbookEngine v0.2.4
3131
+ * @license FlipbookEngine v0.6.0
3046
3132
  * Copyright (c) 2026 Murat Dogan
3047
3133
  *
3048
3134
  * This source code is dual-licensed under the AGPLv3 and a Commercial License.
@@ -3057,25 +3143,26 @@ class bi {
3057
3143
  */
3058
3144
  const mt = class mt {
3059
3145
  constructor(t, s = {}) {
3060
- m(this, "container", null);
3061
- m(this, "options");
3062
- m(this, "store", fe());
3146
+ v(this, "container", null);
3147
+ v(this, "options");
3148
+ v(this, "store", be());
3063
3149
  // Core Managers
3064
- m(this, "pageFlipAdapter", null);
3065
- m(this, "layoutManager", null);
3066
- m(this, "interactionManager", null);
3067
- m(this, "pdfRenderer", null);
3068
- m(this, "listeners", {});
3069
- m(this, "initializationTimer", null);
3070
- m(this, "initGeneration", 0);
3071
- m(this, "initAbortController", null);
3072
- m(this, "eventsReady", !1);
3073
- m(this, "lastEventState", { currentPage: 0, zoom: 1, zoomActive: !1, showThumbs: !0, isSingle: !1, orientation: "" });
3074
- m(this, "eventSyncStop", null);
3075
- m(this, "qualityObserver", null);
3076
- m(this, "pdfLazyStop", null);
3077
- m(this, "pdfPageRequests", /* @__PURE__ */ new Map());
3078
- 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());
3079
3166
  this.selector = t, this.options = {
3080
3167
  allowDownload: !0,
3081
3168
  showThumbs: !0,
@@ -3093,27 +3180,27 @@ const mt = class mt {
3093
3180
  }
3094
3181
  async init(t, s) {
3095
3182
  if (typeof this.selector == "string" ? this.container = document.querySelector(this.selector) : this.container = this.selector, !this.container) return;
3096
- this.destroy(!0), this.eventsReady = !1;
3183
+ this.eventsReady = !1, this.destroy(!0);
3097
3184
  const o = this.initGeneration, r = new AbortController();
3098
3185
  this.initAbortController = r;
3099
- let l = [], d = { ...mt.DEFAULT_PAGE_VIEWPORT };
3186
+ let h = [], u = { ...mt.DEFAULT_PAGE_VIEWPORT };
3100
3187
  if (s && s.length > 0) {
3101
3188
  if (r.signal.aborted) return;
3102
- const k = s.filter(fi);
3103
- l = vi(k);
3104
- const A = l[0];
3105
- if (A) {
3106
- const O = await this.loadImageSize(A.low || A.normal);
3107
- if (O) {
3108
- const H = (A.cropMode !== "full" ? O.width / 2 : O.width) / O.height, N = 420;
3109
- d = 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) };
3110
3197
  }
3111
3198
  }
3112
3199
  } else if (t) {
3113
3200
  if (r.signal.aborted) return;
3114
- let k = "load";
3201
+ let T = "load";
3115
3202
  try {
3116
- this.pdfRenderer = new bi({
3203
+ this.pdfRenderer = new Ti({
3117
3204
  scale: this.options.pdfRenderScale,
3118
3205
  quality: this.options.pdfRenderQuality,
3119
3206
  format: this.options.pdfRenderFormat,
@@ -3121,26 +3208,26 @@ const mt = class mt {
3121
3208
  cacheSize: this.options.pdfRenderCacheSize,
3122
3209
  workerSrc: this.options.pdfWorkerSrc
3123
3210
  }), this.emit("progress", { phase: "loading", completed: 0, total: 0 });
3124
- const A = await this.pdfRenderer.loadDocument(t, r.signal);
3125
- k = "render", this.emit("progress", { phase: "loading", completed: 1, total: A }), d = await this.pdfRenderer.calculateViewportDimensions(), l = Array.from({ length: A }, (O, U) => this.createPdfPlaceholder(U + 1));
3126
- } catch (A) {
3127
- r.signal.aborted || (console.error("PDF load failed:", A), this.emit("error", {
3128
- code: k === "load" ? "PDF_LOAD_FAILED" : "PDF_RENDER_FAILED",
3129
- message: A instanceof Error ? A.message : "Unable to load PDF.",
3130
- cause: A
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
3131
3218
  }));
3132
3219
  return;
3133
3220
  }
3134
3221
  }
3135
- if (r.signal.aborted || o !== this.initGeneration || !l.length) return;
3136
- this.store.init(this.options, l.length, l, !!t), Kt(this.container, this.options), this.container.innerHTML = "";
3137
- let p, x, S;
3138
- const b = { current: null }, D = { current: null }, $ = ri({
3139
- pageFlipAdapterRef: b,
3140
- interactionManagerRef: D,
3141
- bookWrapperRef: (k) => p = k,
3142
- bookSizerRef: (k) => x = k,
3143
- bookContainerRef: (k) => S = k,
3222
+ if (r.signal.aborted || o !== this.initGeneration || !h.length) return;
3223
+ this.store.init(this.options, h.length, h, !!t), Jt(this.container, this.options), this.container.innerHTML = "";
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,
3144
3231
  className: this.options.className,
3145
3232
  store: this.store,
3146
3233
  onToggleFullscreen: () => this.toggleFullscreen(),
@@ -3148,29 +3235,29 @@ const mt = class mt {
3148
3235
  t && (this.options.onDownload ? this.options.onDownload(t) : window.open(t, "_blank"));
3149
3236
  }
3150
3237
  });
3151
- this.container.appendChild($), this.setupQualityLoading(), this.layoutManager = new ui(d, this.store), this.layoutManager.onResizeCallback = () => {
3238
+ this.container.appendChild(S), this.setupQualityLoading(), this.layoutManager = new wi(u, this.store), this.layoutManager.onResizeCallback = () => {
3152
3239
  this.pageFlipAdapter && this.pageFlipAdapter.update();
3153
- }, this.layoutManager.init(p, x), this.pageFlipAdapter = new di(S, this.options, this.store), b.current = this.pageFlipAdapter, await new Promise((k) => {
3154
- const A = () => {
3155
- r.signal.removeEventListener("abort", A), k();
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();
3156
3243
  };
3157
- r.signal.addEventListener("abort", A, { once: !0 }), this.initializationTimer = setTimeout(async () => {
3158
- if (this.initializationTimer = null, r.signal.removeEventListener("abort", A), r.signal.aborted || o !== this.initGeneration || !this.pageFlipAdapter) {
3159
- k();
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();
3160
3247
  return;
3161
3248
  }
3162
- if (this.pageFlipAdapter.init(d.width, d.height), this.interactionManager = new gi(p, 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)
3163
3250
  try {
3164
3251
  await this.renderPdfPage(1, r.signal);
3165
3252
  } catch {
3166
- k();
3253
+ T();
3167
3254
  return;
3168
3255
  }
3169
3256
  if (r.signal.aborted || o !== this.initGeneration) {
3170
- k();
3257
+ T();
3171
3258
  return;
3172
3259
  }
3173
- this.eventsReady = !0, this.captureEventState(), this.emit("init", { totalPages: l.length }), k();
3260
+ this.eventsReady = !0, this.captureEventState(), this.hasActiveSession = !0, this.emit("init", { totalPages: h.length }), T();
3174
3261
  }, 10);
3175
3262
  }), this.initAbortController === r && (this.initAbortController = null);
3176
3263
  }
@@ -3187,35 +3274,36 @@ const mt = class mt {
3187
3274
  };
3188
3275
  }
3189
3276
  renderPdfPage(t, s) {
3190
- const o = this.pdfRenderer;
3277
+ const o = this.pdfRenderer, r = this.initGeneration;
3191
3278
  if (!o) return Promise.resolve("");
3192
- const r = this.pdfPageRequests.get(t);
3193
- if (r) return r;
3279
+ const h = this.pdfPageRequests.get(t);
3280
+ if (h) return h;
3194
3281
  if (this.pdfRenderedPages.has(t)) return Promise.resolve("");
3195
- const l = o.renderPageToDataUrl(t, s).then((d) => {
3196
- var p;
3197
- if (!d) throw new Error("PDF page " + t + " produced no image.");
3198
- return this.pdfRenderedPages.add(t), (p = this.container) == null || p.querySelectorAll('img[data-pdf-page="' + t + '"]').forEach((x) => {
3199
- x.src = d, delete x.dataset.pdfPage;
3282
+ const u = o.renderPageToDataUrl(t, s).then((p) => {
3283
+ var b;
3284
+ if (r !== this.initGeneration || s != null && s.aborted) throw this.createAbortError();
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;
3200
3288
  }), this.emit("progress", {
3201
3289
  phase: "rendering",
3202
3290
  completed: this.pdfRenderedPages.size,
3203
3291
  total: this.store.totalPages.value
3204
- }), d;
3205
- }).catch((d) => {
3206
- throw (d == null ? void 0 : d.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", {
3207
3295
  code: "PDF_RENDER_FAILED",
3208
- message: d instanceof Error ? d.message : "Unable to render PDF page.",
3209
- cause: d
3210
- }), d;
3296
+ message: p instanceof Error ? p.message : "Unable to render PDF page.",
3297
+ cause: p
3298
+ }), p);
3211
3299
  }).finally(() => {
3212
- this.pdfPageRequests.get(t) === l && this.pdfPageRequests.delete(t);
3300
+ this.pdfPageRequests.get(t) === u && this.pdfPageRequests.delete(t);
3213
3301
  });
3214
- return this.pdfPageRequests.set(t, l), l;
3302
+ return this.pdfPageRequests.set(t, u), u;
3215
3303
  }
3216
3304
  setupPdfLazyLoading() {
3217
3305
  var t;
3218
- (t = this.pdfLazyStop) == null || t.call(this), this.pdfLazyStop = null, this.pdfRenderer && (this.pdfLazyStop = _(() => {
3306
+ (t = this.pdfLazyStop) == null || t.call(this), this.pdfLazyStop = null, this.pdfRenderer && (this.pdfLazyStop = G(() => {
3219
3307
  const s = this.store.currentPage.value + 1, o = this.store.totalPages.value;
3220
3308
  [s, s + 1].filter((r) => r <= o).forEach((r) => {
3221
3309
  this.renderPdfPage(r).catch(() => {
@@ -3270,7 +3358,7 @@ const mt = class mt {
3270
3358
  this.store.isSingleMode.value = t;
3271
3359
  }
3272
3360
  updateOptions(t) {
3273
- 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 && Kt(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);
3274
3362
  }
3275
3363
  async setPages(t, s) {
3276
3364
  if (!(t != null && t.length)) {
@@ -3282,32 +3370,32 @@ const mt = class mt {
3282
3370
  setupQualityLoading() {
3283
3371
  var r;
3284
3372
  if (this.teardownQualityLoading(), !this.container) return;
3285
- const t = Array.from(this.container.querySelectorAll("img[data-src], img[data-pdf-page]")), s = (l) => {
3286
- const d = Number(l.dataset.pdfPage);
3287
- if (Number.isInteger(d) && d > 0) {
3288
- this.renderPdfPage(d).catch(() => {
3373
+ const t = Array.from(this.container.querySelectorAll("img[data-src], img[data-pdf-page]")), s = (h) => {
3374
+ const u = Number(h.dataset.pdfPage);
3375
+ if (Number.isInteger(u) && u > 0) {
3376
+ this.renderPdfPage(u).catch(() => {
3289
3377
  });
3290
3378
  return;
3291
3379
  }
3292
- const p = l.dataset.src;
3293
- p && (l.src = p, delete l.dataset.src);
3380
+ const p = h.dataset.src;
3381
+ p && (h.src = p, delete h.dataset.src);
3294
3382
  }, o = (r = this.container.ownerDocument.defaultView) == null ? void 0 : r.IntersectionObserver;
3295
3383
  if (!o) {
3296
- const l = /* @__PURE__ */ new Set();
3297
- t.forEach((d) => {
3298
- const p = Number(d.dataset.pdfPage);
3299
- Number.isInteger(p) && p > 0 ? l.size < 2 && (l.add(p), s(d)) : s(d);
3384
+ const h = /* @__PURE__ */ new Set();
3385
+ t.forEach((u) => {
3386
+ const p = Number(u.dataset.pdfPage);
3387
+ Number.isInteger(p) && p > 0 ? h.size < 2 && (h.add(p), s(u)) : s(u);
3300
3388
  });
3301
3389
  return;
3302
3390
  }
3303
- this.qualityObserver = new o((l) => {
3304
- l.forEach((d) => {
3391
+ this.qualityObserver = new o((h) => {
3392
+ h.forEach((u) => {
3305
3393
  var p;
3306
- d.isIntersecting && (s(d.target), (p = this.qualityObserver) == null || p.unobserve(d.target));
3394
+ u.isIntersecting && (s(u.target), (p = this.qualityObserver) == null || p.unobserve(u.target));
3307
3395
  });
3308
- }, { root: this.container, rootMargin: "240px" }), t.forEach((l) => {
3309
- var d;
3310
- return (d = this.qualityObserver) == null ? void 0 : d.observe(l);
3396
+ }, { root: this.container, rootMargin: "240px" }), t.forEach((h) => {
3397
+ var u;
3398
+ return (u = this.qualityObserver) == null ? void 0 : u.observe(h);
3311
3399
  });
3312
3400
  }
3313
3401
  teardownQualityLoading() {
@@ -3315,12 +3403,13 @@ const mt = class mt {
3315
3403
  (t = this.qualityObserver) == null || t.disconnect(), this.qualityObserver = null;
3316
3404
  }
3317
3405
  setupEventSync() {
3318
- this.eventSyncStop = _(() => {
3406
+ this.eventSyncStop = G(() => {
3319
3407
  const t = {
3320
3408
  currentPage: this.store.currentPage.value,
3321
3409
  zoom: this.store.zoomState.value.scale,
3322
3410
  zoomActive: this.store.zoomState.value.isActive,
3323
3411
  showThumbs: this.store.showThumbs.value,
3412
+ showToc: this.store.showToc.value,
3324
3413
  isSingle: this.store.isSingleMode.value,
3325
3414
  orientation: this.store.orientation.value
3326
3415
  };
@@ -3333,7 +3422,7 @@ const mt = class mt {
3333
3422
  pageNumber: t.currentPage + 1,
3334
3423
  totalPages: this.store.totalPages.value,
3335
3424
  isSingle: t.isSingle
3336
- }), (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;
3337
3426
  });
3338
3427
  }
3339
3428
  captureEventState() {
@@ -3342,13 +3431,19 @@ const mt = class mt {
3342
3431
  zoom: this.store.zoomState.value.scale,
3343
3432
  zoomActive: this.store.zoomState.value.isActive,
3344
3433
  showThumbs: this.store.showThumbs.value,
3434
+ showToc: this.store.showToc.value,
3345
3435
  isSingle: this.store.isSingleMode.value,
3346
3436
  orientation: this.store.orientation.value
3347
3437
  };
3348
3438
  }
3349
3439
  destroy(t = !1) {
3350
- var s, o;
3351
- this.initGeneration++, (s = this.initAbortController) == null || s.abort(), this.initAbortController = null, this.initializationTimer && (clearTimeout(this.initializationTimer), this.initializationTimer = null), this.pageFlipAdapter && this.pageFlipAdapter.destroy(), this.layoutManager && this.layoutManager.destroy(), this.interactionManager && this.interactionManager.destroy(), this.teardownQualityLoading(), (o = this.pdfLazyStop) == null || o.call(this), this.pdfLazyStop = null, this.pdfPageRequests.clear(), this.pdfRenderedPages.clear(), this.pdfRenderer && this.pdfRenderer.destroy(), this.pageFlipAdapter = null, this.layoutManager = null, this.interactionManager = null, this.pdfRenderer = null, !t && this.container && (this.container.innerHTML = ""), this.emit("destroy", void 0);
3440
+ var o, r;
3441
+ const s = this.hasActiveSession || !!this.initAbortController || !!this.pageFlipAdapter || !!this.layoutManager || !!this.interactionManager || !!this.pdfRenderer;
3442
+ this.initGeneration++, (o = this.initAbortController) == null || o.abort(), this.initAbortController = null, this.initializationTimer && (clearTimeout(this.initializationTimer), this.initializationTimer = null), this.pageFlipAdapter && this.pageFlipAdapter.destroy(), this.layoutManager && this.layoutManager.destroy(), this.interactionManager && this.interactionManager.destroy(), this.teardownQualityLoading(), (r = this.pdfLazyStop) == null || r.call(this), this.pdfLazyStop = null, this.pdfPageRequests.clear(), this.pdfRenderedPages.clear(), this.pdfRenderer && this.pdfRenderer.destroy(), this.pageFlipAdapter = null, this.layoutManager = null, this.interactionManager = null, this.pdfRenderer = null, this.eventsReady = !1, this.hasActiveSession = !1, this.store.reset(), !t && this.container && (this.container.innerHTML = ""), s && this.emit("destroy", void 0);
3443
+ }
3444
+ createAbortError() {
3445
+ const t = new Error("Flipbook initialization was aborted.");
3446
+ return t.name = "AbortError", t;
3352
3447
  }
3353
3448
  on(t, s) {
3354
3449
  const o = this.listeners[t] ?? /* @__PURE__ */ new Set();
@@ -3365,14 +3460,15 @@ const mt = class mt {
3365
3460
  });
3366
3461
  }
3367
3462
  };
3368
- m(mt, "DEFAULT_PAGE_VIEWPORT", { width: 420, height: 594 });
3463
+ v(mt, "DEFAULT_PAGE_VIEWPORT", { width: 420, height: 594 });
3369
3464
  let Rt = mt;
3370
- const me = globalThis, we = me.FlipbookEngine || {};
3371
- we.FlipbookEngine = Rt;
3372
- me.FlipbookEngine = we;
3465
+ const xe = globalThis, Pe = xe.FlipbookEngine || {};
3466
+ Pe.FlipbookEngine = Rt;
3467
+ xe.FlipbookEngine = Pe;
3373
3468
  export {
3374
3469
  Rt as F,
3375
- fi as i,
3376
- vi as n
3470
+ ye as a,
3471
+ yi as i,
3472
+ Pi as n
3377
3473
  };
3378
- //# sourceMappingURL=engine-BuVkDIh-.js.map
3474
+ //# sourceMappingURL=engine-MdZzt6R9.js.map