@alfadocs/ui-kit 0.10.0 → 0.11.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,42 +1,42 @@
1
- import { jsx as a, jsxs as Z } from "react/jsx-runtime";
2
- import { forwardRef as je, useId as Ve, useMemo as be, useState as m, useEffect as w, useRef as A, useCallback as L, useImperativeHandle as Fe } from "react";
3
- import * as ce from "pdfjs-dist";
4
- import { c as W } from "./index-D2ZczOXr.js";
5
- import { useTranslation as le } from "react-i18next";
6
- import * as X from "@radix-ui/react-popover";
7
- import Se from "pdfjs-dist/build/pdf.worker.min.mjs?url";
8
- import { S as Ee } from "./spinner-DirtWZNG.js";
9
- import { A as ye } from "./alert-pgdXrEO5.js";
10
- import { u as _e } from "./registry-C9nwlNyL.js";
11
- import { X as Le } from "./x-CCcI3eJp.js";
12
- import { C as Ze } from "./chevron-left-CX1jqD2M.js";
13
- import { C as Be } from "./chevron-right-BrpYejk0.js";
14
- import { c as Me } from "./createLucideIcon-CrFbzy84.js";
15
- import { S as Ke } from "./search-BonnQsHv.js";
16
- import { P as He } from "./printer-CeVEWfQq.js";
1
+ import { jsx as n, jsxs as Z } from "react/jsx-runtime";
2
+ import { forwardRef as Fe, useId as Ee, useMemo as xe, useState as h, useEffect as k, useRef as T, useCallback as L, useImperativeHandle as _e } from "react";
3
+ import * as fe from "pdfjs-dist";
4
+ import { c as J } from "./index-D2ZczOXr.js";
5
+ import { useTranslation as pe } from "react-i18next";
6
+ import * as ee from "@radix-ui/react-popover";
7
+ import Me from "pdfjs-dist/build/pdf.worker.min.mjs?url";
8
+ import { S as Le } from "./spinner-DirtWZNG.js";
9
+ import { A as we } from "./alert-pgdXrEO5.js";
10
+ import { u as Ze } from "./registry-C9nwlNyL.js";
11
+ import { X as Be } from "./x-CCcI3eJp.js";
12
+ import { C as Ke } from "./chevron-left-CX1jqD2M.js";
13
+ import { C as He } from "./chevron-right-BrpYejk0.js";
14
+ import { c as Ne } from "./createLucideIcon-CrFbzy84.js";
15
+ import { S as We } from "./search-BonnQsHv.js";
16
+ import { P as Qe } from "./printer-CeVEWfQq.js";
17
17
  /**
18
18
  * @license lucide-react v1.8.0 - ISC
19
19
  *
20
20
  * This source code is licensed under the ISC license.
21
21
  * See the LICENSE file in the root directory of this source tree.
22
22
  */
