html-flip-book-react 0.0.0-alpha.51 → 0.0.0-alpha.52

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,10 +1,10 @@
1
1
  import { jsx as t, jsxs as y } from "react/jsx-runtime";
2
- import { createContext as he, useContext as pe, useMemo as ee, useCallback as P, useEffect as W, useState as D, useRef as _, useLayoutEffect as ve } from "react";
3
- let Pe = 4;
2
+ import { createContext as pe, useContext as fe, useMemo as ee, useCallback as P, useEffect as W, useState as D, useRef as _, useLayoutEffect as Pe } from "react";
3
+ let Te = 4;
4
4
  function ue() {
5
- return Pe;
5
+ return Te;
6
6
  }
7
- const Te = {
7
+ const ye = {
8
8
  id: "download",
9
9
  enName: "Download",
10
10
  enDescription: "Download entire book or page range",
@@ -17,7 +17,7 @@ const Te = {
17
17
  );
18
18
  },
19
19
  canExecute: (e) => typeof e.data?.onDownload == "function"
20
- }, ye = [
20
+ }, Ce = [
21
21
  { key: "ArrowRight" },
22
22
  { key: "PageDown" },
23
23
  { key: " " }
@@ -28,40 +28,40 @@ const Te = {
28
28
  enName: "Next Page",
29
29
  enDescription: "Flip to the next page",
30
30
  nameKey: "command.jumpToNextPage",
31
- hotkeys: ye,
31
+ hotkeys: Ce,
32
32
  execute: (e) => {
33
33
  e.handle?.flipNext();
34
34
  },
35
35
  canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) < (e.handle?.getTotalPages() ?? 0) - 1
36
- }, Ce = [{ key: "ArrowLeft" }, { key: "PageUp" }], te = {
36
+ }, Ie = [{ key: "ArrowLeft" }, { key: "PageUp" }], te = {
37
37
  id: "flipPrev",
38
38
  navKind: "flip",
39
39
  enName: "Previous Page",
40
40
  enDescription: "Flip to the previous page",
41
41
  nameKey: "command.jumpToPrevPage",
42
- hotkeys: Ce,
42
+ hotkeys: Ie,
43
43
  execute: (e) => {
44
44
  e.handle?.flipPrev();
45
45
  },
46
46
  canExecute: (e) => (e.handle?.getCurrentPageIndex() ?? 0) > 0
47
- }, Ie = [{ key: "Home" }, { key: "ArrowLeft", modifiers: { ctrl: !0 } }], ne = {
47
+ }, De = [{ key: "Home" }, { key: "ArrowLeft", modifiers: { ctrl: !0 } }], ne = {
48
48
  id: "goToFirst",
49
49
  navKind: "jump",
50
50
  enName: "First Page",
51
51
  enDescription: "Jump to the first page",
52
52
  nameKey: "command.jumpToFirstPage",
53
- hotkeys: Ie,
53
+ hotkeys: De,
54
54
  execute: (e) => {
55
55
  e.handle?.jumpToPage(0);
56
56
  },
57
57
  canExecute: (e) => e.handle?.getCurrentPageIndex() !== 0
58
- }, De = [{ key: "End" }, { key: "ArrowRight", modifiers: { ctrl: !0 } }], ae = {
58
+ }, Ne = [{ key: "End" }, { key: "ArrowRight", modifiers: { ctrl: !0 } }], ae = {
59
59
  id: "goToLast",
60
60
  navKind: "jump",
61
61
  enName: "Last Page",
62
62
  enDescription: "Jump to the last page",
63
63
  nameKey: "command.jumpToLastPage",
64
- hotkeys: De,
64
+ hotkeys: Ne,
65
65
  execute: (e) => {
66
66
  const o = e.handle?.getTotalPages() ?? 0;
67
67
  e.handle?.jumpToPage(o - 1);
@@ -70,13 +70,13 @@ const Te = {
70
70
  const o = e.handle?.getCurrentPageIndex() ?? 0, a = e.handle?.getTotalPages() ?? 0;
71
71
  return o !== a - 1;
72
72
  }
73
- }, Ne = [{ key: "t" }], re = {
73
+ }, Le = [{ key: "t" }], re = {
74
74
  id: "goToToc",
75
75
  navKind: "jump",
76
76
  enName: "Table of Contents",
77
77
  enDescription: "Jump to the table of contents",
78
78
  nameKey: "command.jumpToToc",
79
- hotkeys: Ne,
79
+ hotkeys: Le,
80
80
  execute: (e) => {
81
81
  const o = e.handle?.getTocPageIndex?.() ?? ue();
82
82
  e.handle?.jumpToPage(o);
@@ -85,69 +85,69 @@ const Te = {
85
85
  const o = e.handle?.getTocPageIndex?.() ?? ue();
86
86
  return e.handle?.getCurrentPageIndex() !== o;
87
87
  }
88
- }, Le = [{ key: "d", modifiers: { ctrl: !0, alt: !0 } }], Ee = {
88
+ }, Ee = [{ key: "d", modifiers: { ctrl: !0, alt: !0 } }], Fe = {
89
89
  id: "toggleDebug",
90
90
  enName: "Toggle Debug Toolbar",
91
91
  enDescription: "Show or hide the debug toolbar (Ctrl+Alt+D)",
92
92
  nameKey: "command.toggleDebug",
93
93
  descriptionKey: "command.toggleDebugDesc",
94
- hotkeys: Le,
94
+ hotkeys: Ee,
95
95
  execute: (e) => {
96
96
  e.handle?.toggleDebugBar?.();
97
97
  }
98
- }, Fe = [{ key: "F11" }], je = {
98
+ }, je = [{ key: "F11" }], Me = {
99
99
  id: "toggleFullscreen",
100
100
  enName: "Toggle Fullscreen",
101
101
  enDescription: "Enter or exit fullscreen mode",
102
102
  nameKey: "command.toggleFullscreen",
103
103
  descriptionKey: "command.toggleFullscreenDesc",
104
- hotkeys: Fe,
104
+ hotkeys: je,
105
105
  execute: (e) => {
106
106
  const o = e.data;
107
107
  document.fullscreenElement ? document.exitFullscreen().catch(console.warn) : (o?.getFullscreenTarget?.() ?? document.documentElement).requestFullscreen().catch(console.warn);
108
108
  }
109
- }, Me = [
109
+ }, $e = [
110
110
  oe,
111
111
  te,
112
112
  ne,
113
113
  ae,
114
114
  re,
115
- je,
116
- Ee,
117
- Te
115
+ Me,
116
+ Fe,
117
+ ye
118
118
  ];
119
- function $e(e, o) {
119
+ function Be(e, o) {
120
120
  return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
121
121
  }
122
- function Be(e, o, a) {
123
- if ($e(o.key, a) !== e.key) return !1;
124
- const n = e.modifiers ?? {};
125
- return !(!!n.ctrl !== o.ctrlKey || !!n.shift !== o.shiftKey || !!n.alt !== o.altKey || !!n.meta !== o.metaKey);
122
+ function Se(e, o, a) {
123
+ if (Be(o.key, a) !== e.key) return !1;
124
+ const r = e.modifiers ?? {};
125
+ return !(!!r.ctrl !== o.ctrlKey || !!r.shift !== o.shiftKey || !!r.alt !== o.altKey || !!r.meta !== o.metaKey);
126
126
  }
127
- const fe = he(null), Re = ({
127
+ const be = pe(null), Re = ({
128
128
  flipBookRef: e,
129
129
  currentPage: o,
130
130
  totalPages: a,
131
- direction: n = "ltr",
132
- commands: l = [],
133
- commandOptions: i = {},
134
- disableHotkeys: s = !1,
131
+ direction: r = "ltr",
132
+ commands: n = [],
133
+ commandOptions: s = {},
134
+ disableHotkeys: i = !1,
135
135
  children: c
136
136
  }) => {
137
137
  const h = ee(() => {
138
138
  const d = {};
139
- for (const u of Me)
139
+ for (const u of $e)
140
140
  d[u.id] = {
141
141
  command: u,
142
- options: i[u.id] ?? {}
142
+ options: s[u.id] ?? {}
143
143
  };
144
- for (const u of l)
144
+ for (const u of n)
145
145
  d[u.id] = {
146
146
  command: u,
147
- options: i[u.id] ?? {}
147
+ options: s[u.id] ?? {}
148
148
  };
149
149
  return d;
150
- }, [l, i]), b = P(
150
+ }, [n, s]), b = P(
151
151
  (d, u) => {
152
152
  const w = h[d.id]?.options ?? {}, F = u ? { ...w.data, ...u } : w.data;
153
153
  return {
@@ -179,18 +179,18 @@ const fe = he(null), Re = ({
179
179
  if (w.options.disableHotkeys) continue;
180
180
  const F = w.options.hotkeys ?? w.command.hotkeys ?? [];
181
181
  for (const M of F)
182
- if (Be(M, d, n)) {
182
+ if (Se(M, d, r)) {
183
183
  d.preventDefault(), g(w.command);
184
184
  return;
185
185
  }
186
186
  }
187
187
  },
188
- [h, g, n]
188
+ [h, g, r]
189
189
  );
190
190
  W(() => {
191
- if (!s)
191
+ if (!i)
192
192
  return document.addEventListener("keydown", T), () => document.removeEventListener("keydown", T);
193
- }, [s, T]);
193
+ }, [i, T]);
194
194
  const I = ee(
195
195
  () => ({
196
196
  execute: g,
@@ -199,13 +199,40 @@ const fe = he(null), Re = ({
199
199
  }),
200
200
  [g, C, N]
201
201
  );
202
- return /* @__PURE__ */ t(fe.Provider, { value: I, children: c });
202
+ return /* @__PURE__ */ t(be.Provider, { value: I, children: c });
203
203
  }, X = () => {
204
- const e = pe(fe);
204
+ const e = fe(be);
205
205
  if (!e)
206
206
  throw new Error("useCommands must be used within a CommandProvider");
207
207
  return e;
208
- }, K = { size: 24 }, Se = ({ size: e = K.size, className: o }) => /* @__PURE__ */ t(
208
+ };
209
+ function Ke(e) {
210
+ let o = "";
211
+ for (const a of new TextEncoder().encode(e))
212
+ o += String.fromCharCode(a);
213
+ return btoa(o);
214
+ }
215
+ function me(e) {
216
+ return { ext: "json", data: Ke(JSON.stringify(e, null, " ")) };
217
+ }
218
+ function oo(e) {
219
+ const { pagesCount: o, pageSemantics: a } = e, r = (n) => {
220
+ const s = a?.indexToSemanticName(n) ?? "", i = a?.indexToTitle(n) ?? "";
221
+ return a ? { pageIndex: n, semanticName: s, title: i } : { pageIndex: n, semanticName: String(n + 1), title: `Page ${n + 1}` };
222
+ };
223
+ return {
224
+ onDownloadSefer: () => {
225
+ const n = [];
226
+ for (let s = 0; s < o; s++) {
227
+ const i = r(s);
228
+ (i.semanticName || i.title) && n.push(i);
229
+ }
230
+ return Promise.resolve(me(n));
231
+ },
232
+ onDownloadPageRange: (n) => Promise.resolve(me(n.map(r)))
233
+ };
234
+ }
235
+ const K = { size: 24 }, Ae = ({ size: e = K.size, className: o }) => /* @__PURE__ */ t(
209
236
  "svg",
210
237
  {
211
238
  xmlns: "http://www.w3.org/2000/svg",
@@ -221,7 +248,7 @@ const fe = he(null), Re = ({
221
248
  "aria-hidden": "true",
222
249
  children: /* @__PURE__ */ t("path", { d: "m15 18-6-6 6-6" })
223
250
  }
224
- ), Ke = ({ size: e = K.size, className: o }) => /* @__PURE__ */ t(
251
+ ), ze = ({ size: e = K.size, className: o }) => /* @__PURE__ */ t(
225
252
  "svg",
226
253
  {
227
254
  xmlns: "http://www.w3.org/2000/svg",
@@ -237,7 +264,7 @@ const fe = he(null), Re = ({
237
264
  "aria-hidden": "true",
238
265
  children: /* @__PURE__ */ t("path", { d: "m9 18 6-6-6-6" })
239
266
  }
240
- ), Ae = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
267
+ ), He = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
241
268
  "svg",
242
269
  {
243
270
  xmlns: "http://www.w3.org/2000/svg",
@@ -256,7 +283,7 @@ const fe = he(null), Re = ({
256
283
  /* @__PURE__ */ t("path", { d: "M7 6v12" })
257
284
  ]
258
285
  }
259
- ), ze = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
286
+ ), Oe = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
260
287
  "svg",
261
288
  {
262
289
  xmlns: "http://www.w3.org/2000/svg",
@@ -275,7 +302,7 @@ const fe = he(null), Re = ({
275
302
  /* @__PURE__ */ t("path", { d: "M17 6v12" })
276
303
  ]
277
304
  }
278
- ), He = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
305
+ ), Ue = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
279
306
  "svg",
280
307
  {
281
308
  xmlns: "http://www.w3.org/2000/svg",
@@ -296,7 +323,7 @@ const fe = he(null), Re = ({
296
323
  /* @__PURE__ */ t("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
297
324
  ]
298
325
  }
299
- ), Oe = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
326
+ ), We = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
300
327
  "svg",
301
328
  {
302
329
  xmlns: "http://www.w3.org/2000/svg",
@@ -317,7 +344,7 @@ const fe = he(null), Re = ({
317
344
  /* @__PURE__ */ t("path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" })
318
345
  ]
319
346
  }
320
- ), Ue = ({
347
+ ), qe = ({
321
348
  size: e = K.size,
322
349
  className: o
323
350
  }) => /* @__PURE__ */ y(
@@ -343,7 +370,7 @@ const fe = he(null), Re = ({
343
370
  /* @__PURE__ */ t("path", { d: "M21 19h.01" })
344
371
  ]
345
372
  }
346
- ), Ze = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
373
+ ), to = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
347
374
  "svg",
348
375
  {
349
376
  xmlns: "http://www.w3.org/2000/svg",
@@ -365,7 +392,7 @@ const fe = he(null), Re = ({
365
392
  /* @__PURE__ */ t("rect", { x: "16", y: "6", width: "4", height: "15", rx: "0.5" })
366
393
  ]
367
394
  }
368
- ), We = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
395
+ ), Je = ({ size: e = K.size, className: o }) => /* @__PURE__ */ y(
369
396
  "svg",
370
397
  {
371
398
  xmlns: "http://www.w3.org/2000/svg",
@@ -389,10 +416,10 @@ const fe = he(null), Re = ({
389
416
  onClick: e,
390
417
  ariaLabel: o,
391
418
  ariaPressed: a,
392
- disabled: n = !1,
393
- children: l,
394
- className: i = "",
395
- title: s
419
+ disabled: r = !1,
420
+ children: n,
421
+ className: s = "",
422
+ title: i
396
423
  }) => /* @__PURE__ */ t(
397
424
  "button",
398
425
  {
@@ -400,38 +427,38 @@ const fe = he(null), Re = ({
400
427
  onClick: e,
401
428
  "aria-label": o,
402
429
  "aria-pressed": a,
403
- disabled: n,
404
- title: s ?? o,
405
- className: `flipbook-toolbar-button ${i}`.trim(),
406
- children: l
430
+ disabled: r,
431
+ title: i ?? o,
432
+ className: `flipbook-toolbar-button ${s}`.trim(),
433
+ children: n
407
434
  }
408
- ), eo = ({
435
+ ), no = ({
409
436
  onClick: e,
410
437
  ariaLabel: o,
411
438
  children: a,
412
- disabled: n = !1,
413
- className: l
439
+ disabled: r = !1,
440
+ className: n
414
441
  }) => /* @__PURE__ */ t(
415
442
  A,
416
443
  {
417
444
  onClick: e,
418
445
  ariaLabel: o,
419
- disabled: n,
420
- className: `flipbook-toolbar-action ${l ?? ""}`.trim(),
446
+ disabled: r,
447
+ className: `flipbook-toolbar-action ${n ?? ""}`.trim(),
421
448
  children: a
422
449
  }
423
- ), oo = ({
450
+ ), ao = ({
424
451
  enabled: e,
425
452
  onChange: o,
426
453
  ariaLabel: a,
427
- className: n
454
+ className: r
428
455
  }) => /* @__PURE__ */ t(
429
456
  A,
430
457
  {
431
458
  onClick: () => o(!e),
432
459
  ariaLabel: a ?? (e ? "Hide bookmarks" : "Show bookmarks"),
433
460
  ariaPressed: e,
434
- className: `flipbook-toolbar-bookmarks ${n ?? ""}`.trim(),
461
+ className: `flipbook-toolbar-bookmarks ${r ?? ""}`.trim(),
435
462
  children: /* @__PURE__ */ t("svg", { width: "18", height: "18", viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ t(
436
463
  "path",
437
464
  {
@@ -443,7 +470,7 @@ const fe = he(null), Re = ({
443
470
  }
444
471
  ) })
445
472
  }
446
- ), qe = {
473
+ ), Ve = {
447
474
  align: "left",
448
475
  direction: "ltr",
449
476
  translations: {
@@ -466,7 +493,7 @@ const fe = he(null), Re = ({
466
493
  "toolbarItem.selectText": "Select text with mouse",
467
494
  "toolbarItem.selectionLetters": "Aa"
468
495
  }
469
- }, Ve = {
496
+ }, Ge = {
470
497
  align: "right",
471
498
  direction: "rtl",
472
499
  translations: {
@@ -490,9 +517,9 @@ const fe = he(null), Re = ({
490
517
  "toolbarItem.selectionLetters": "אב"
491
518
  }
492
519
  }, le = {
493
- "en-US": qe,
494
- "he-IL": Ve
495
- }, ie = "en-US", Ge = {
520
+ "en-US": Ve,
521
+ "he-IL": Ge
522
+ }, se = "en-US", _e = {
496
523
  "toolbarItem.download": "Download",
497
524
  "toolbarItem.downloadPageRange": "Download page range…",
498
525
  "toolbarItem.download.from": "From",
@@ -510,126 +537,126 @@ const fe = he(null), Re = ({
510
537
  "command.toggleDebugDesc": "Show or hide the debug toolbar (Ctrl+Alt+D)",
511
538
  "toolbarItem.goToPage": "Go to page"
512
539
  };
513
- function be(e) {
514
- return le[e] ?? le[ie];
540
+ function we(e) {
541
+ return le[e] ?? le[se];
515
542
  }
516
- function se(e) {
517
- return be(e).direction === "rtl";
543
+ function ie(e) {
544
+ return we(e).direction === "rtl";
518
545
  }
519
- function Je(e) {
520
- return se(e) ? "rtl" : "ltr";
546
+ function Xe(e) {
547
+ return ie(e) ? "rtl" : "ltr";
521
548
  }
522
549
  function E(e, o) {
523
- const a = be(o).translations[e];
550
+ const a = we(o).translations[e];
524
551
  if (a !== void 0 && a !== "") return a;
525
- const n = le[ie].translations[e];
526
- return n !== void 0 && n !== "" ? n : Ge[e] ?? e;
552
+ const r = le[se].translations[e];
553
+ return r !== void 0 && r !== "" ? r : _e[e] ?? e;
527
554
  }
528
- const we = he(null);
555
+ const xe = pe(null);
529
556
  function z() {
530
- const e = pe(we);
557
+ const e = fe(xe);
531
558
  if (!e)
532
559
  throw new Error("Toolbar components must be used within a Toolbar");
533
560
  return e;
534
561
  }
535
- function me(e) {
562
+ function ge(e) {
536
563
  return e.replace(/[׳'״"]/g, "");
537
564
  }
538
- function ge(e, o) {
565
+ function he(e, o) {
539
566
  try {
540
- const a = atob(e.data), n = new Uint8Array(a.length);
567
+ const a = atob(e.data), r = new Uint8Array(a.length);
541
568
  for (let c = 0; c < a.length; c++)
542
- n[c] = a.charCodeAt(c);
543
- const l = new Blob([n]), i = URL.createObjectURL(l), s = document.createElement("a");
544
- s.href = i, s.download = `${o}.${e.ext}`, s.click(), URL.revokeObjectURL(i);
569
+ r[c] = a.charCodeAt(c);
570
+ const n = new Blob([r]), s = URL.createObjectURL(n), i = document.createElement("a");
571
+ i.href = s, i.download = `${o}.${e.ext}`, i.click(), URL.revokeObjectURL(s);
545
572
  } catch (a) {
546
573
  console.error("Download failed:", a);
547
574
  }
548
575
  }
549
- function _e(e, o) {
576
+ function Qe(e, o) {
550
577
  const a = [];
551
- for (let n = 0; n < e; n++) {
552
- const l = o?.indexToSemanticName(n) ?? "", i = o?.indexToTitle(n) ?? "";
553
- if (!l && !i) {
554
- o || a.push({ pageIndex: n, semanticName: String(n + 1), title: `Page ${n + 1}` });
578
+ for (let r = 0; r < e; r++) {
579
+ const n = o?.indexToSemanticName(r) ?? "", s = o?.indexToTitle(r) ?? "";
580
+ if (!n && !s) {
581
+ o || a.push({ pageIndex: r, semanticName: String(r + 1), title: `Page ${r + 1}` });
555
582
  continue;
556
583
  }
557
584
  a.push({
558
- pageIndex: n,
559
- semanticName: l || String(n + 1),
560
- title: i || l
585
+ pageIndex: r,
586
+ semanticName: n || String(r + 1),
587
+ title: s || n
561
588
  });
562
589
  }
563
590
  return a;
564
591
  }
565
- const to = ({
592
+ const ro = ({
566
593
  ariaLabel: e = "Download",
567
594
  className: o
568
595
  }) => {
569
596
  const {
570
597
  totalPages: a,
571
- pageSemantics: n,
572
- locale: l,
573
- openDownloadMenuRef: i,
574
- downloadExecutorRef: s,
598
+ pageSemantics: r,
599
+ locale: n,
600
+ openDownloadMenuRef: s,
601
+ downloadExecutorRef: i,
575
602
  flipBookRef: c
576
603
  } = z(), h = c.current?.getDownloadConfig?.() ?? void 0, [b, g] = D(!1);
577
- W(() => (i.current = () => g(!0), () => {
578
- i.current = null;
579
- }), [i]);
580
- const [C, N] = D("entire"), [T, I] = D(0), [d, u] = D(0), [w, F] = D(null), [M, G] = D(!1), R = _(null), H = _(null), j = ee(
581
- () => _e(a, n),
582
- [a, n]
583
- ), $ = !!h?.onDownloadSefer, S = !!h?.onDownloadPageRange, J = $ || S, O = j[0]?.pageIndex ?? 0, q = j[j.length - 1]?.pageIndex ?? 0;
604
+ W(() => (s.current = () => g(!0), () => {
605
+ s.current = null;
606
+ }), [s]);
607
+ const [C, N] = D("entire"), [T, I] = D(0), [d, u] = D(0), [w, F] = D(null), [M, V] = D(!1), S = _(null), H = _(null), j = ee(
608
+ () => Qe(a, r),
609
+ [a, r]
610
+ ), $ = !!h?.onDownloadSefer, R = !!h?.onDownloadPageRange, G = $ || R, O = j[0]?.pageIndex ?? 0, q = j[j.length - 1]?.pageIndex ?? 0;
584
611
  W(() => {
585
612
  b && (N($ ? "entire" : "range"), I(O), u(q));
586
613
  }, [b, $, O, q]);
587
614
  const L = P(() => {
588
615
  g(!1);
589
616
  }, []);
590
- ve(() => {
591
- if (!b || !H.current || !R.current) return;
592
- const r = H.current, k = R.current.querySelector(".flipbook-toolbar-download-trigger"), v = () => {
593
- const p = k?.getBoundingClientRect();
617
+ Pe(() => {
618
+ if (!b || !H.current || !S.current) return;
619
+ const l = H.current, x = S.current.querySelector(".flipbook-toolbar-download-trigger"), v = () => {
620
+ const p = x?.getBoundingClientRect();
594
621
  if (!p) return;
595
- const B = 8, U = 6, Y = window.innerHeight - p.bottom - U - B, ce = p.top - U - B, de = Math.min(r.scrollHeight, window.innerHeight * 0.7, 480), Z = Y < de && ce > Y;
596
- r.style.maxHeight = `${Math.max(0, Math.min(de, Z ? ce : Y))}px`;
597
- const Q = r.getBoundingClientRect(), ke = se(l) ? p.left : p.right - Q.width;
598
- r.style.left = `${Math.max(B, Math.min(ke, window.innerWidth - Q.width - B))}px`;
599
- const xe = Z ? p.top - U - Q.height : p.bottom + U;
600
- r.style.top = `${Math.max(B, Math.min(xe, window.innerHeight - Q.height - B))}px`, G(Z);
622
+ const B = 8, U = 6, Y = window.innerHeight - p.bottom - U - B, ce = p.top - U - B, de = Math.min(l.scrollHeight, window.innerHeight * 0.7, 480), Z = Y < de && ce > Y;
623
+ l.style.maxHeight = `${Math.max(0, Math.min(de, Z ? ce : Y))}px`;
624
+ const Q = l.getBoundingClientRect(), ke = ie(n) ? p.left : p.right - Q.width;
625
+ l.style.left = `${Math.max(B, Math.min(ke, window.innerWidth - Q.width - B))}px`;
626
+ const ve = Z ? p.top - U - Q.height : p.bottom + U;
627
+ l.style.top = `${Math.max(B, Math.min(ve, window.innerHeight - Q.height - B))}px`, V(Z);
601
628
  };
602
629
  v();
603
630
  const m = new ResizeObserver(v);
604
- m.observe(r);
605
- const f = R.current.closest('[role="toolbar"]');
631
+ m.observe(l);
632
+ const f = S.current.closest('[role="toolbar"]');
606
633
  return f && m.observe(f), window.addEventListener("resize", v), window.addEventListener("scroll", v, !0), () => {
607
634
  m.disconnect(), window.removeEventListener("resize", v), window.removeEventListener("scroll", v, !0);
608
635
  };
609
- }, [b, l]), W(() => {
636
+ }, [b, n]), W(() => {
610
637
  if (!b) return;
611
- const r = (k) => {
612
- R.current && !R.current.contains(k.target) && L();
638
+ const l = (x) => {
639
+ S.current && !S.current.contains(x.target) && L();
613
640
  };
614
- return document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
641
+ return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
615
642
  }, [b, L]);
616
- const x = P(async () => {
617
- const r = c.current?.getDownloadConfig?.();
618
- if (r?.onDownloadSefer) {
643
+ const k = P(async () => {
644
+ const l = c.current?.getDownloadConfig?.();
645
+ if (l?.onDownloadSefer) {
619
646
  F("sefer");
620
647
  try {
621
- const k = await r.onDownloadSefer();
622
- k && ge(k, r.entireBookFilename ?? "book"), L();
648
+ const x = await l.onDownloadSefer();
649
+ x && he(x, l.entireBookFilename ?? "book"), L();
623
650
  } finally {
624
651
  F(null);
625
652
  }
626
653
  }
627
- }, [c, L]), V = P(
628
- async (r, k) => {
654
+ }, [c, L]), J = P(
655
+ async (l, x) => {
629
656
  const v = c.current?.getDownloadConfig?.();
630
657
  if (!v?.onDownloadPageRange) return;
631
658
  const m = [], f = [];
632
- for (let p = r; p <= k; p++) {
659
+ for (let p = l; p <= x; p++) {
633
660
  m.push(p);
634
661
  const B = j.find((U) => U.pageIndex === p);
635
662
  B && f.push(B);
@@ -642,10 +669,10 @@ const to = ({
642
669
  v.downloadContext
643
670
  );
644
671
  if (p) {
645
- const B = me(f[0]?.semanticName ?? String(r)), U = me(
646
- f[f.length - 1]?.semanticName ?? String(k)
672
+ const B = ge(f[0]?.semanticName ?? String(l)), U = ge(
673
+ f[f.length - 1]?.semanticName ?? String(x)
647
674
  );
648
- ge(p, `${v.rangeFilename ?? "pages"}-${B}-${U}`);
675
+ he(p, `${v.rangeFilename ?? "pages"}-${B}-${U}`);
649
676
  }
650
677
  L();
651
678
  } finally {
@@ -654,22 +681,22 @@ const to = ({
654
681
  },
655
682
  [c, j, L]
656
683
  );
657
- return W(() => (s.current = (r, k) => {
658
- r === void 0 && k === void 0 ? x() : r !== void 0 && k !== void 0 && V(r, k);
684
+ return W(() => (i.current = (l, x) => {
685
+ l === void 0 && x === void 0 ? k() : l !== void 0 && x !== void 0 && J(l, x);
659
686
  }, () => {
660
- s.current = null;
661
- }), [s, x, V]), J ? /* @__PURE__ */ y("div", { className: `flipbook-toolbar-download-wrap ${o ?? ""}`.trim(), ref: R, children: [
687
+ i.current = null;
688
+ }), [i, k, J]), G ? /* @__PURE__ */ y("div", { className: `flipbook-toolbar-download-wrap ${o ?? ""}`.trim(), ref: S, children: [
662
689
  /* @__PURE__ */ t(
663
690
  "button",
664
691
  {
665
692
  type: "button",
666
693
  className: "flipbook-toolbar-button flipbook-toolbar-download-trigger",
667
- onClick: () => g((r) => !r),
668
- "aria-label": e ?? E("toolbarItem.download", l),
694
+ onClick: () => g((l) => !l),
695
+ "aria-label": e ?? E("toolbarItem.download", n),
669
696
  "aria-expanded": b,
670
697
  "aria-haspopup": "true",
671
698
  disabled: w !== null,
672
- children: /* @__PURE__ */ t(We, { size: 18 })
699
+ children: /* @__PURE__ */ t(Je, { size: 18 })
673
700
  }
674
701
  ),
675
702
  b && /* @__PURE__ */ y(
@@ -678,13 +705,13 @@ const to = ({
678
705
  ref: H,
679
706
  className: `flipbook-toolbar-download-menu ${M ? "flipbook-toolbar-download-menu--open-up" : ""}`.trim(),
680
707
  role: "menu",
681
- dir: se(l) ? "rtl" : "ltr",
708
+ dir: ie(n) ? "rtl" : "ltr",
682
709
  children: [
683
710
  /* @__PURE__ */ y(
684
711
  "fieldset",
685
712
  {
686
713
  className: "flipbook-toolbar-download-mode",
687
- "aria-label": E("toolbarItem.download", l),
714
+ "aria-label": E("toolbarItem.download", n),
688
715
  children: [
689
716
  $ && /* @__PURE__ */ y("label", { className: "flipbook-toolbar-download-radio-label", children: [
690
717
  /* @__PURE__ */ t(
@@ -697,9 +724,9 @@ const to = ({
697
724
  onChange: () => N("entire")
698
725
  }
699
726
  ),
700
- /* @__PURE__ */ t("span", { children: E("command.downloadEntireBook", l) })
727
+ /* @__PURE__ */ t("span", { children: E("command.downloadEntireBook", n) })
701
728
  ] }),
702
- S && /* @__PURE__ */ y("label", { className: "flipbook-toolbar-download-radio-label", children: [
729
+ R && /* @__PURE__ */ y("label", { className: "flipbook-toolbar-download-radio-label", children: [
703
730
  /* @__PURE__ */ t(
704
731
  "input",
705
732
  {
@@ -710,33 +737,33 @@ const to = ({
710
737
  onChange: () => N("range")
711
738
  }
712
739
  ),
713
- /* @__PURE__ */ t("span", { children: E("toolbarItem.downloadPageRange", l) })
740
+ /* @__PURE__ */ t("span", { children: E("toolbarItem.downloadPageRange", n) })
714
741
  ] })
715
742
  ]
716
743
  }
717
744
  ),
718
745
  C === "range" && /* @__PURE__ */ y("div", { className: "flipbook-toolbar-download-range", children: [
719
746
  /* @__PURE__ */ y("label", { className: "flipbook-toolbar-download-range-label", children: [
720
- E("toolbarItem.download.from", l),
747
+ E("toolbarItem.download.from", n),
721
748
  /* @__PURE__ */ t(
722
749
  "select",
723
750
  {
724
751
  value: T,
725
- onChange: (r) => I(Number(r.target.value)),
752
+ onChange: (l) => I(Number(l.target.value)),
726
753
  className: "flipbook-toolbar-download-range-select",
727
- children: j.map((r) => /* @__PURE__ */ t("option", { value: r.pageIndex, children: r.semanticName || r.title || `Page ${r.pageIndex + 1}` }, r.pageIndex))
754
+ children: j.map((l) => /* @__PURE__ */ t("option", { value: l.pageIndex, children: l.semanticName || l.title || `Page ${l.pageIndex + 1}` }, l.pageIndex))
728
755
  }
729
756
  )
730
757
  ] }),
731
758
  /* @__PURE__ */ y("label", { className: "flipbook-toolbar-download-range-label", children: [
732
- E("toolbarItem.download.to", l),
759
+ E("toolbarItem.download.to", n),
733
760
  /* @__PURE__ */ t(
734
761
  "select",
735
762
  {
736
763
  value: d,
737
- onChange: (r) => u(Number(r.target.value)),
764
+ onChange: (l) => u(Number(l.target.value)),
738
765
  className: "flipbook-toolbar-download-range-select",
739
- children: j.map((r) => /* @__PURE__ */ t("option", { value: r.pageIndex, children: r.semanticName || r.title || `Page ${r.pageIndex + 1}` }, r.pageIndex))
766
+ children: j.map((l) => /* @__PURE__ */ t("option", { value: l.pageIndex, children: l.semanticName || l.title || `Page ${l.pageIndex + 1}` }, l.pageIndex))
740
767
  }
741
768
  )
742
769
  ] })
@@ -749,46 +776,46 @@ const to = ({
749
776
  className: "flipbook-toolbar-download-menuitem flipbook-toolbar-download-primary",
750
777
  onClick: () => {
751
778
  if (C === "entire")
752
- x();
779
+ k();
753
780
  else {
754
- const r = c.current?.getTotalPages?.() ?? a, k = Math.min(T, d);
781
+ const l = c.current?.getTotalPages?.() ?? a, x = Math.min(T, d);
755
782
  let v = Math.max(T, d);
756
- if (r > 0 && v >= r && (v = r - 1), v < k) return;
757
- V(k, v);
783
+ if (l > 0 && v >= l && (v = l - 1), v < x) return;
784
+ J(x, v);
758
785
  }
759
786
  },
760
787
  disabled: w !== null,
761
- children: w === "sefer" || w === "range" ? "…" : E("toolbarItem.download.download", l)
788
+ children: w === "sefer" || w === "range" ? "…" : E("toolbarItem.download.download", n)
762
789
  }
763
790
  )
764
791
  ]
765
792
  }
766
793
  )
767
794
  ] }) : null;
768
- }, no = ({ children: e, className: o }) => {
769
- const { locale: a } = z(), { execute: n, canExecute: l } = X(), i = () => {
770
- n(ne);
771
- }, s = /* @__PURE__ */ t(Ae, { size: 18 }), c = E("command.jumpToFirstPage", a);
795
+ }, lo = ({ children: e, className: o }) => {
796
+ const { locale: a } = z(), { execute: r, canExecute: n } = X(), s = () => {
797
+ r(ne);
798
+ }, i = /* @__PURE__ */ t(He, { size: 18 }), c = E("command.jumpToFirstPage", a);
772
799
  return /* @__PURE__ */ t(
773
800
  A,
774
801
  {
775
- onClick: i,
802
+ onClick: s,
776
803
  ariaLabel: c,
777
804
  title: c,
778
- disabled: !l(ne),
805
+ disabled: !n(ne),
779
806
  className: `flipbook-toolbar-first ${o ?? ""}`.trim(),
780
- children: e ?? s
807
+ children: e ?? i
781
808
  }
782
809
  );
783
- }, ao = ({
810
+ }, io = ({
784
811
  targetRef: e,
785
812
  enterIcon: o,
786
813
  exitIcon: a,
787
- ariaLabelEnter: n = "Enter fullscreen",
788
- ariaLabelExit: l = "Exit fullscreen",
789
- className: i
814
+ ariaLabelEnter: r = "Enter fullscreen",
815
+ ariaLabelExit: n = "Exit fullscreen",
816
+ className: s
790
817
  }) => {
791
- const [s, c] = D(!1), h = z(), b = e ?? h.fullscreenTargetRef, g = P(() => {
818
+ const [i, c] = D(!1), h = z(), b = e ?? h.fullscreenTargetRef, g = P(() => {
792
819
  c(!!document.fullscreenElement);
793
820
  }, []);
794
821
  W(() => (document.addEventListener("fullscreenchange", g), () => {
@@ -796,93 +823,93 @@ const to = ({
796
823
  }), [g]);
797
824
  const C = async () => {
798
825
  try {
799
- s ? await document.exitFullscreen() : await (b?.current ?? document.documentElement).requestFullscreen();
826
+ i ? await document.exitFullscreen() : await (b?.current ?? document.documentElement).requestFullscreen();
800
827
  } catch (I) {
801
828
  console.warn("Fullscreen request failed:", I);
802
829
  }
803
- }, N = s ? l : n, T = s ? a ?? /* @__PURE__ */ t(Oe, { size: 18 }) : o ?? /* @__PURE__ */ t(He, { size: 18 });
830
+ }, N = i ? n : r, T = i ? a ?? /* @__PURE__ */ t(We, { size: 18 }) : o ?? /* @__PURE__ */ t(Ue, { size: 18 });
804
831
  return /* @__PURE__ */ t(
805
832
  A,
806
833
  {
807
834
  onClick: C,
808
835
  ariaLabel: N,
809
- className: `flipbook-toolbar-fullscreen ${s ? "flipbook-toolbar-fullscreen--active" : ""} ${i ?? ""}`.trim(),
836
+ className: `flipbook-toolbar-fullscreen ${i ? "flipbook-toolbar-fullscreen--active" : ""} ${s ?? ""}`.trim(),
810
837
  children: T
811
838
  }
812
839
  );
813
- }, ro = ({ children: e, className: o }) => {
814
- const { locale: a } = z(), { execute: n, canExecute: l } = X(), i = () => {
815
- n(ae);
816
- }, s = /* @__PURE__ */ t(ze, { size: 18 }), c = E("command.jumpToLastPage", a);
840
+ }, so = ({ children: e, className: o }) => {
841
+ const { locale: a } = z(), { execute: r, canExecute: n } = X(), s = () => {
842
+ r(ae);
843
+ }, i = /* @__PURE__ */ t(Oe, { size: 18 }), c = E("command.jumpToLastPage", a);
817
844
  return /* @__PURE__ */ t(
818
845
  A,
819
846
  {
820
- onClick: i,
847
+ onClick: s,
821
848
  ariaLabel: c,
822
849
  title: c,
823
- disabled: !l(ae),
850
+ disabled: !n(ae),
824
851
  className: `flipbook-toolbar-last ${o ?? ""}`.trim(),
825
- children: e ?? s
852
+ children: e ?? i
826
853
  }
827
854
  );
828
- }, lo = ({
855
+ }, co = ({
829
856
  letters: e,
830
857
  ariaLabel: o,
831
858
  className: a
832
859
  }) => {
833
- const { flipBookRef: n, locale: l, mouseMode: i } = z(), s = o ?? E("toolbarItem.selectText", l);
860
+ const { flipBookRef: r, locale: n, mouseMode: s } = z(), i = o ?? E("toolbarItem.selectText", n);
834
861
  return /* @__PURE__ */ t(
835
862
  A,
836
863
  {
837
864
  onClick: () => {
838
- n.current?.setMouseMode(i === "turn" ? "select" : "turn"), window.getSelection()?.removeAllRanges();
865
+ r.current?.setMouseMode(s === "turn" ? "select" : "turn"), window.getSelection()?.removeAllRanges();
839
866
  },
840
- ariaLabel: s,
841
- ariaPressed: i === "select",
867
+ ariaLabel: i,
868
+ ariaPressed: s === "select",
842
869
  className: `flipbook-toolbar-mouse-mode ${a ?? ""}`.trim(),
843
870
  children: /* @__PURE__ */ y("span", { className: "flipbook-toolbar-mouse-mode-icon", "aria-hidden": "true", children: [
844
871
  /* @__PURE__ */ t("span", { className: "flipbook-toolbar-mouse-mode-caret" }),
845
- /* @__PURE__ */ t("span", { children: e ?? E("toolbarItem.selectionLetters", l) })
872
+ /* @__PURE__ */ t("span", { children: e ?? E("toolbarItem.selectionLetters", n) })
846
873
  ] })
847
874
  }
848
875
  );
849
- }, so = ({ children: e, className: o }) => {
850
- const { locale: a } = z(), { execute: n, canExecute: l } = X(), i = () => {
851
- n(oe);
852
- }, s = E("command.jumpToNextPage", a), c = /* @__PURE__ */ t(Ke, { size: 20 });
876
+ }, uo = ({ children: e, className: o }) => {
877
+ const { locale: a } = z(), { execute: r, canExecute: n } = X(), s = () => {
878
+ r(oe);
879
+ }, i = E("command.jumpToNextPage", a), c = /* @__PURE__ */ t(ze, { size: 20 });
853
880
  return /* @__PURE__ */ t(
854
881
  A,
855
882
  {
856
- onClick: i,
857
- ariaLabel: s,
858
- title: s,
859
- disabled: !l(oe),
883
+ onClick: s,
884
+ ariaLabel: i,
885
+ title: i,
886
+ disabled: !n(oe),
860
887
  className: `flipbook-toolbar-next ${o ?? ""}`.trim(),
861
888
  children: e ?? c
862
889
  }
863
890
  );
864
- }, io = ({
891
+ }, mo = ({
865
892
  mode: e,
866
893
  showTotal: o = !0,
867
894
  placeholder: a = "—",
868
- editable: n,
869
- className: l,
870
- ariaLabel: i = "Go to page",
871
- maxLength: s = 10
895
+ editable: r,
896
+ className: n,
897
+ ariaLabel: s = "Go to page",
898
+ maxLength: i = 10
872
899
  }) => {
873
- const { flipBookRef: c, pageSemantics: h, direction: b, currentPage: g, totalPages: C, of: N } = z(), T = e ?? (h ? "semantic" : "index"), I = n ?? (T === "semantic" && !!h), [d, u] = D(""), [w, F] = D(!1), M = _(!1), G = _(g), R = g, H = g + 1 < C ? g + 1 : null, j = P(
900
+ const { flipBookRef: c, pageSemantics: h, direction: b, currentPage: g, totalPages: C, of: N } = z(), T = e ?? (h ? "semantic" : "index"), I = r ?? (T === "semantic" && !!h), [d, u] = D(""), [w, F] = D(!1), M = _(!1), V = _(g), S = g, H = g + 1 < C ? g + 1 : null, j = P(
874
901
  (m) => T === "semantic" && h ? h.indexToSemanticName(m) || "" : String(m + 1),
875
902
  [T, h]
876
- ), $ = j(R), S = H != null ? j(H) : "", J = P(() => String(N), [N]), O = P(() => {
877
- const m = $, f = S;
903
+ ), $ = j(S), R = H != null ? j(H) : "", G = P(() => String(N), [N]), O = P(() => {
904
+ const m = $, f = R;
878
905
  let p;
879
- return !m && !f ? p = a : m ? f ? m === f ? p = m : p = `${m} - ${f}` : p = m : p = f, o ? `${p} / ${J()}` : p;
880
- }, [$, S, a, o, J]), q = b === "rtl" ? S || $ : $ || S, L = O();
906
+ return !m && !f ? p = a : m ? f ? m === f ? p = m : p = `${m} - ${f}` : p = m : p = f, o ? `${p} / ${G()}` : p;
907
+ }, [$, R, a, o, G]), q = b === "rtl" ? R || $ : $ || R, L = O();
881
908
  W(() => {
882
- const m = g !== G.current;
883
- G.current = g, m && (M.current = !1), !w && !M.current && u(L);
909
+ const m = g !== V.current;
910
+ V.current = g, m && (M.current = !1), !w && !M.current && u(L);
884
911
  }, [L, w, g]);
885
- const x = P(
912
+ const k = P(
886
913
  (m) => {
887
914
  if (I) {
888
915
  F(!0), u(q), M.current = !1;
@@ -891,9 +918,9 @@ const to = ({
891
918
  }
892
919
  },
893
920
  [I, q]
894
- ), V = P(() => {
921
+ ), J = P(() => {
895
922
  F(!1), M.current || u(L);
896
- }, [L]), r = P(
923
+ }, [L]), l = P(
897
924
  (m) => {
898
925
  if (m.key === "Enter") {
899
926
  if (h && d.trim()) {
@@ -904,64 +931,64 @@ const to = ({
904
931
  } else m.key === "Escape" && m.currentTarget.blur();
905
932
  },
906
933
  [d, h, C, c]
907
- ), k = P((m) => {
934
+ ), x = P((m) => {
908
935
  u(m.target.value);
909
936
  }, []);
910
937
  return I ? /* @__PURE__ */ t(
911
938
  "input",
912
939
  {
913
940
  type: "text",
914
- className: `flipbook-toolbar-indicator ${w ? "flipbook-toolbar-indicator--editing" : ""} ${l ?? ""}`.trim(),
941
+ className: `flipbook-toolbar-indicator ${w ? "flipbook-toolbar-indicator--editing" : ""} ${n ?? ""}`.trim(),
915
942
  value: d,
916
- onFocus: x,
917
- onBlur: V,
918
- onKeyDown: r,
919
- onChange: k,
920
- "aria-label": i,
943
+ onFocus: k,
944
+ onBlur: J,
945
+ onKeyDown: l,
946
+ onChange: x,
947
+ "aria-label": s,
921
948
  "aria-live": "polite",
922
949
  "aria-atomic": "true",
923
- maxLength: s,
950
+ maxLength: i,
924
951
  readOnly: !I
925
952
  }
926
953
  ) : /* @__PURE__ */ t(
927
954
  "span",
928
955
  {
929
- className: `flipbook-toolbar-indicator ${l ?? ""}`.trim(),
956
+ className: `flipbook-toolbar-indicator ${n ?? ""}`.trim(),
930
957
  "aria-live": "polite",
931
958
  "aria-atomic": "true",
932
959
  children: L
933
960
  }
934
961
  );
935
- }, co = ({ children: e, className: o }) => {
936
- const { locale: a } = z(), { execute: n, canExecute: l } = X(), i = () => {
937
- n(te);
938
- }, s = E("command.jumpToPrevPage", a), c = /* @__PURE__ */ t(Se, { size: 20 });
962
+ }, go = ({ children: e, className: o }) => {
963
+ const { locale: a } = z(), { execute: r, canExecute: n } = X(), s = () => {
964
+ r(te);
965
+ }, i = E("command.jumpToPrevPage", a), c = /* @__PURE__ */ t(Ae, { size: 20 });
939
966
  return /* @__PURE__ */ t(
940
967
  A,
941
968
  {
942
- onClick: i,
943
- ariaLabel: s,
944
- title: s,
945
- disabled: !l(te),
969
+ onClick: s,
970
+ ariaLabel: i,
971
+ title: i,
972
+ disabled: !n(te),
946
973
  className: `flipbook-toolbar-prev ${o ?? ""}`.trim(),
947
974
  children: e ?? c
948
975
  }
949
976
  );
950
- }, uo = ({ children: e, ariaLabel: o, className: a }) => {
951
- const { locale: n } = z(), { execute: l, canExecute: i } = X(), s = o ?? E("command.jumpToToc", n), c = () => {
952
- l(re);
953
- }, h = !i(re);
977
+ }, ho = ({ children: e, ariaLabel: o, className: a }) => {
978
+ const { locale: r } = z(), { execute: n, canExecute: s } = X(), i = o ?? E("command.jumpToToc", r), c = () => {
979
+ n(re);
980
+ }, h = !s(re);
954
981
  return /* @__PURE__ */ t(
955
982
  A,
956
983
  {
957
984
  onClick: c,
958
- ariaLabel: s,
985
+ ariaLabel: i,
959
986
  disabled: h,
960
987
  className: `flipbook-toolbar-toc ${a ?? ""}`.trim(),
961
- children: e ?? /* @__PURE__ */ t(Ue, { size: 18 })
988
+ children: e ?? /* @__PURE__ */ t(qe, { size: 18 })
962
989
  }
963
990
  );
964
- }, Xe = {
991
+ }, Ye = {
965
992
  id: "openDownloadMenu",
966
993
  enName: "Open download menu",
967
994
  enDescription: "Open the download menu",
@@ -971,19 +998,19 @@ const to = ({
971
998
  e.data?.open?.();
972
999
  },
973
1000
  canExecute: (e) => typeof e.data?.open == "function"
974
- }, mo = ({
1001
+ }, po = ({
975
1002
  flipBookRef: e,
976
1003
  direction: o,
977
1004
  locale: a,
978
- pageSemantics: n,
979
- className: l = "",
980
- children: i,
981
- enableHotkeys: s = !0,
1005
+ pageSemantics: r,
1006
+ className: n = "",
1007
+ children: s,
1008
+ enableHotkeys: i = !0,
982
1009
  commands: c,
983
1010
  commandOptions: h,
984
1011
  fullscreenTargetRef: b
985
1012
  }) => {
986
- const g = o ?? Je(a ?? ie), C = a ?? (g === "rtl" ? "he-IL" : "en-US"), N = _(null), T = _(null), [I, d] = D(0), [u, w] = D(0), [F, M] = D(0), [G, R] = D(!0), [H, j] = D(!1), [$, S] = D("turn"), J = {
1013
+ const g = o ?? Xe(a ?? se), C = a ?? (g === "rtl" ? "he-IL" : "en-US"), N = _(null), T = _(null), [I, d] = D(0), [u, w] = D(0), [F, M] = D(0), [V, S] = D(!0), [H, j] = D(!1), [$, R] = D("turn"), G = {
987
1014
  ...b ? {
988
1015
  toggleFullscreen: {
989
1016
  data: {
@@ -996,31 +1023,31 @@ const to = ({
996
1023
  },
997
1024
  download: {
998
1025
  data: {
999
- onDownload: (x, V) => T.current?.(x, V)
1026
+ onDownload: (k, J) => T.current?.(k, J)
1000
1027
  }
1001
1028
  },
1002
1029
  ...h
1003
1030
  }, O = P(() => {
1004
- const x = e.current;
1005
- x && (d(x.getCurrentPageIndex()), w(x.getTotalPages()), M(x.getOf()), R(x.isFirstPage()), j(x.isLastPage()), S(x.getMouseMode?.() ?? "turn"));
1031
+ const k = e.current;
1032
+ k && (d(k.getCurrentPageIndex()), w(k.getTotalPages()), M(k.getOf()), S(k.isFirstPage()), j(k.isLastPage()), R(k.getMouseMode?.() ?? "turn"));
1006
1033
  }, [e]);
1007
1034
  W(() => {
1008
1035
  O();
1009
- const x = setInterval(O, 200);
1010
- return () => clearInterval(x);
1036
+ const k = setInterval(O, 200);
1037
+ return () => clearInterval(k);
1011
1038
  }, [O]);
1012
1039
  const q = /* @__PURE__ */ t(
1013
- we.Provider,
1040
+ xe.Provider,
1014
1041
  {
1015
1042
  value: {
1016
1043
  flipBookRef: e,
1017
1044
  direction: g,
1018
1045
  locale: C,
1019
- pageSemantics: n,
1046
+ pageSemantics: r,
1020
1047
  currentPage: I,
1021
1048
  totalPages: u,
1022
1049
  of: F,
1023
- isFirstPage: G,
1050
+ isFirstPage: V,
1024
1051
  isLastPage: H,
1025
1052
  mouseMode: $,
1026
1053
  openDownloadMenuRef: N,
@@ -1030,15 +1057,15 @@ const to = ({
1030
1057
  children: /* @__PURE__ */ t(
1031
1058
  "div",
1032
1059
  {
1033
- className: `flipbook-toolbar ${g === "rtl" ? "flipbook-toolbar--rtl" : ""} ${l}`.trim(),
1060
+ className: `flipbook-toolbar ${g === "rtl" ? "flipbook-toolbar--rtl" : ""} ${n}`.trim(),
1034
1061
  role: "toolbar",
1035
1062
  "aria-label": "FlipBook navigation",
1036
1063
  dir: g,
1037
- children: i
1064
+ children: s
1038
1065
  }
1039
1066
  )
1040
1067
  }
1041
- ), L = [Xe, ...c ?? []];
1068
+ ), L = [Ye, ...c ?? []];
1042
1069
  return /* @__PURE__ */ t(
1043
1070
  Re,
1044
1071
  {
@@ -1047,45 +1074,46 @@ const to = ({
1047
1074
  totalPages: u,
1048
1075
  direction: g,
1049
1076
  commands: L,
1050
- commandOptions: J,
1051
- disableHotkeys: !s,
1077
+ commandOptions: G,
1078
+ disableHotkeys: !i,
1052
1079
  children: q
1053
1080
  }
1054
1081
  );
1055
1082
  };
1056
1083
  export {
1057
- eo as ActionButton,
1058
- oo as BookmarkToggleButton,
1059
- Ze as BookshelfIcon,
1060
- Ae as ChevronFirstIcon,
1061
- ze as ChevronLastIcon,
1062
- Se as ChevronLeftIcon,
1063
- Ke as ChevronRightIcon,
1064
- to as DownloadDropdown,
1065
- We as DownloadIcon,
1066
- no as FirstPageButton,
1067
- ao as FullscreenButton,
1068
- ro as LastPageButton,
1069
- He as MaximizeIcon,
1070
- Oe as MinimizeIcon,
1071
- lo as MouseModeButton,
1072
- so as NextButton,
1073
- io as PageIndicator,
1074
- co as PrevButton,
1075
- io as SemanticPageIndicator,
1076
- Ue as TableOfContentsIcon,
1077
- uo as TocButton,
1078
- mo as Toolbar,
1084
+ no as ActionButton,
1085
+ ao as BookmarkToggleButton,
1086
+ to as BookshelfIcon,
1087
+ He as ChevronFirstIcon,
1088
+ Oe as ChevronLastIcon,
1089
+ Ae as ChevronLeftIcon,
1090
+ ze as ChevronRightIcon,
1091
+ ro as DownloadDropdown,
1092
+ Je as DownloadIcon,
1093
+ lo as FirstPageButton,
1094
+ io as FullscreenButton,
1095
+ so as LastPageButton,
1096
+ Ue as MaximizeIcon,
1097
+ We as MinimizeIcon,
1098
+ co as MouseModeButton,
1099
+ uo as NextButton,
1100
+ mo as PageIndicator,
1101
+ go as PrevButton,
1102
+ mo as SemanticPageIndicator,
1103
+ qe as TableOfContentsIcon,
1104
+ ho as TocButton,
1105
+ po as Toolbar,
1079
1106
  A as ToolbarButton,
1080
- Me as defaultCommands,
1081
- Te as downloadCommand,
1107
+ oo as createDefaultDownloadConfig,
1108
+ $e as defaultCommands,
1109
+ ye as downloadCommand,
1082
1110
  oe as flipNextCommand,
1083
1111
  te as flipPrevCommand,
1084
1112
  ne as goToFirstCommand,
1085
1113
  ae as goToLastCommand,
1086
1114
  re as goToTocCommand,
1087
- Ee as toggleDebugCommand,
1088
- je as toggleFullscreenCommand,
1115
+ Fe as toggleDebugCommand,
1116
+ Me as toggleFullscreenCommand,
1089
1117
  X as useCommands,
1090
1118
  z as useToolbar
1091
1119
  };