23
- const Qe = [
23
+ const qe = [
24
24
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
25
25
  ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
26
26
  ["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
27
27
  ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
28
- ], We = Me("zoom-in", Qe);
28
+ ], Ue = Ne("zoom-in", qe);
29
29
  /**
30
30
  * @license lucide-react v1.8.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
34
  */
35
- const qe = [
35
+ const Je = [
36
36
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
37
37
  ["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
38
38
  ["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
39
- ], Ue = Me("zoom-out", qe), Je = {
39
+ ], $e = Ne("zoom-out", Je), Xe = {
40
40
  id: "pdf-viewer",
41
41
  capabilities: ["paginate", "view_change", "filter"],
42
42
  state: {},
@@ -82,8 +82,8 @@ const qe = [
82
82
  }
83
83
  }
84
84
  };
85
- ce.GlobalWorkerOptions.workerSrc = Se;
86
- const xe = W(
85
+ fe.GlobalWorkerOptions.workerSrc = Me;
86
+ const ke = J(
87
87
  [
88
88
  "ds:pdf-viewer-alfadocs ds:flex ds:flex-col",
89
89
  "ds:gap-[var(--spacing-sm)]",
@@ -95,7 +95,7 @@ const xe = W(
95
95
  "ds:focus-visible:outline-[var(--ring)]",
96
96
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
97
97
  ].join(" ")
98
- ), $e = W(
98
+ ), Ge = J(
99
99
  [
100
100
  "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
101
101
  "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
@@ -103,7 +103,7 @@ const xe = W(
103
103
  "ds:bg-[var(--background)]",
104
104
  "ds:border-b ds:border-[color:var(--border)]"
105
105
  ].join(" ")
106
- ), we = W(
106
+ ), ze = J(
107
107
  [
108
108
  "ds:inline-flex ds:items-center ds:justify-center",
109
109
  "ds:min-block-size-[var(--min-target-size)]",
@@ -120,7 +120,7 @@ const xe = W(
120
120
  "ds:forced-colors:focus-visible:outline-[CanvasText]",
121
121
  "ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed"
122
122
  ].join(" ")
123
- ), ke = W(
123
+ ), Pe = J(
124
124
  [
125
125
  "ds:min-block-size-[var(--min-target-size)]",
126
126
  "ds:inline-size-[4rem] ds:text-center",
@@ -132,7 +132,7 @@ const xe = W(
132
132
  "ds:focus-visible:outline-[var(--ring)]",
133
133
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
134
134
  ].join(" ")
135
- ), Xe = W(
135
+ ), Ye = J(
136
136
  [
137
137
  "ds:min-block-size-[var(--min-target-size)]",
138
138
  "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
@@ -143,7 +143,7 @@ const xe = W(
143
143
  "ds:focus-visible:outline-[var(--ring)]",
144
144
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
145
145
  ].join(" ")
146
- ), Ge = W(
146
+ ), et = J(
147
147
  [
148
148
  "ds:relative ds:flex ds:flex-col ds:items-center",
149
149
  "ds:gap-[var(--spacing-md)]",
@@ -153,14 +153,14 @@ const xe = W(
153
153
  "ds:min-block-size-[30rem]",
154
154
  "ds:max-block-size-[80vh]"
155
155
  ].join(" ")
156
- ), Ye = W(
156
+ ), tt = J(
157
157
  [
158
158
  "ds:relative ds:flex ds:items-center ds:justify-center",
159
159
  "ds:bg-[var(--background)]",
160
160
  "ds:shadow-[var(--shadow-md)]",
161
161
  "ds:rounded-[var(--radius-sm)]"
162
162
  ].join(" ")
163
- ), et = [
163
+ ), rt = [
164
164
  "fit-width",
165
165
  "fit-page",
166
166
  "actual-size",
@@ -171,64 +171,66 @@ const xe = W(
171
171
  1.5,
172
172
  2
173
173
  ];
174
- function J(i) {
174
+ function X(i) {
175
175
  return typeof i == "number";
176
176
  }
177
- function ze(i, t, u) {
178
- if (J(i)) return i;
177
+ function Se(i, t, u) {
178
+ if (X(i)) return i;
179
179
  if (i === "actual-size" || !u) return 1;
180
- const h = window.getComputedStyle(u), f = parseFloat(h.paddingInlineStart || "0") + parseFloat(h.paddingInlineEnd || "0"), g = parseFloat(h.paddingBlockStart || "0") + parseFloat(h.paddingBlockEnd || "0"), k = Math.max(u.clientWidth - f, 1), p = Math.max(u.clientHeight - g, 1), N = t.width, P = t.height;
181
- return i === "fit-width" ? k / N : Math.min(k / N, p / P);
180
+ const v = window.getComputedStyle(u), b = parseFloat(v.paddingInlineStart || "0") + parseFloat(v.paddingInlineEnd || "0"), g = parseFloat(v.paddingBlockStart || "0") + parseFloat(v.paddingBlockEnd || "0"), z = Math.max(u.clientWidth - b, 1), m = Math.max(u.clientHeight - g, 1), P = t.width, S = t.height;
181
+ return i === "fit-width" ? z / P : Math.min(z / P, m / S);
182
182
  }
183
- const tt = je(
183
+ const nt = Fe(
184
184
  ({
185
185
  id: i,
186
186
  src: t,
187
187
  initialPage: u = 1,
188
- initialZoom: h = "fit-width",
189
- onPageChange: f,
190
- onLoadComplete: g,
191
- onError: k,
192
- toolbar: p = !0,
193
- ariaLabel: N,
194
- className: P
195
- }, R) => {
196
- const { t: S } = le(), V = Ve(), B = be(
197
- () => `pdf-${V.replace(/[^a-zA-Z0-9-_]/g, "")}`,
198
- [V]
199
- ), [z, q] = m(!1), [v, K] = m(!1);
200
- w(() => {
188
+ initialZoom: v = "fit-width",
189
+ pageRotation: b,
190
+ renderPageOverlay: g,
191
+ onPageChange: z,
192
+ onLoadComplete: m,
193
+ onError: P,
194
+ toolbar: S = !0,
195
+ ariaLabel: B,
196
+ className: A
197
+ }, V) => {
198
+ const { t: C } = pe(), F = Ee(), E = xe(
199
+ () => `pdf-${F.replace(/[^a-zA-Z0-9-_]/g, "")}`,
200
+ [F]
201
+ ), [y, K] = h(!1), [f, H] = h(!1);
202
+ k(() => {
201
203
  if (typeof document > "u") return;
202
- q(document.documentElement.dir === "rtl");
203
- const e = window.matchMedia("(prefers-reduced-motion: reduce)"), r = () => K(e.matches);
204
+ K(document.documentElement.dir === "rtl");
205
+ const e = window.matchMedia("(prefers-reduced-motion: reduce)"), r = () => H(e.matches);
204
206
  return r(), e.addEventListener("change", r), () => e.removeEventListener("change", r);
205
207
  }, []);
206
- const [s, F] = m(null), [c, b] = m(null), [l, E] = m(u), [O, y] = m(h), [I, M] = m({ start: Math.max(1, u - 1), end: u + 1 }), [n, x] = m(""), [j, G] = m(!1), [ue, fe] = m(""), [Ce, Ne] = m({ current: 0, total: 0 }), Y = A(f), ee = A(g), te = A(k);
207
- w(() => {
208
- Y.current = f, ee.current = g, te.current = k;
209
- }, [f, g, k]);
210
- const se = A(null);
211
- w(() => {
212
- se.current = s;
213
- }, [s]), w(() => {
208
+ const [s, W] = h(null), [Q, d] = h(null), [c, N] = h(u), [x, p] = h(v), [a, w] = h({ start: Math.max(1, u - 1), end: u + 1 }), [O, te] = h(""), [G, j] = h(!1), [I, me] = h(""), [Ie, De] = h({ current: 0, total: 0 }), re = T(z), ne = T(m), ae = T(P);
209
+ k(() => {
210
+ re.current = z, ne.current = m, ae.current = P;
211
+ }, [z, m, P]);
212
+ const de = T(null);
213
+ k(() => {
214
+ de.current = s;
215
+ }, [s]), k(() => {
214
216
  let e = !1;
215
- F(null), b(null);
217
+ W(null), d(null);
216
218
  const r = {
217
219
  disableJavaScript: !0,
218
220
  isEvalSupported: !1
219
- }, d = ce.getDocument(
221
+ }, l = fe.getDocument(
220
222
  typeof t == "string" ? { url: t, ...r } : t instanceof Uint8Array ? { data: t, ...r } : { data: new Uint8Array(t), ...r }
221
223
  );
222
- return d.promise.then(
224
+ return l.promise.then(
223
225
  async (o) => {
224
- var H;
226
+ var q;
225
227
  if (e) return;
226
- let C;
228
+ let M;
227
229
  try {
228
- const Q = await o.getMetadata(), T = Q == null ? void 0 : Q.info;
229
- C = T == null ? void 0 : T.Title;
230
+ const U = await o.getMetadata(), R = U == null ? void 0 : U.info;
231
+ M = R == null ? void 0 : R.Title;
230
232
  } catch {
231
- C = void 0;
233
+ M = void 0;
232
234
  }
233
235
  if (e) {
234
236
  try {
@@ -237,70 +239,70 @@ const tt = je(
237
239
  }
238
240
  return;
239
241
  }
240
- const _ = { doc: o, numPages: o.numPages, title: C };
241
- F(_), (H = ee.current) == null || H.call(ee, { numPages: o.numPages, title: C });
242
+ const _ = { doc: o, numPages: o.numPages, title: M };
243
+ W(_), (q = ne.current) == null || q.call(ne, { numPages: o.numPages, title: M });
242
244
  },
243
245
  (o) => {
244
246
  var _;
245
247
  if (e) return;
246
- const C = o instanceof Error ? o : new Error(String(o));
247
- b(C), (_ = te.current) == null || _.call(te, C);
248
+ const M = o instanceof Error ? o : new Error(String(o));
249
+ d(M), (_ = ae.current) == null || _.call(ae, M);
248
250
  }
249
251
  ), () => {
250
- e = !0, d.destroy();
251
- const o = se.current;
252
+ e = !0, l.destroy();
253
+ const o = de.current;
252
254
  if (o) {
253
255
  try {
254
256
  o.doc.destroy();
255
257
  } catch {
256
258
  }
257
- se.current = null;
259
+ de.current = null;
258
260
  }
259
261
  };
260
- }, [t]), w(() => {
262
+ }, [t]), k(() => {
261
263
  var e;
262
- s && (x(
263
- S("pdf.pageOf", { current: l, total: s.numPages })
264
- ), (e = Y.current) == null || e.call(Y, l));
265
- }, [l, s, S]);
266
- const re = A(null), oe = A([]), D = L(
264
+ s && (te(
265
+ C("pdf.pageOf", { current: c, total: s.numPages })
266
+ ), (e = re.current) == null || e.call(re, c));
267
+ }, [c, s, C]);
268
+ const se = T(null), ce = T([]), D = L(
267
269
  (e) => {
268
270
  if (!s) return;
269
271
  const r = Math.max(1, Math.min(e, s.numPages));
270
- E(r);
271
- const d = oe.current[r - 1];
272
- d && d.scrollIntoView({
272
+ N(r);
273
+ const l = ce.current[r - 1];
274
+ l && l.scrollIntoView({
273
275
  behavior: "auto",
274
276
  block: "start"
275
277
  });
276
278
  },
277
- [s, v]
278
- ), pe = L((e) => {
279
- y(e);
280
- }, []), $ = L(() => {
279
+ [s, f]
280
+ ), ge = L((e) => {
281
+ p(e);
282
+ }, []), Y = L(() => {
281
283
  typeof window < "u" && window.print();
282
- }, []), me = L((e) => {
283
- fe(e), G(e.length > 0);
284
- }, []), ie = be(
284
+ }, []), he = L((e) => {
285
+ me(e), j(e.length > 0);
286
+ }, []), le = xe(
285
287
  () => ({
286
288
  goToPage: D,
287
- setZoom: pe,
288
- search: me,
289
- print: $
289
+ setZoom: ge,
290
+ search: he,
291
+ print: Y
290
292
  }),
291
- [D, pe, me, $]
293
+ [D, ge, he, Y]
292
294
  );
293
- Fe(R, () => ie, [ie]), _e(Je, ie, i);
294
- const Ie = L(
295
+ _e(V, () => le, [le]), Ze(Xe, le, i);
296
+ const Re = L(
295
297
  (e) => {
296
298
  if (!s) return;
297
299
  const r = e.metaKey || e.ctrlKey;
298
300
  if (e.key === "PageDown") {
299
- e.preventDefault(), D(l + 1);
301
+ e.preventDefault(), D(c + 1);
300
302
  return;
301
303
  }
302
304
  if (e.key === "PageUp") {
303
- e.preventDefault(), D(l - 1);
305
+ e.preventDefault(), D(c - 1);
304
306
  return;
305
307
  }
306
308
  if (e.key === "Home") {
@@ -312,89 +314,89 @@ const tt = je(
312
314
  return;
313
315
  }
314
316
  if (r && e.key.toLowerCase() === "f") {
315
- e.preventDefault(), G(!0);
317
+ e.preventDefault(), j(!0);
316
318
  return;
317
319
  }
318
320
  if (r && (e.key === "+" || e.key === "=")) {
319
- e.preventDefault(), y((d) => J(d) ? Math.min(d * 1.25, 4) : 1.25);
321
+ e.preventDefault(), p((l) => X(l) ? Math.min(l * 1.25, 4) : 1.25);
320
322
  return;
321
323
  }
322
324
  if (r && e.key === "-") {
323
- e.preventDefault(), y(
324
- (d) => J(d) ? Math.max(d / 1.25, 0.25) : 0.75
325
+ e.preventDefault(), p(
326
+ (l) => X(l) ? Math.max(l / 1.25, 0.25) : 0.75
325
327
  );
326
328
  return;
327
329
  }
328
330
  if (r && e.key === "0") {
329
- e.preventDefault(), y("fit-width");
331
+ e.preventDefault(), p("fit-width");
330
332
  return;
331
333
  }
332
- r && e.key.toLowerCase() === "p" && (e.preventDefault(), $());
334
+ r && e.key.toLowerCase() === "p" && (e.preventDefault(), Y());
333
335
  },
334
- [l, D, $, s]
335
- ), de = A(l);
336
- w(() => {
337
- de.current = l;
338
- }, [l]), w(() => {
336
+ [c, D, Y, s]
337
+ ), ue = T(c);
338
+ k(() => {
339
+ ue.current = c;
340
+ }, [c]), k(() => {
339
341
  if (!s) return;
340
- const e = re.current;
342
+ const e = se.current;
341
343
  if (!e) return;
342
- const r = /* @__PURE__ */ new Map(), d = new IntersectionObserver(
344
+ const r = /* @__PURE__ */ new Map(), l = new IntersectionObserver(
343
345
  (o) => {
344
- for (const T of o) {
345
- const U = T.target.dataset.pageNumber;
346
- if (!U) continue;
347
- const Oe = Number(U);
348
- r.set(Oe, T.intersectionRatio);
346
+ for (const R of o) {
347
+ const $ = R.target.dataset.pageNumber;
348
+ if (!$) continue;
349
+ const Ve = Number($);
350
+ r.set(Ve, R.intersectionRatio);
349
351
  }
350
- let C = de.current, _ = 0, H = 1 / 0, Q = -1 / 0;
351
- for (const [T, U] of r.entries())
352
- U > _ && (C = T, _ = U), U > 0 && (H = Math.min(H, T), Q = Math.max(Q, T));
353
- _ > 0 && C !== de.current && E(C), H !== 1 / 0 && M({
354
- start: Math.max(1, H - 1),
355
- end: Math.min(s.numPages, Q + 1)
352
+ let M = ue.current, _ = 0, q = 1 / 0, U = -1 / 0;
353
+ for (const [R, $] of r.entries())
354
+ $ > _ && (M = R, _ = $), $ > 0 && (q = Math.min(q, R), U = Math.max(U, R));
355
+ _ > 0 && M !== ue.current && N(M), q !== 1 / 0 && w({
356
+ start: Math.max(1, q - 1),
357
+ end: Math.min(s.numPages, U + 1)
356
358
  });
357
359
  },
358
360
  { root: e, threshold: [0, 0.25, 0.5, 0.75, 1] }
359
361
  );
360
- return oe.current.forEach((o) => {
361
- o && d.observe(o);
362
- }), () => d.disconnect();
362
+ return ce.current.forEach((o) => {
363
+ o && l.observe(o);
364
+ }), () => l.disconnect();
363
365
  }, [s]);
364
- const [De, Te] = m(0);
365
- w(() => {
366
- const e = re.current;
366
+ const [Te, Ae] = h(0);
367
+ k(() => {
368
+ const e = se.current;
367
369
  if (!e || typeof ResizeObserver > "u") return;
368
370
  const r = new ResizeObserver(() => {
369
- (O === "fit-width" || O === "fit-page") && Te((d) => d + 1);
371
+ (x === "fit-width" || x === "fit-page") && Ae((l) => l + 1);
370
372
  });
371
373
  return r.observe(e), () => r.disconnect();
372
- }, [O]);
373
- const he = A([]), [ne, ge] = m(0), Ae = L(
374
+ }, [x]);
375
+ const ve = T([]), [oe, be] = h(0), Oe = L(
374
376
  (e) => (r) => {
375
- he.current[e] = r;
377
+ ve.current[e] = r;
376
378
  },
377
379
  []
378
- ), ve = L((e) => {
379
- const r = he.current[e];
380
+ ), ye = L((e) => {
381
+ const r = ve.current[e];
380
382
  r && r.focus();
381
- }, []), ae = 8, Re = L(
383
+ }, []), ie = 8, je = L(
382
384
  (e) => {
383
- const r = z ? "ArrowLeft" : "ArrowRight", d = z ? "ArrowRight" : "ArrowLeft";
385
+ const r = y ? "ArrowLeft" : "ArrowRight", l = y ? "ArrowRight" : "ArrowLeft";
384
386
  let o = null;
385
- e.key === r ? o = (ne + 1) % ae : e.key === d ? o = (ne - 1 + ae) % ae : e.key === "Home" ? o = 0 : e.key === "End" && (o = ae - 1), o !== null && (e.preventDefault(), ge(o), ve(o));
387
+ e.key === r ? o = (oe + 1) % ie : e.key === l ? o = (oe - 1 + ie) % ie : e.key === "Home" ? o = 0 : e.key === "End" && (o = ie - 1), o !== null && (e.preventDefault(), be(o), ye(o));
386
388
  },
387
- [ve, z, ne]
389
+ [ye, y, oe]
388
390
  );
389
- return c ? /* @__PURE__ */ a(
391
+ return Q ? /* @__PURE__ */ n(
390
392
  "div",
391
393
  {
392
- className: [xe(), P].filter(Boolean).join(" "),
393
- "aria-label": N ?? S("pdf.error"),
394
- children: /* @__PURE__ */ a("div", { className: "ds:p-[var(--spacing-lg)]", children: /* @__PURE__ */ a(ye, { variant: "error", live: "polite", children: /* @__PURE__ */ Z(ye.Description, { children: [
395
- S("pdf.error"),
394
+ className: [ke(), A].filter(Boolean).join(" "),
395
+ "aria-label": B ?? C("pdf.error"),
396
+ children: /* @__PURE__ */ n("div", { className: "ds:p-[var(--spacing-lg)]", children: /* @__PURE__ */ n(we, { variant: "error", live: "polite", children: /* @__PURE__ */ Z(we.Description, { children: [
397
+ C("pdf.error"),
396
398
  ": ",
397
- c.message
399
+ Q.message
398
400
  ] }) }) })
399
401
  }
400
402
  ) : (
@@ -402,87 +404,89 @@ const tt = je(
402
404
  /* @__PURE__ */ Z(
403
405
  "div",
404
406
  {
405
- id: B,
407
+ id: E,
406
408
  role: "region",
407
- "aria-label": N ?? S("pdf.toolbarLabel"),
408
- className: [xe(), P].filter(Boolean).join(" "),
409
- dir: z ? "rtl" : void 0,
410
- onKeyDown: Ie,
409
+ "aria-label": B ?? C("pdf.toolbarLabel"),
410
+ className: [ke(), A].filter(Boolean).join(" "),
411
+ dir: y ? "rtl" : void 0,
412
+ onKeyDown: Re,
411
413
  tabIndex: -1,
412
414
  "data-component": "pdf-viewer",
413
415
  "data-component-id": i,
414
- "data-pdfjs-worker-src": Se,
416
+ "data-pdfjs-worker-src": Me,
415
417
  children: [
416
- p ? /* @__PURE__ */ a(
417
- rt,
418
+ S ? /* @__PURE__ */ n(
419
+ at,
418
420
  {
419
- currentPage: l,
421
+ currentPage: c,
420
422
  numPages: (s == null ? void 0 : s.numPages) ?? 0,
421
- zoom: O,
422
- onPrev: () => D(l - 1),
423
- onNext: () => D(l + 1),
423
+ zoom: x,
424
+ onPrev: () => D(c - 1),
425
+ onNext: () => D(c + 1),
424
426
  onJump: (e) => D(e),
425
427
  onZoomIn: () => {
426
- y(
427
- (e) => J(e) ? Math.min(e * 1.25, 4) : 1.25
428
+ p(
429
+ (e) => X(e) ? Math.min(e * 1.25, 4) : 1.25
428
430
  );
429
431
  },
430
432
  onZoomOut: () => {
431
- y(
432
- (e) => J(e) ? Math.max(e / 1.25, 0.25) : 0.75
433
+ p(
434
+ (e) => X(e) ? Math.max(e / 1.25, 0.25) : 0.75
433
435
  );
434
436
  },
435
- onZoomPreset: (e) => y(e),
436
- onOpenSearch: () => G(!0),
437
- onPrint: $,
438
- searchOpen: j,
439
- onSearchOpenChange: G,
440
- searchQuery: ue,
437
+ onZoomPreset: (e) => p(e),
438
+ onOpenSearch: () => j(!0),
439
+ onPrint: Y,
440
+ searchOpen: G,
441
+ onSearchOpenChange: j,
442
+ searchQuery: I,
441
443
  onSearchQueryChange: (e) => {
442
- fe(e);
444
+ me(e);
443
445
  },
444
- searchMatches: Ce,
445
- register: Ae,
446
- focusIndex: ne,
447
- setFocusIndex: ge,
448
- onToolbarKeyDown: Re,
449
- isRtl: z
446
+ searchMatches: Ie,
447
+ register: Oe,
448
+ focusIndex: oe,
449
+ setFocusIndex: be,
450
+ onToolbarKeyDown: je,
451
+ isRtl: y
450
452
  }
451
453
  ) : null,
452
- /* @__PURE__ */ a("div", { "aria-live": "polite", "aria-atomic": "true", className: "ds:sr-only", children: n }),
453
- /* @__PURE__ */ a(
454
+ /* @__PURE__ */ n("div", { "aria-live": "polite", "aria-atomic": "true", className: "ds:sr-only", children: O }),
455
+ /* @__PURE__ */ n(
454
456
  "div",
455
457
  {
456
- ref: re,
457
- className: Ge(),
458
+ ref: se,
459
+ className: et(),
458
460
  "data-testid": "pdf-pages-container",
459
461
  children: s ? Array.from({ length: s.numPages }, (e, r) => r + 1).map(
460
- (e) => /* @__PURE__ */ a(
461
- nt,
462
+ (e) => /* @__PURE__ */ n(
463
+ st,
462
464
  {
463
465
  pageNumber: e,
464
466
  totalPages: s.numPages,
465
467
  doc: s.doc,
466
- zoom: O,
467
- container: re.current,
468
- resizeTick: De,
469
- shouldRender: e >= I.start && e <= I.end,
468
+ zoom: x,
469
+ pageRotation: b,
470
+ renderPageOverlay: g,
471
+ container: se.current,
472
+ resizeTick: Te,
473
+ shouldRender: e >= a.start && e <= a.end,
470
474
  registerRef: (r) => {
471
- oe.current[e - 1] = r;
475
+ ce.current[e - 1] = r;
472
476
  },
473
- searchQuery: ue,
477
+ searchQuery: I,
474
478
  onMatchCount: (r) => {
475
- Ne((d) => r === 0 && d.total === 0 ? d : {
476
- current: Math.min(d.current || 1, r || 1),
477
- total: Math.max(d.total, r)
479
+ De((l) => r === 0 && l.total === 0 ? l : {
480
+ current: Math.min(l.current || 1, r || 1),
481
+ total: Math.max(l.total, r)
478
482
  });
479
483
  }
480
484
  },
481
485
  e
482
486
  )
483
487
  ) : /* @__PURE__ */ Z("div", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[var(--muted-foreground)] ds:p-[var(--spacing-lg)]", children: [
484
- /* @__PURE__ */ a(Ee, { size: "sm", label: S("pdf.loading") }),
485
- /* @__PURE__ */ a("span", { children: S("pdf.loading") })
488
+ /* @__PURE__ */ n(Le, { size: "sm", label: C("pdf.loading") }),
489
+ /* @__PURE__ */ n("span", { children: C("pdf.loading") })
486
490
  ] })
487
491
  }
488
492
  )
@@ -492,59 +496,59 @@ const tt = je(
492
496
  );
493
497
  }
494
498
  );
495
- tt.displayName = "PDFViewer";
496
- function rt(i) {
497
- const { t } = le(), {
499
+ nt.displayName = "PDFViewer";
500
+ function at(i) {
501
+ const { t } = pe(), {
498
502
  currentPage: u,
499
- numPages: h,
500
- zoom: f,
503
+ numPages: v,
504
+ zoom: b,
501
505
  onPrev: g,
502
- onNext: k,
503
- onJump: p,
504
- onZoomIn: N,
505
- onZoomOut: P,
506
- onZoomPreset: R,
507
- onOpenSearch: S,
506
+ onNext: z,
507
+ onJump: m,
508
+ onZoomIn: P,
509
+ onZoomOut: S,
510
+ onZoomPreset: B,
511
+ onOpenSearch: A,
508
512
  onPrint: V,
509
- searchOpen: B,
510
- onSearchOpenChange: z,
511
- searchQuery: q,
512
- onSearchQueryChange: v,
513
+ searchOpen: C,
514
+ onSearchOpenChange: F,
515
+ searchQuery: E,
516
+ onSearchQueryChange: y,
513
517
  searchMatches: K,
514
- register: s,
515
- focusIndex: F,
516
- setFocusIndex: c,
517
- onToolbarKeyDown: b
518
- } = i, [l, E] = m(String(u));
519
- w(() => {
520
- E(String(u));
518
+ register: f,
519
+ focusIndex: H,
520
+ setFocusIndex: s,
521
+ onToolbarKeyDown: W
522
+ } = i, [Q, d] = h(String(u));
523
+ k(() => {
524
+ d(String(u));
521
525
  }, [u]);
522
- const O = u <= 1, y = u >= h;
523
- function I() {
524
- const n = Number(l);
525
- Number.isFinite(n) && n >= 1 ? p(Math.min(n, h)) : E(String(u));
526
+ const c = u <= 1, N = u >= v;
527
+ function x() {
528
+ const a = Number(Q);
529
+ Number.isFinite(a) && a >= 1 ? m(Math.min(a, v)) : d(String(u));
526
530
  }
527
- function M(n) {
528
- return /* @__PURE__ */ a(
531
+ function p(a) {
532
+ return /* @__PURE__ */ n(
529
533
  "button",
530
534
  {
531
535
  type: "button",
532
- ref: s(n.index),
533
- tabIndex: n.index === F ? 0 : -1,
534
- onFocus: () => c(n.index),
535
- onKeyDown: b,
536
- "aria-label": n.label,
537
- "aria-disabled": n.disabled || void 0,
538
- title: n.label,
539
- onClick: (x) => {
540
- if (n.disabled) {
541
- x.preventDefault();
536
+ ref: f(a.index),
537
+ tabIndex: a.index === H ? 0 : -1,
538
+ onFocus: () => s(a.index),
539
+ onKeyDown: W,
540
+ "aria-label": a.label,
541
+ "aria-disabled": a.disabled || void 0,
542
+ title: a.label,
543
+ onClick: (w) => {
544
+ if (a.disabled) {
545
+ w.preventDefault();
542
546
  return;
543
547
  }
544
- n.onActivate();
548
+ a.onActivate();
545
549
  },
546
- className: we(),
547
- children: n.icon
550
+ className: ze(),
551
+ children: a.icon
548
552
  }
549
553
  );
550
554
  }
@@ -553,86 +557,86 @@ function rt(i) {
553
557
  {
554
558
  role: "toolbar",
555
559
  "aria-label": t("pdf.toolbarLabel"),
556
- className: $e(),
560
+ className: Ge(),
557
561
  children: [
558
- M({
562
+ p({
559
563
  index: 0,
560
564
  label: t("pdf.previousPage"),
561
- disabled: O,
565
+ disabled: c,
562
566
  onActivate: g,
563
- icon: /* @__PURE__ */ a(
564
- Ze,
567
+ icon: /* @__PURE__ */ n(
568
+ Ke,
565
569
  {
566
570
  "aria-hidden": "true",
567
571
  className: "ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180"
568
572
  }
569
573
  )
570
574
  }),
571
- M({
575
+ p({
572
576
  index: 1,
573
577
  label: t("pdf.nextPage"),
574
- disabled: y,
575
- onActivate: k,
576
- icon: /* @__PURE__ */ a(
577
- Be,
578
+ disabled: N,
579
+ onActivate: z,
580
+ icon: /* @__PURE__ */ n(
581
+ He,
578
582
  {
579
583
  "aria-hidden": "true",
580
584
  className: "ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180"
581
585
  }
582
586
  )
583
587
  }),
584
- /* @__PURE__ */ a(
588
+ /* @__PURE__ */ n(
585
589
  "input",
586
590
  {
587
591
  type: "number",
588
592
  min: 1,
589
- max: Math.max(h, 1),
590
- value: l,
591
- onChange: (n) => E(n.target.value),
592
- onKeyDown: (n) => {
593
- n.key === "Enter" && (n.preventDefault(), I());
593
+ max: Math.max(v, 1),
594
+ value: Q,
595
+ onChange: (a) => d(a.target.value),
596
+ onKeyDown: (a) => {
597
+ a.key === "Enter" && (a.preventDefault(), x());
594
598
  },
595
- onBlur: I,
596
- onFocus: () => c(2),
597
- ref: s(2),
598
- tabIndex: F === 2 ? 0 : -1,
599
+ onBlur: x,
600
+ onFocus: () => s(2),
601
+ ref: f(2),
602
+ tabIndex: H === 2 ? 0 : -1,
599
603
  "aria-label": t("pdf.currentPageInput"),
600
- className: ke()
604
+ className: Pe()
601
605
  }
602
606
  ),
603
- /* @__PURE__ */ a(
607
+ /* @__PURE__ */ n(
604
608
  "span",
605
609
  {
606
610
  "aria-hidden": "true",
607
611
  className: "type-body-sm ds:text-[var(--muted-foreground)]",
608
- children: t("pdf.pageOf", { current: u, total: h || 0 })
612
+ children: t("pdf.pageOf", { current: u, total: v || 0 })
609
613
  }
610
614
  ),
611
- /* @__PURE__ */ a(
615
+ /* @__PURE__ */ n(
612
616
  "span",
613
617
  {
614
618
  "aria-hidden": "true",
615
619
  className: "ds:inline-block ds:block-size-6 ds:inline-size-px ds:bg-[var(--border)] ds:ms-[var(--spacing-xs)] ds:me-[var(--spacing-xs)]"
616
620
  }
617
621
  ),
618
- M({
622
+ p({
619
623
  index: 3,
620
624
  label: t("pdf.zoom.out"),
621
- onActivate: P,
622
- icon: /* @__PURE__ */ a(
623
- Ue,
625
+ onActivate: S,
626
+ icon: /* @__PURE__ */ n(
627
+ $e,
624
628
  {
625
629
  "aria-hidden": "true",
626
630
  className: "ds:block-size-4 ds:inline-size-4"
627
631
  }
628
632
  )
629
633
  }),
630
- M({
634
+ p({
631
635
  index: 4,
632
636
  label: t("pdf.zoom.in"),
633
- onActivate: N,
634
- icon: /* @__PURE__ */ a(
635
- We,
637
+ onActivate: P,
638
+ icon: /* @__PURE__ */ n(
639
+ Ue,
636
640
  {
637
641
  "aria-hidden": "true",
638
642
  className: "ds:block-size-4 ds:inline-size-4"
@@ -643,44 +647,44 @@ function rt(i) {
643
647
  "select",
644
648
  {
645
649
  "aria-label": t("pdf.zoom.preset"),
646
- value: typeof f == "number" ? String(f) : f,
647
- onChange: (n) => {
648
- const x = n.target.value;
649
- if (x === "fit-width" || x === "fit-page" || x === "actual-size")
650
- R(x);
650
+ value: typeof b == "number" ? String(b) : b,
651
+ onChange: (a) => {
652
+ const w = a.target.value;
653
+ if (w === "fit-width" || w === "fit-page" || w === "actual-size")
654
+ B(w);
651
655
  else {
652
- const j = Number(x);
653
- Number.isFinite(j) && R(j);
656
+ const O = Number(w);
657
+ Number.isFinite(O) && B(O);
654
658
  }
655
659
  },
656
- ref: s(5),
657
- tabIndex: F === 5 ? 0 : -1,
658
- onFocus: () => c(5),
659
- onKeyDown: b,
660
- className: Xe(),
660
+ ref: f(5),
661
+ tabIndex: H === 5 ? 0 : -1,
662
+ onFocus: () => s(5),
663
+ onKeyDown: W,
664
+ className: Ye(),
661
665
  children: [
662
- /* @__PURE__ */ a("option", { value: "fit-width", children: t("pdf.zoom.fitWidth") }),
663
- /* @__PURE__ */ a("option", { value: "fit-page", children: t("pdf.zoom.fitPage") }),
664
- /* @__PURE__ */ a("option", { value: "actual-size", children: t("pdf.zoom.actualSize") }),
665
- et.filter(J).map((n) => /* @__PURE__ */ a("option", { value: String(n), children: `${Math.round(n * 100)}%` }, n))
666
+ /* @__PURE__ */ n("option", { value: "fit-width", children: t("pdf.zoom.fitWidth") }),
667
+ /* @__PURE__ */ n("option", { value: "fit-page", children: t("pdf.zoom.fitPage") }),
668
+ /* @__PURE__ */ n("option", { value: "actual-size", children: t("pdf.zoom.actualSize") }),
669
+ rt.filter(X).map((a) => /* @__PURE__ */ n("option", { value: String(a), children: `${Math.round(a * 100)}%` }, a))
666
670
  ]
667
671
  }
668
672
  ),
669
- /* @__PURE__ */ Z(X.Root, { open: B, onOpenChange: z, children: [
670
- /* @__PURE__ */ a(X.Trigger, { asChild: !0, children: M({
673
+ /* @__PURE__ */ Z(ee.Root, { open: C, onOpenChange: F, children: [
674
+ /* @__PURE__ */ n(ee.Trigger, { asChild: !0, children: p({
671
675
  index: 6,
672
676
  label: t("pdf.search.open"),
673
- onActivate: S,
674
- icon: /* @__PURE__ */ a(
675
- Ke,
677
+ onActivate: A,
678
+ icon: /* @__PURE__ */ n(
679
+ We,
676
680
  {
677
681
  "aria-hidden": "true",
678
682
  className: "ds:block-size-4 ds:inline-size-4"
679
683
  }
680
684
  )
681
685
  }) }),
682
- /* @__PURE__ */ a(X.Portal, { children: /* @__PURE__ */ Z(
683
- X.Content,
686
+ /* @__PURE__ */ n(ee.Portal, { children: /* @__PURE__ */ Z(
687
+ ee.Content,
684
688
  {
685
689
  sideOffset: 8,
686
690
  className: [
@@ -692,21 +696,21 @@ function rt(i) {
692
696
  "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]"
693
697
  ].join(" "),
694
698
  children: [
695
- /* @__PURE__ */ a(
699
+ /* @__PURE__ */ n(
696
700
  "input",
697
701
  {
698
702
  type: "search",
699
703
  autoFocus: !0,
700
- value: q,
701
- onChange: (n) => v(n.target.value),
704
+ value: E,
705
+ onChange: (a) => y(a.target.value),
702
706
  placeholder: t("pdf.search.placeholder"),
703
707
  "aria-label": t("pdf.search.placeholder"),
704
- className: ke({
708
+ className: Pe({
705
709
  className: "ds:inline-size-[16rem] ds:text-start"
706
710
  })
707
711
  }
708
712
  ),
709
- /* @__PURE__ */ a(
713
+ /* @__PURE__ */ n(
710
714
  "span",
711
715
  {
712
716
  "aria-live": "polite",
@@ -714,17 +718,17 @@ function rt(i) {
714
718
  children: K.total > 0 ? t("pdf.search.countOfTotal", {
715
719
  current: K.current,
716
720
  total: K.total
717
- }) : q ? t("pdf.search.noResults") : ""
721
+ }) : E ? t("pdf.search.noResults") : ""
718
722
  }
719
723
  ),
720
- /* @__PURE__ */ a(X.Close, { asChild: !0, children: /* @__PURE__ */ a(
724
+ /* @__PURE__ */ n(ee.Close, { asChild: !0, children: /* @__PURE__ */ n(
721
725
  "button",
722
726
  {
723
727
  type: "button",
724
728
  "aria-label": t("pdf.search.close"),
725
- className: we(),
726
- children: /* @__PURE__ */ a(
727
- Le,
729
+ className: ze(),
730
+ children: /* @__PURE__ */ n(
731
+ Be,
728
732
  {
729
733
  "aria-hidden": "true",
730
734
  className: "ds:block-size-4 ds:inline-size-4"
@@ -736,12 +740,12 @@ function rt(i) {
736
740
  }
737
741
  ) })
738
742
  ] }),
739
- M({
743
+ p({
740
744
  index: 7,
741
745
  label: t("pdf.print"),
742
746
  onActivate: V,
743
- icon: /* @__PURE__ */ a(
744
- He,
747
+ icon: /* @__PURE__ */ n(
748
+ Qe,
745
749
  {
746
750
  "aria-hidden": "true",
747
751
  className: "ds:block-size-4 ds:inline-size-4"
@@ -752,112 +756,117 @@ function rt(i) {
752
756
  }
753
757
  );
754
758
  }
755
- function nt(i) {
759
+ function st(i) {
756
760
  const {
757
761
  pageNumber: t,
758
762
  totalPages: u,
759
- doc: h,
760
- zoom: f,
761
- container: g,
762
- resizeTick: k,
763
- shouldRender: p,
764
- registerRef: N,
765
- searchQuery: P,
766
- onMatchCount: R
767
- } = i, { t: S } = le(), V = A(null), B = A(null), [z, q] = m({
763
+ doc: v,
764
+ zoom: b,
765
+ pageRotation: g,
766
+ renderPageOverlay: z,
767
+ container: m,
768
+ resizeTick: P,
769
+ shouldRender: S,
770
+ registerRef: B,
771
+ searchQuery: A,
772
+ onMatchCount: V
773
+ } = i, { t: C } = pe(), F = T(null), E = T(null), [y, K] = h({
768
774
  width: 612,
769
775
  height: 792
770
- }), [v, K] = m(null);
771
- w(() => {
772
- let c = !1;
773
- return h.getPage(t).then((b) => {
774
- c || K(b);
776
+ }), [f, H] = h(null);
777
+ k(() => {
778
+ let d = !1;
779
+ return v.getPage(t).then((c) => {
780
+ d || H(c);
775
781
  }), () => {
776
- c = !0;
782
+ d = !0;
777
783
  };
778
- }, [h, t]), w(() => {
779
- if (!v) return;
780
- const c = v.getViewport({ scale: 1 }), b = ze(f, c, g), l = v.getViewport({ scale: b });
781
- q({
782
- width: Math.floor(l.width),
783
- height: Math.floor(l.height)
784
+ }, [v, t]), k(() => {
785
+ if (!f) return;
786
+ const d = (p) => g === void 0 ? { scale: p } : { scale: p, rotation: g }, c = f.getViewport(d(1)), N = Se(b, c, m), x = f.getViewport(d(N));
787
+ K({
788
+ width: Math.floor(x.width),
789
+ height: Math.floor(x.height)
784
790
  });
785
- }, [v, f, g, k]), w(() => {
786
- if (!v || !p) {
787
- const j = V.current;
788
- j && !p && (j.width = 0);
791
+ }, [f, b, m, P, g]);
792
+ const s = g ?? (f == null ? void 0 : f.rotate) ?? 0;
793
+ k(() => {
794
+ if (!f || !S) {
795
+ const I = F.current;
796
+ I && !S && (I.width = 0);
789
797
  return;
790
798
  }
791
- const c = V.current, b = B.current;
792
- if (!c) return;
793
- const l = c.getContext("2d");
794
- if (!l) return;
795
- const E = v.getViewport({ scale: 1 }), O = ze(f, E, g), y = v.getViewport({ scale: O }), I = Math.max(1, window.devicePixelRatio || 1);
796
- c.width = Math.floor(y.width * I), c.height = Math.floor(y.height * I), l.setTransform(I, 0, 0, I, 0, 0);
797
- const M = v.render({
798
- canvas: c,
799
- canvasContext: l,
800
- viewport: y
799
+ const d = F.current, c = E.current;
800
+ if (!d) return;
801
+ const N = d.getContext("2d");
802
+ if (!N) return;
803
+ const x = (I) => g === void 0 ? { scale: I } : { scale: I, rotation: g }, p = f.getViewport(x(1)), a = Se(b, p, m), w = f.getViewport(x(a)), O = Math.max(1, window.devicePixelRatio || 1);
804
+ d.width = Math.floor(w.width * O), d.height = Math.floor(w.height * O), N.setTransform(O, 0, 0, O, 0, 0);
805
+ const te = f.render({
806
+ canvas: d,
807
+ canvasContext: N,
808
+ viewport: w
801
809
  });
802
- let n = !1, x = null;
803
- return M.promise.then(async () => {
804
- if (n || !b) return;
805
- b.textContent = "";
806
- const j = await v.getTextContent();
807
- n || (x = new ce.TextLayer({
808
- textContentSource: j,
809
- container: b,
810
- viewport: y
811
- }), await x.render(), Pe(b, P, R));
810
+ let G = !1, j = null;
811
+ return te.promise.then(async () => {
812
+ if (G || !c) return;
813
+ c.textContent = "";
814
+ const I = await f.getTextContent();
815
+ G || (j = new fe.TextLayer({
816
+ textContentSource: I,
817
+ container: c,
818
+ viewport: w
819
+ }), await j.render(), Ce(c, A, V));
812
820
  }).catch(() => {
813
821
  }), () => {
814
- n = !0;
822
+ G = !0;
815
823
  try {
816
- M.cancel();
824
+ te.cancel();
817
825
  } catch {
818
826
  }
819
- if (x)
827
+ if (j)
820
828
  try {
821
- x.cancel();
829
+ j.cancel();
822
830
  } catch {
823
831
  }
824
832
  };
825
833
  }, [
826
- v,
827
- p,
828
834
  f,
829
- g,
830
- k,
835
+ S,
836
+ b,
837
+ m,
831
838
  P,
832
- R
833
- ]), w(() => {
834
- if (!p) return;
835
- const c = B.current;
836
- c && Pe(c, P, R);
837
- }, [P, p, R]);
838
- const s = {
839
- width: z.width,
840
- height: z.height
841
- }, F = {
842
- width: z.width,
843
- height: z.height
839
+ A,
840
+ V,
841
+ g
842
+ ]), k(() => {
843
+ if (!S) return;
844
+ const d = E.current;
845
+ d && Ce(d, A, V);
846
+ }, [A, S, V]);
847
+ const W = {
848
+ width: y.width,
849
+ height: y.height
850
+ }, Q = {
851
+ width: y.width,
852
+ height: y.height
844
853
  };
845
854
  return /* @__PURE__ */ Z(
846
855
  "article",
847
856
  {
848
- ref: (c) => {
849
- N(c);
857
+ ref: (d) => {
858
+ B(d);
850
859
  },
851
860
  "data-page-number": t,
852
- "aria-label": S("pdf.pageOf", { current: t, total: u }),
853
- className: Ye(),
854
- style: F,
861
+ "aria-label": C("pdf.pageOf", { current: t, total: u }),
862
+ className: tt(),
863
+ style: Q,
855
864
  children: [
856
- /* @__PURE__ */ a("canvas", { ref: V, style: s }),
857
- /* @__PURE__ */ a(
865
+ /* @__PURE__ */ n("canvas", { ref: F, style: W }),
866
+ /* @__PURE__ */ n(
858
867
  "div",
859
868
  {
860
- ref: B,
869
+ ref: E,
861
870
  "aria-hidden": "false",
862
871
  className: [
863
872
  "ds:absolute ds:inset-0",
@@ -870,26 +879,42 @@ function nt(i) {
870
879
  "ds:[&_[data-match=current]]:bg-[color-mix(in_srgb,var(--warning)_60%,transparent)]"
871
880
  ].join(" ")
872
881
  }
873
- )
882
+ ),
883
+ S && z ? /* @__PURE__ */ n(
884
+ "div",
885
+ {
886
+ role: "group",
887
+ "aria-label": C("pdf.pageOverlay", { page: t }),
888
+ className: "ds:absolute ds:inset-0 ds:pointer-events-auto",
889
+ "data-pdf-page-overlay": "",
890
+ "data-page-number": t,
891
+ children: z({
892
+ pageNumber: t,
893
+ pageWidthCss: y.width,
894
+ pageHeightCss: y.height,
895
+ rotation: s
896
+ })
897
+ }
898
+ ) : null
874
899
  ]
875
900
  }
876
901
  );
877
902
  }
878
- function Pe(i, t, u) {
879
- if (i.querySelectorAll("[data-match]").forEach((p) => {
880
- p.removeAttribute("data-match");
903
+ function Ce(i, t, u) {
904
+ if (i.querySelectorAll("[data-match]").forEach((m) => {
905
+ m.removeAttribute("data-match");
881
906
  }), !t) {
882
907
  u(0);
883
908
  return;
884
909
  }
885
- const f = t.toLowerCase();
910
+ const b = t.toLowerCase();
886
911
  let g = 0;
887
- i.querySelectorAll("span").forEach((p) => {
888
- (p.textContent ?? "").toLowerCase().includes(f) && (p.setAttribute("data-match", "true"), g += 1);
912
+ i.querySelectorAll("span").forEach((m) => {
913
+ (m.textContent ?? "").toLowerCase().includes(b) && (m.setAttribute("data-match", "true"), g += 1);
889
914
  }), u(g);
890
915
  }
891
916
  export {
892
- tt as P,
893
- Je as p
917
+ nt as P,
918
+ Xe as p
894
919
  };
895
- //# sourceMappingURL=pdf-viewer-CNETPubN.js.map
920
+ //# sourceMappingURL=pdf-viewer-CnEJvmXC.js.map