@nxgt/material 3.10.2 → 3.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.
- package/CHANGELOG.md +70 -0
- package/README.md +4 -4
- package/dist/{async-slice-DDjaJY_F.js → async-slice-4qbER86I.js} +1 -1
- package/dist/button-BNjw-pnE.js +327 -0
- package/dist/button-group-context-CaP0X5p_.js +5 -0
- package/dist/{button-tones-BgZJ1tkD.js → button-tones-BwuVvAmd.js} +9 -1
- package/dist/{callout-view-DdJPdFrP.js → callout-view-C6voDS00.js} +1 -1
- package/dist/charts.js +5 -5
- package/dist/{chip-DpySRqCy.js → chip-DLgQTJBZ.js} +4 -4
- package/dist/{code-editor-BiA14xua.js → code-editor-BZbaYLvo.js} +8 -8
- package/dist/code-editor.js +7 -7
- package/dist/{code-language-items-C_dJ6GVs.js → code-language-items-BT5BO5w6.js} +2 -2
- package/dist/components/base.css +21 -6
- package/dist/components/components.css +5 -2
- package/dist/components/type-scale.css +194 -0
- package/dist/components/ui/actions/button/button.css +156 -0
- package/dist/components/ui/actions/button-group/button-group-standard.css +131 -0
- package/dist/components/ui/actions/button-group/button-group.css +4 -1
- package/dist/components/ui/actions/icon-button/icon-button.css +115 -0
- package/dist/components/ui/actions/morph-fill.css +62 -0
- package/dist/{components-BkF9N-Yx.js → components-1GK7YIhY.js} +14685 -14688
- package/dist/components.js +23 -23
- package/dist/{dialog-CkIYpJXk.js → dialog-BQp5IdFl.js} +147 -147
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-BC5Tbhb9.js → dropdown-menu-BsH9W_3C.js} +3 -3
- package/dist/editor-viewer.js +1 -1
- package/dist/editor.js +13 -13
- package/dist/{empty-state-SeAg2TOX.js → empty-state-WaU4-T2c.js} +5 -5
- package/dist/escape-owner-C4W_sOAU.js +116 -0
- package/dist/{field-blur-DPLsMufs.js → field-blur-CJHzVSh9.js} +1 -1
- package/dist/{field-blur-context-1ZwJgsHE.js → field-blur-context-Cft9s7Hg.js} +2 -2
- package/dist/{hover-card-Cox-tPDz.js → hover-card-C0fw2kLK.js} +72 -71
- package/dist/i18n.js +12 -12
- package/dist/{icon-badge-q3Ve8gra.js → icon-badge-DUAq9f7H.js} +4 -4
- package/dist/icon-button-ifTpXt0A.js +355 -0
- package/dist/{illustration-BfHRpVzM.js → illustration-BmQmvW_4.js} +1 -1
- package/dist/illustrations.js +2 -2
- package/dist/lib/components/ui/actions/button/button-tones.d.ts +16 -0
- package/dist/lib/components/ui/actions/button/button.d.ts +13 -0
- package/dist/lib/components/ui/actions/button/button.variants.d.ts +4 -3
- package/dist/lib/components/ui/actions/button-group/button-group-context.d.ts +16 -0
- package/dist/lib/components/ui/actions/button-group/button-group-reset.d.ts +13 -0
- package/dist/lib/components/ui/actions/button-group/button-group.d.ts +19 -2
- package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +3 -2
- package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +18 -4
- package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +34 -4
- package/dist/lib/components/ui/feedback/typing-indicator/typing-indicator.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dialog/dialog-variants.d.ts +1 -1
- package/dist/lib/components/ui/primitives/toggle/toggle.d.ts +1 -1
- package/dist/lib/components/ui/primitives/typography/typography.d.ts +17 -7
- package/dist/lib/components/ui/primitives/typography/typography.variants.d.ts +55 -0
- package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +2 -2
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +2 -2
- package/dist/{line-path-BQeLQZ-P.js → line-path-C5pZGC49.js} +1 -1
- package/dist/main.js +29 -29
- package/dist/map.js +9 -9
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +1 -1
- package/dist/{public-CtpsxV4I.js → public-B0Nq_yYV.js} +524 -524
- package/dist/{render-json-DyFYFIkZ.js → render-json-BOhvPnSv.js} +1 -1
- package/dist/{rich-code-block-C2Fp_FDU.js → rich-code-block-v7WmeZp9.js} +5 -5
- package/dist/{rich-text-viewer-LO1IZCWs.js → rich-text-viewer-W15XIwah.js} +2 -2
- package/dist/{skeleton-Bmp4gWAH.js → skeleton-DSdtr2qc.js} +1 -1
- package/dist/{sortable-provider-pVaEZzty.js → sortable-provider-CgDTolQR.js} +3 -3
- package/dist/{spinner-CsHcmcpF.js → spinner-BtSIYVrC.js} +3 -3
- package/dist/{state-scenes-SGNyZjTz.js → state-scenes-BX03WmSu.js} +1 -1
- package/dist/styles.css +2 -0
- package/dist/theme-picker.js +3 -3
- package/dist/{theme-toggle-oU-fh6WE.js → theme-toggle-B2Pehdhn.js} +2 -2
- package/dist/{toggle-group-j8zaxEg1.js → toggle-group-BMJNcFAC.js} +1 -1
- package/dist/{toolbar-items-CqHvlTU8.js → toolbar-items-rUHdVqAq.js} +399 -398
- package/dist/{tooltip-rhbqNmr3.js → tooltip-CkttDIab.js} +1 -1
- package/dist/{translate-material-CGZljjp1.js → translate-material-Bd_KgfB8.js} +1 -1
- package/dist/{translator-DCYO4Ij3.js → translator-Dje8HrNz.js} +5 -5
- package/dist/{use-chat-composer-nWWfVyrK.js → use-chat-composer-Bt2ULsv6.js} +4172 -4172
- package/dist/{use-material-translation-DkxcLbLM.js → use-material-translation-B3V_bz-5.js} +1 -1
- package/dist/{utils-Bcd2Z3ea.js → utils-BLfntITJ.js} +14 -1
- package/docs/components/buttons-and-actions.md +64 -15
- package/docs/components/navigation-and-layout.md +1 -1
- package/docs/components/primitives.md +52 -10
- package/docs/guides/theming.md +51 -0
- package/docs/previews/buttons-actions-button.webp +0 -0
- package/docs/previews/buttons-actions-iconbutton.webp +0 -0
- package/docs/previews/primitives-typography.webp +0 -0
- package/docs/roadmap.md +35 -4
- package/docs/troubleshooting.md +58 -2
- package/lib/components/base.css +21 -6
- package/lib/components/components.css +5 -2
- package/lib/components/type-scale.css +194 -0
- package/lib/components/ui/actions/button/button.css +156 -0
- package/lib/components/ui/actions/button-group/button-group-standard.css +131 -0
- package/lib/components/ui/actions/button-group/button-group.css +4 -1
- package/lib/components/ui/actions/icon-button/icon-button.css +115 -0
- package/lib/components/ui/actions/morph-fill.css +62 -0
- package/lib/styles.css +2 -0
- package/package.json +1 -1
- package/dist/button-DbfdITBB.js +0 -322
- package/dist/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
- package/dist/components/ui/actions/icon-button/icon-button-morph.css +0 -152
- package/dist/escape-owner-CripBce_.js +0 -57
- package/dist/icon-button-DJcWpIhu.js +0 -319
- package/lib/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
- package/lib/components/ui/actions/icon-button/icon-button-morph.css +0 -152
|
@@ -1,59 +1,60 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
2
|
import { n as t } from "./ui.utils-CAnKTCw5.js";
|
|
3
|
-
import { t as n } from "./utils-
|
|
3
|
+
import { t as n } from "./utils-BLfntITJ.js";
|
|
4
4
|
import { o as r } from "./dist-DVRQkaTK.js";
|
|
5
5
|
import { c as i, i as a, l as o, n as s, o as c, s as l } from "./dist-lmHmz_bu.js";
|
|
6
|
-
import { a as u, o as d } from "./tooltip-
|
|
6
|
+
import { a as u, o as d } from "./tooltip-CkttDIab.js";
|
|
7
7
|
import { i as f } from "./dist-C4wtXCjf.js";
|
|
8
8
|
import { r as p, t as m } from "./in-dialog-Vwkyp-M5.js";
|
|
9
|
-
import { C as h, D as g, E as _, O as v, S as y, T as b, _ as x, f as S, g as ee, k as te, r as ne, t as C, u as re, w } from "./dialog-
|
|
10
|
-
import { c as T, d as ie, f as E, i as ae, l as oe, n as se, o as D, t as ce, u as O } from "./dropdown-menu-
|
|
11
|
-
import { S as le, a as k, d as A, g as ue, h as de, i as fe, m as pe, n as j, r as me, t as M, u as he, w as ge } from "./toolbar-items-
|
|
12
|
-
import { t as N } from "./use-material-translation-
|
|
13
|
-
import { t as _e } from "./button-
|
|
14
|
-
import { n as ve, t as ye } from "./icon-button-
|
|
9
|
+
import { C as h, D as g, E as _, O as v, S as y, T as b, _ as x, f as S, g as ee, k as te, r as ne, t as C, u as re, w } from "./dialog-BQp5IdFl.js";
|
|
10
|
+
import { c as T, d as ie, f as E, i as ae, l as oe, n as se, o as D, t as ce, u as O } from "./dropdown-menu-BsH9W_3C.js";
|
|
11
|
+
import { S as le, a as k, d as A, g as ue, h as de, i as fe, m as pe, n as j, r as me, t as M, u as he, w as ge } from "./toolbar-items-rUHdVqAq.js";
|
|
12
|
+
import { t as N } from "./use-material-translation-B3V_bz-5.js";
|
|
13
|
+
import { t as _e } from "./button-BNjw-pnE.js";
|
|
14
|
+
import { n as ve, t as ye } from "./icon-button-ifTpXt0A.js";
|
|
15
15
|
import { t as be } from "./useEvent-2fKq-6w8.js";
|
|
16
|
-
import { n as xe, t as Se } from "./toggle-group-
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { t as De } from "./
|
|
21
|
-
import { t as Oe } from "./
|
|
22
|
-
import {
|
|
16
|
+
import { n as xe, t as Se } from "./toggle-group-BMJNcFAC.js";
|
|
17
|
+
import { o as Ce } from "./escape-owner-C4W_sOAU.js";
|
|
18
|
+
import { n as we } from "./use-slice-reducer-BGkeGtML.js";
|
|
19
|
+
import { r as Te } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
20
|
+
import { n as Ee, t as De } from "./empty-state-WaU4-T2c.js";
|
|
21
|
+
import { t as Oe } from "./client-only.utils-3nHNzCki.js";
|
|
22
|
+
import { t as ke } from "./use-scroll-away-PQRFZkT2.js";
|
|
23
|
+
import { ArrowLeft as Ae, BookOpenText as je, ChevronDown as Me, ChevronLeft as Ne, ChevronRight as Pe, ChevronUp as Fe, Download as Ie, Eraser as Le, FileText as Re, FileWarning as ze, FileX2 as Be, Highlighter as Ve, KeyRound as He, LayoutGrid as Ue, List as We, Loader2 as Ge, Maximize as Ke, MessageSquareText as qe, Minimize as Je, MoreVertical as Ye, MousePointer2 as Xe, MoveHorizontal as Ze, PanelLeft as Qe, Pen as $e, PencilLine as et, Printer as tt, RotateCw as nt, Search as rt, StickyNote as it, Type as at, Underline as ot, Undo2 as st, Volume2 as ct, X as lt, XIcon as ut, ZoomIn as dt, ZoomOut as ft } from "lucide-react";
|
|
23
24
|
import * as P from "react";
|
|
24
|
-
import { createContext as
|
|
25
|
+
import { createContext as pt, memo as mt, useCallback as F, useContext as ht, useEffect as I, useId as gt, useLayoutEffect as L, useMemo as R, useReducer as _t, useRef as z, useState as B, useSyncExternalStore as vt } from "react";
|
|
25
26
|
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
26
|
-
import { flushSync as
|
|
27
|
-
import { createSlice as
|
|
28
|
-
import { STATE_ACTION_KEYS as
|
|
29
|
-
import { formatFileSize as
|
|
30
|
-
import { anchorAt as
|
|
31
|
-
import { DEFAULT_PAGE_SIZE as
|
|
32
|
-
import { resolvePdfFileName as
|
|
33
|
-
import { downloadPdfFile as
|
|
34
|
-
import { pdfSourceKey as
|
|
27
|
+
import { flushSync as yt } from "react-dom";
|
|
28
|
+
import { createSlice as bt } from "@reduxjs/toolkit";
|
|
29
|
+
import { STATE_ACTION_KEYS as xt, describeError as St, stateCopy as Ct } from "@nxgt/material-core/states";
|
|
30
|
+
import { formatFileSize as wt } from "@nxgt/material-core/format-file-size";
|
|
31
|
+
import { anchorAt as Tt, applyPageHighlight as Et, classifyPdfError as Dt, createPdfLinkService as Ot, layoutSpreads as kt, mountedPages as At, offsetOf as jt, openPdfDocument as Mt, pageAtOffset as Nt, planRender as Pt, renderPageToCanvas as Ft, rowStarts as It } from "@nxgt/material-core/pdf-reader";
|
|
32
|
+
import { DEFAULT_PAGE_SIZE as Lt, FIT_PAGES as Rt, createPageSizesLoader as zt, fitScale as Bt, hitAt as Vt, labelLinkAnchors as Ht, mapPdfOutline as Ut, placeholderSize as Wt, readerFitScale as Gt, resolveDestinationPage as Kt, revealHit as qt, rotatedSize as Jt, searchDocument as Yt, stepHit as Xt, withPageMatches as Zt } from "@nxgt/material-core/pdf-viewer";
|
|
33
|
+
import { resolvePdfFileName as Qt } from "@nxgt/material-core/pdf-file-name";
|
|
34
|
+
import { downloadPdfFile as $t, printPdfFile as en } from "@nxgt/material-core/pdf-download";
|
|
35
|
+
import { pdfSourceKey as tn, toPdfjsParams as nn } from "@nxgt/material-core/pdf-source";
|
|
35
36
|
//#region ../../node_modules/@radix-ui/number/dist/index.mjs
|
|
36
|
-
var
|
|
37
|
+
var rn = Object.defineProperty, an = (e, t) => rn(e, "name", {
|
|
37
38
|
value: t,
|
|
38
39
|
configurable: !0
|
|
39
40
|
});
|
|
40
|
-
function
|
|
41
|
+
function on(e, [t, n]) {
|
|
41
42
|
return Math.min(n, Math.max(t, e));
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
an(on, "clamp");
|
|
44
45
|
//#endregion
|
|
45
46
|
//#region ../../node_modules/@radix-ui/react-scroll-area/dist/index.mjs
|
|
46
|
-
var
|
|
47
|
+
var sn = Object.defineProperty, W = (e, t) => sn(e, "name", {
|
|
47
48
|
value: t,
|
|
48
49
|
configurable: !0
|
|
49
50
|
});
|
|
50
|
-
function
|
|
51
|
+
function cn(e, t) {
|
|
51
52
|
return P.useReducer((e, n) => t[e][n] ?? e, e);
|
|
52
53
|
}
|
|
53
|
-
W(
|
|
54
|
-
var
|
|
54
|
+
W(cn, "useStateMachine");
|
|
55
|
+
var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
55
56
|
let { __scopeScrollArea: n, type: i = "hover", dir: a, scrollHideDelay: s = 600, ...c } = e, [l, u] = P.useState(null), [d, p] = P.useState(null), [m, h] = P.useState(null), [g, _] = P.useState(null), [v, y] = P.useState(null), [b, x] = P.useState(0), [S, ee] = P.useState(0), [te, ne] = P.useState(!1), [C, re] = P.useState(!1), w = r(t, u), T = f(a);
|
|
56
|
-
return /* @__PURE__ */ H(
|
|
57
|
+
return /* @__PURE__ */ H(fn, {
|
|
57
58
|
scope: n,
|
|
58
59
|
type: i,
|
|
59
60
|
dir: T,
|
|
@@ -85,9 +86,9 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
85
86
|
}
|
|
86
87
|
})
|
|
87
88
|
});
|
|
88
|
-
}, "ScrollArea")),
|
|
89
|
-
let { __scopeScrollArea: n, children: i, nonce: a, ...s } = e, c = G(
|
|
90
|
-
return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(
|
|
89
|
+
}, "ScrollArea")), mn = "ScrollAreaViewport", hn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
90
|
+
let { __scopeScrollArea: n, children: i, nonce: a, ...s } = e, c = G(mn, n), l = r(t, P.useRef(null), c.onViewportChange);
|
|
91
|
+
return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(gn, { nonce: a }), /* @__PURE__ */ H(o.div, {
|
|
91
92
|
"data-radix-scroll-area-viewport": "",
|
|
92
93
|
...s,
|
|
93
94
|
ref: l,
|
|
@@ -105,12 +106,12 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
105
106
|
children: i
|
|
106
107
|
})
|
|
107
108
|
})] });
|
|
108
|
-
}, "ScrollAreaViewport")),
|
|
109
|
+
}, "ScrollAreaViewport")), gn = /* @__PURE__ */ P.memo(/* @__PURE__ */ W(function({ nonce: e }) {
|
|
109
110
|
return /* @__PURE__ */ H("style", {
|
|
110
111
|
dangerouslySetInnerHTML: { __html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}" },
|
|
111
112
|
nonce: e
|
|
112
113
|
});
|
|
113
|
-
}, "ScrollAreaViewportStyle"), (e, t) => e.nonce === t.nonce), K = "ScrollAreaScrollbar",
|
|
114
|
+
}, "ScrollAreaViewportStyle"), (e, t) => e.nonce === t.nonce), K = "ScrollAreaScrollbar", _n = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
114
115
|
let { forceMount: n, ...r } = e, i = G(K, e.__scopeScrollArea), { onScrollbarXEnabledChange: a, onScrollbarYEnabledChange: o } = i, s = e.orientation === "horizontal";
|
|
115
116
|
return P.useEffect(() => (s ? a(!0) : o(!0), () => {
|
|
116
117
|
s ? a(!1) : o(!1);
|
|
@@ -118,24 +119,24 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
118
119
|
s,
|
|
119
120
|
a,
|
|
120
121
|
o
|
|
121
|
-
]), i.type === "hover" ? /* @__PURE__ */ H(
|
|
122
|
+
]), i.type === "hover" ? /* @__PURE__ */ H(vn, {
|
|
122
123
|
...r,
|
|
123
124
|
ref: t,
|
|
124
125
|
forceMount: n
|
|
125
|
-
}) : i.type === "scroll" ? /* @__PURE__ */ H(
|
|
126
|
+
}) : i.type === "scroll" ? /* @__PURE__ */ H(yn, {
|
|
126
127
|
...r,
|
|
127
128
|
ref: t,
|
|
128
129
|
forceMount: n
|
|
129
|
-
}) : i.type === "auto" ? /* @__PURE__ */ H(
|
|
130
|
+
}) : i.type === "auto" ? /* @__PURE__ */ H(bn, {
|
|
130
131
|
...r,
|
|
131
132
|
ref: t,
|
|
132
133
|
forceMount: n
|
|
133
|
-
}) : i.type === "always" ? /* @__PURE__ */ H(
|
|
134
|
+
}) : i.type === "always" ? /* @__PURE__ */ H(xn, {
|
|
134
135
|
...r,
|
|
135
136
|
ref: t,
|
|
136
137
|
"data-state": "visible"
|
|
137
138
|
}) : null;
|
|
138
|
-
}, "ScrollAreaScrollbar")),
|
|
139
|
+
}, "ScrollAreaScrollbar")), vn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
139
140
|
let { forceMount: n, ...r } = e, i = G(K, e.__scopeScrollArea), [o, s] = P.useState(!1);
|
|
140
141
|
return P.useEffect(() => {
|
|
141
142
|
let e = i.scrollArea, t = 0;
|
|
@@ -151,14 +152,14 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
151
152
|
}
|
|
152
153
|
}, [i.scrollArea, i.scrollHideDelay]), /* @__PURE__ */ H(a, {
|
|
153
154
|
present: n || o,
|
|
154
|
-
children: /* @__PURE__ */ H(
|
|
155
|
+
children: /* @__PURE__ */ H(bn, {
|
|
155
156
|
"data-state": o ? "visible" : "hidden",
|
|
156
157
|
...r,
|
|
157
158
|
ref: t
|
|
158
159
|
})
|
|
159
160
|
});
|
|
160
|
-
}, "ScrollAreaScrollbarHover")),
|
|
161
|
-
let { forceMount: n, ...r } = e, i = G(K, e.__scopeScrollArea), o = e.orientation === "horizontal", s = Y(() => u("SCROLL_END"), 100), [c, u] =
|
|
161
|
+
}, "ScrollAreaScrollbarHover")), yn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
162
|
+
let { forceMount: n, ...r } = e, i = G(K, e.__scopeScrollArea), o = e.orientation === "horizontal", s = Y(() => u("SCROLL_END"), 100), [c, u] = cn("hidden", {
|
|
162
163
|
hidden: { SCROLL: "scrolling" },
|
|
163
164
|
scrolling: {
|
|
164
165
|
SCROLL_END: "idle",
|
|
@@ -199,7 +200,7 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
199
200
|
s
|
|
200
201
|
]), /* @__PURE__ */ H(a, {
|
|
201
202
|
present: n || c !== "hidden",
|
|
202
|
-
children: /* @__PURE__ */ H(
|
|
203
|
+
children: /* @__PURE__ */ H(xn, {
|
|
203
204
|
"data-state": c === "hidden" ? "hidden" : "visible",
|
|
204
205
|
...r,
|
|
205
206
|
ref: t,
|
|
@@ -207,7 +208,7 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
207
208
|
onPointerLeave: l(e.onPointerLeave, () => u("POINTER_LEAVE"))
|
|
208
209
|
})
|
|
209
210
|
});
|
|
210
|
-
}, "ScrollAreaScrollbarScroll")),
|
|
211
|
+
}, "ScrollAreaScrollbarScroll")), bn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
211
212
|
let n = G(K, e.__scopeScrollArea), { forceMount: r, ...i } = e, [o, s] = P.useState(!1), c = e.orientation === "horizontal", l = Y(() => {
|
|
212
213
|
if (n.viewport) {
|
|
213
214
|
let e = n.viewport.offsetWidth < n.viewport.scrollWidth, t = n.viewport.offsetHeight < n.viewport.scrollHeight;
|
|
@@ -216,13 +217,13 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
216
217
|
}, 10);
|
|
217
218
|
return X(n.viewport, l), X(n.content, l), /* @__PURE__ */ H(a, {
|
|
218
219
|
present: r || o,
|
|
219
|
-
children: /* @__PURE__ */ H(
|
|
220
|
+
children: /* @__PURE__ */ H(xn, {
|
|
220
221
|
"data-state": o ? "visible" : "hidden",
|
|
221
222
|
...i,
|
|
222
223
|
ref: t
|
|
223
224
|
})
|
|
224
225
|
});
|
|
225
|
-
}, "ScrollAreaScrollbarAuto")),
|
|
226
|
+
}, "ScrollAreaScrollbarAuto")), xn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
226
227
|
let { orientation: n = "vertical", ...r } = e, i = G(K, e.__scopeScrollArea), a = P.useRef(null), o = P.useRef(0), [s, c] = P.useState({
|
|
227
228
|
content: 0,
|
|
228
229
|
viewport: 0,
|
|
@@ -231,7 +232,7 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
231
232
|
paddingStart: 0,
|
|
232
233
|
paddingEnd: 0
|
|
233
234
|
}
|
|
234
|
-
}), l =
|
|
235
|
+
}), l = Nn(s.viewport, s.content), u = {
|
|
235
236
|
...r,
|
|
236
237
|
sizes: s,
|
|
237
238
|
onSizesChange: c,
|
|
@@ -241,14 +242,14 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
241
242
|
onThumbPointerDown: /* @__PURE__ */ W((e) => o.current = e, "onThumbPointerDown")
|
|
242
243
|
};
|
|
243
244
|
function d(e, t) {
|
|
244
|
-
return
|
|
245
|
+
return Pn(e, o.current, s, t);
|
|
245
246
|
}
|
|
246
|
-
return W(d, "getScrollPosition"), n === "horizontal" ? /* @__PURE__ */ H(
|
|
247
|
+
return W(d, "getScrollPosition"), n === "horizontal" ? /* @__PURE__ */ H(Sn, {
|
|
247
248
|
...u,
|
|
248
249
|
ref: t,
|
|
249
250
|
onThumbPositionChange: () => {
|
|
250
251
|
if (i.viewport && a.current) {
|
|
251
|
-
let e = i.viewport.scrollLeft, t =
|
|
252
|
+
let e = i.viewport.scrollLeft, t = Fn(e, s, i.dir);
|
|
252
253
|
a.current.style.transform = `translate3d(${t}px, 0, 0)`;
|
|
253
254
|
}
|
|
254
255
|
},
|
|
@@ -258,12 +259,12 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
258
259
|
onDragScroll: (e) => {
|
|
259
260
|
i.viewport && (i.viewport.scrollLeft = d(e, i.dir));
|
|
260
261
|
}
|
|
261
|
-
}) : n === "vertical" ? /* @__PURE__ */ H(
|
|
262
|
+
}) : n === "vertical" ? /* @__PURE__ */ H(Cn, {
|
|
262
263
|
...u,
|
|
263
264
|
ref: t,
|
|
264
265
|
onThumbPositionChange: () => {
|
|
265
266
|
if (i.viewport && a.current) {
|
|
266
|
-
let e = i.viewport.scrollTop, t =
|
|
267
|
+
let e = i.viewport.scrollTop, t = Fn(e, s);
|
|
267
268
|
a.current.style.transform = `translate3d(0, ${t}px, 0)`;
|
|
268
269
|
}
|
|
269
270
|
},
|
|
@@ -274,11 +275,11 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
274
275
|
i.viewport && (i.viewport.scrollTop = d(e));
|
|
275
276
|
}
|
|
276
277
|
}) : null;
|
|
277
|
-
}, "ScrollAreaScrollbarVisible")),
|
|
278
|
+
}, "ScrollAreaScrollbarVisible")), Sn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
278
279
|
let { sizes: n, onSizesChange: i, ...a } = e, o = G(K, e.__scopeScrollArea), [s, c] = P.useState(), l = P.useRef(null), u = r(t, l, o.onScrollbarXChange);
|
|
279
280
|
return P.useEffect(() => {
|
|
280
281
|
l.current && c(getComputedStyle(l.current));
|
|
281
|
-
}, [l]), /* @__PURE__ */ H(
|
|
282
|
+
}, [l]), /* @__PURE__ */ H(En, {
|
|
282
283
|
"data-orientation": "horizontal",
|
|
283
284
|
...a,
|
|
284
285
|
ref: u,
|
|
@@ -295,7 +296,7 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
295
296
|
onWheelScroll: (t, n) => {
|
|
296
297
|
if (o.viewport) {
|
|
297
298
|
let r = o.viewport.scrollLeft + t.deltaX;
|
|
298
|
-
e.onWheelScroll(r),
|
|
299
|
+
e.onWheelScroll(r), Ln(r, n) && t.preventDefault();
|
|
299
300
|
}
|
|
300
301
|
},
|
|
301
302
|
onResize: () => {
|
|
@@ -310,11 +311,11 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
310
311
|
});
|
|
311
312
|
}
|
|
312
313
|
});
|
|
313
|
-
}, "ScrollAreaScrollbarX")),
|
|
314
|
+
}, "ScrollAreaScrollbarX")), Cn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
314
315
|
let { sizes: n, onSizesChange: i, ...a } = e, o = G(K, e.__scopeScrollArea), [s, c] = P.useState(), l = P.useRef(null), u = r(t, l, o.onScrollbarYChange);
|
|
315
316
|
return P.useEffect(() => {
|
|
316
317
|
l.current && c(getComputedStyle(l.current));
|
|
317
|
-
}, [l]), /* @__PURE__ */ H(
|
|
318
|
+
}, [l]), /* @__PURE__ */ H(En, {
|
|
318
319
|
"data-orientation": "vertical",
|
|
319
320
|
...a,
|
|
320
321
|
ref: u,
|
|
@@ -332,7 +333,7 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
332
333
|
onWheelScroll: (t, n) => {
|
|
333
334
|
if (o.viewport) {
|
|
334
335
|
let r = o.viewport.scrollTop + t.deltaY;
|
|
335
|
-
e.onWheelScroll(r),
|
|
336
|
+
e.onWheelScroll(r), Ln(r, n) && t.preventDefault();
|
|
336
337
|
}
|
|
337
338
|
},
|
|
338
339
|
onResize: () => {
|
|
@@ -347,7 +348,7 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
347
348
|
});
|
|
348
349
|
}
|
|
349
350
|
});
|
|
350
|
-
}, "ScrollAreaScrollbarY")), [
|
|
351
|
+
}, "ScrollAreaScrollbarY")), [wn, Tn] = un(K), En = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
351
352
|
let { __scopeScrollArea: n, sizes: i, hasThumb: a, onThumbChange: c, onThumbPointerUp: u, onThumbPointerDown: d, onThumbPositionChange: f, onDragScroll: p, onWheelScroll: m, onResize: h, ...g } = e, _ = G(K, n), [v, y] = P.useState(null), b = r(t, y), x = P.useRef(null), S = P.useRef(""), ee = _.viewport, te = i.content - i.viewport, ne = s(m), C = s(f), re = Y(h, 10);
|
|
352
353
|
function w(e) {
|
|
353
354
|
if (x.current) {
|
|
@@ -369,7 +370,7 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
369
370
|
v,
|
|
370
371
|
te,
|
|
371
372
|
ne
|
|
372
|
-
]), P.useEffect(C, [i, C]), X(v, re), X(_.content, re), /* @__PURE__ */ H(
|
|
373
|
+
]), P.useEffect(C, [i, C]), X(v, re), X(_.content, re), /* @__PURE__ */ H(wn, {
|
|
373
374
|
scope: n,
|
|
374
375
|
scrollbar: v,
|
|
375
376
|
hasThumb: a,
|
|
@@ -394,17 +395,17 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
394
395
|
})
|
|
395
396
|
})
|
|
396
397
|
});
|
|
397
|
-
}, "ScrollAreaScrollbarImpl")),
|
|
398
|
-
let { forceMount: n, ...r } = e, i =
|
|
398
|
+
}, "ScrollAreaScrollbarImpl")), Dn = "ScrollAreaThumb", On = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
399
|
+
let { forceMount: n, ...r } = e, i = Tn(Dn, e.__scopeScrollArea);
|
|
399
400
|
return /* @__PURE__ */ H(a, {
|
|
400
401
|
present: n || i.hasThumb,
|
|
401
|
-
children: /* @__PURE__ */ H(
|
|
402
|
+
children: /* @__PURE__ */ H(kn, {
|
|
402
403
|
ref: t,
|
|
403
404
|
...r
|
|
404
405
|
})
|
|
405
406
|
});
|
|
406
|
-
}, "ScrollAreaThumb")),
|
|
407
|
-
let { __scopeScrollArea: n, style: i, ...a } = e, s = G(
|
|
407
|
+
}, "ScrollAreaThumb")), kn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
408
|
+
let { __scopeScrollArea: n, style: i, ...a } = e, s = G(Dn, n), c = Tn(Dn, n), { onThumbPositionChange: u } = c, d = r(t, c.onThumbChange), f = P.useRef(void 0), p = Y(() => {
|
|
408
409
|
f.current &&= (f.current(), void 0);
|
|
409
410
|
}, 100);
|
|
410
411
|
return P.useEffect(() => {
|
|
@@ -412,7 +413,7 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
412
413
|
if (e) {
|
|
413
414
|
let t = /* @__PURE__ */ W(() => {
|
|
414
415
|
if (p(), !f.current) {
|
|
415
|
-
let t =
|
|
416
|
+
let t = Rn(e, u);
|
|
416
417
|
f.current = t, u();
|
|
417
418
|
}
|
|
418
419
|
}, "handleScroll");
|
|
@@ -440,14 +441,14 @@ var cn = "ScrollArea", [ln, un] = i(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */
|
|
|
440
441
|
}),
|
|
441
442
|
onPointerUp: l(e.onPointerUp, c.onThumbPointerUp)
|
|
442
443
|
});
|
|
443
|
-
}, "ScrollAreaThumbImpl")),
|
|
444
|
-
let n = G(
|
|
445
|
-
return n.type !== "scroll" && r ? /* @__PURE__ */ H(
|
|
444
|
+
}, "ScrollAreaThumbImpl")), An = "ScrollAreaCorner", jn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
445
|
+
let n = G(An, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
446
|
+
return n.type !== "scroll" && r ? /* @__PURE__ */ H(Mn, {
|
|
446
447
|
...e,
|
|
447
448
|
ref: t
|
|
448
449
|
}) : null;
|
|
449
|
-
}, "ScrollAreaCorner")),
|
|
450
|
-
let { __scopeScrollArea: n, ...r } = e, i = G(
|
|
450
|
+
}, "ScrollAreaCorner")), Mn = /* @__PURE__ */ P.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
451
|
+
let { __scopeScrollArea: n, ...r } = e, i = G(An, n), [a, s] = P.useState(0), [c, l] = P.useState(0), u = !!(a && c), { onCornerWidthChange: d, onCornerHeightChange: f } = i;
|
|
451
452
|
return X(i.scrollbarX, () => {
|
|
452
453
|
let e = i.scrollbarX?.offsetHeight || 0;
|
|
453
454
|
i.onCornerHeightChange(e), l(e);
|
|
@@ -474,39 +475,39 @@ function q(e) {
|
|
|
474
475
|
return e ? parseInt(e, 10) : 0;
|
|
475
476
|
}
|
|
476
477
|
W(q, "toInt");
|
|
477
|
-
function
|
|
478
|
+
function Nn(e, t) {
|
|
478
479
|
let n = e / t;
|
|
479
480
|
return isNaN(n) ? 0 : n;
|
|
480
481
|
}
|
|
481
|
-
W(
|
|
482
|
+
W(Nn, "getThumbRatio");
|
|
482
483
|
function J(e) {
|
|
483
|
-
let t =
|
|
484
|
+
let t = Nn(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
|
|
484
485
|
return Math.max(r, 18);
|
|
485
486
|
}
|
|
486
487
|
W(J, "getThumbSize");
|
|
487
|
-
function
|
|
488
|
+
function Pn(e, t, n, r = "ltr") {
|
|
488
489
|
let i = J(n), a = i / 2, o = t || a, s = i - o, c = n.scrollbar.paddingStart + o, l = n.scrollbar.size - n.scrollbar.paddingEnd - s, u = n.content - n.viewport, d = r === "ltr" ? [0, u] : [u * -1, 0];
|
|
489
|
-
return
|
|
490
|
+
return In([c, l], d)(e);
|
|
490
491
|
}
|
|
491
|
-
W(
|
|
492
|
-
function
|
|
493
|
-
let r = J(t), i = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, a = t.scrollbar.size - i, o = t.content - t.viewport, s = a - r, c =
|
|
494
|
-
return
|
|
492
|
+
W(Pn, "getScrollPositionFromPointer");
|
|
493
|
+
function Fn(e, t, n = "ltr") {
|
|
494
|
+
let r = J(t), i = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, a = t.scrollbar.size - i, o = t.content - t.viewport, s = a - r, c = on(e, n === "ltr" ? [0, o] : [o * -1, 0]);
|
|
495
|
+
return In([0, o], [0, s])(c);
|
|
495
496
|
}
|
|
496
|
-
W(
|
|
497
|
-
function
|
|
497
|
+
W(Fn, "getThumbOffsetFromScroll");
|
|
498
|
+
function In(e, t) {
|
|
498
499
|
return (n) => {
|
|
499
500
|
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
500
501
|
let r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
501
502
|
return t[0] + r * (n - e[0]);
|
|
502
503
|
};
|
|
503
504
|
}
|
|
504
|
-
W(
|
|
505
|
-
function
|
|
505
|
+
W(In, "linearScale");
|
|
506
|
+
function Ln(e, t) {
|
|
506
507
|
return e > 0 && e < t;
|
|
507
508
|
}
|
|
508
|
-
W(
|
|
509
|
-
var
|
|
509
|
+
W(Ln, "isScrollingWithinScrollbarBounds");
|
|
510
|
+
var Rn = /* @__PURE__ */ W((e, t = () => {}) => {
|
|
510
511
|
let n = {
|
|
511
512
|
left: e.scrollLeft,
|
|
512
513
|
top: e.scrollTop
|
|
@@ -541,10 +542,10 @@ function X(e, t) {
|
|
|
541
542
|
}, [e, n]);
|
|
542
543
|
}
|
|
543
544
|
W(X, "useResizeObserver");
|
|
544
|
-
var
|
|
545
|
+
var zn = pn, Bn = hn, Vn = jn;
|
|
545
546
|
//#endregion
|
|
546
547
|
//#region lib/components/ui/actions/toolbar/toolbar-toggle-group.tsx
|
|
547
|
-
function
|
|
548
|
+
function Hn(e, t, n) {
|
|
548
549
|
let [r, i] = B(t ?? "");
|
|
549
550
|
return {
|
|
550
551
|
value: e ?? r,
|
|
@@ -553,13 +554,13 @@ function Vn(e, t, n) {
|
|
|
553
554
|
}
|
|
554
555
|
};
|
|
555
556
|
}
|
|
556
|
-
function
|
|
557
|
+
function Un(e) {
|
|
557
558
|
let { label: t, children: r, priority: i, moreAs: a, disabled: o, className: s } = e, { spilled: c, inside: l, props: u } = ue({
|
|
558
559
|
label: t,
|
|
559
560
|
group: !0,
|
|
560
561
|
choice: e.type,
|
|
561
562
|
moreAs: a
|
|
562
|
-
}, i), d = R(() => ({ spilled: c }), [c]), f =
|
|
563
|
+
}, i), d = R(() => ({ spilled: c }), [c]), f = Hn(e.type === "single" ? e.value : void 0, e.type === "single" ? e.defaultValue : void 0, e.type === "single" ? e.onValueChange : void 0), p = {
|
|
563
564
|
...u,
|
|
564
565
|
"aria-label": t,
|
|
565
566
|
disabled: o,
|
|
@@ -583,7 +584,7 @@ function Hn(e) {
|
|
|
583
584
|
onValueChange: e.onValueChange
|
|
584
585
|
});
|
|
585
586
|
}
|
|
586
|
-
function
|
|
587
|
+
function Wn({ value: e, ...t }) {
|
|
587
588
|
return /* @__PURE__ */ H(fe, {
|
|
588
589
|
...t,
|
|
589
590
|
toggle: !0,
|
|
@@ -592,7 +593,7 @@ function Un({ value: e, ...t }) {
|
|
|
592
593
|
}
|
|
593
594
|
//#endregion
|
|
594
595
|
//#region lib/components/touch-box.ts
|
|
595
|
-
var
|
|
596
|
+
var Gn = "pointer-coarse:size-11 pointer-coarse:p-1.5 pointer-coarse:bg-clip-content", Kn = `${Gn} pointer-coarse:-m-1.5`, qn = "pointer-coarse:size-11 pointer-coarse:p-1 pointer-coarse:-m-1 pointer-coarse:bg-clip-content", Jn = d("nxgt-sheet fixed z-50 flex flex-col gap-4 overflow-y-auto overscroll-contain", {
|
|
596
597
|
variants: {
|
|
597
598
|
side: {
|
|
598
599
|
right: "inset-y-0 right-0 h-full w-[calc(100%-3.5rem)] sm:max-w-sm",
|
|
@@ -634,28 +635,28 @@ var Wn = "pointer-coarse:size-11 pointer-coarse:p-1.5 pointer-coarse:bg-clip-con
|
|
|
634
635
|
});
|
|
635
636
|
//#endregion
|
|
636
637
|
//#region lib/components/ui/overlays/sheet/sheet-parts.tsx
|
|
637
|
-
function
|
|
638
|
+
function Yn({ className: e, ...t }) {
|
|
638
639
|
return /* @__PURE__ */ H("div", {
|
|
639
640
|
"data-slot": "sheet-header",
|
|
640
641
|
className: n("flex flex-col gap-1.5 p-4", e),
|
|
641
642
|
...t
|
|
642
643
|
});
|
|
643
644
|
}
|
|
644
|
-
function
|
|
645
|
+
function Xn({ className: e, ...t }) {
|
|
645
646
|
return /* @__PURE__ */ H("div", {
|
|
646
647
|
"data-slot": "sheet-footer",
|
|
647
648
|
className: n("mt-auto flex flex-col gap-2 p-4 *:w-full", e),
|
|
648
649
|
...t
|
|
649
650
|
});
|
|
650
651
|
}
|
|
651
|
-
function
|
|
652
|
+
function Zn({ className: e, ...t }) {
|
|
652
653
|
return /* @__PURE__ */ H(v, {
|
|
653
654
|
"data-slot": "sheet-title",
|
|
654
655
|
className: n("text-foreground text-xl/7 font-medium tracking-tight", e),
|
|
655
656
|
...t
|
|
656
657
|
});
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
+
function Qn({ className: e, ...t }) {
|
|
659
660
|
return /* @__PURE__ */ H(b, {
|
|
660
661
|
"data-slot": "sheet-description",
|
|
661
662
|
className: n("text-muted-foreground text-sm/5", e),
|
|
@@ -664,7 +665,7 @@ function Zn({ className: e, ...t }) {
|
|
|
664
665
|
}
|
|
665
666
|
//#endregion
|
|
666
667
|
//#region lib/components/ui/overlays/sheet/sheet.tsx
|
|
667
|
-
function
|
|
668
|
+
function $n({ ...e }) {
|
|
668
669
|
return /* @__PURE__ */ H(p, {
|
|
669
670
|
value: e.modal ?? !0,
|
|
670
671
|
children: /* @__PURE__ */ H(y, {
|
|
@@ -673,13 +674,13 @@ function Qn({ ...e }) {
|
|
|
673
674
|
})
|
|
674
675
|
});
|
|
675
676
|
}
|
|
676
|
-
function
|
|
677
|
+
function er({ ...e }) {
|
|
677
678
|
return /* @__PURE__ */ H(te, {
|
|
678
679
|
"data-slot": "sheet-trigger",
|
|
679
680
|
...e
|
|
680
681
|
});
|
|
681
682
|
}
|
|
682
|
-
function
|
|
683
|
+
function tr({ className: e, color: t, children: r, type: i = "button", variant: a = "ghost", ...o }) {
|
|
683
684
|
let { t: s } = N();
|
|
684
685
|
return /* @__PURE__ */ H(h, {
|
|
685
686
|
"aria-label": r ? void 0 : s("material.buttons.close", "Close"),
|
|
@@ -688,19 +689,19 @@ function er({ className: e, color: t, children: r, type: i = "button", variant:
|
|
|
688
689
|
className: n("absolute top-2 right-2", ve({
|
|
689
690
|
variant: a,
|
|
690
691
|
color: t,
|
|
691
|
-
className: n(
|
|
692
|
+
className: n(qn, e)
|
|
692
693
|
})),
|
|
693
694
|
"data-slot": "sheet-close",
|
|
694
|
-
children: r || /* @__PURE__ */ H(
|
|
695
|
+
children: r || /* @__PURE__ */ H(lt, { className: "size-4" })
|
|
695
696
|
});
|
|
696
697
|
}
|
|
697
|
-
function
|
|
698
|
+
function nr({ ...e }) {
|
|
698
699
|
return /* @__PURE__ */ H(g, {
|
|
699
700
|
"data-slot": "sheet-portal",
|
|
700
701
|
...e
|
|
701
702
|
});
|
|
702
703
|
}
|
|
703
|
-
function
|
|
704
|
+
function rr({ className: e, scrim: t = "dim", ...r }) {
|
|
704
705
|
return /* @__PURE__ */ H(_, {
|
|
705
706
|
"data-slot": "sheet-overlay",
|
|
706
707
|
"data-scrim": t,
|
|
@@ -708,7 +709,7 @@ function nr({ className: e, scrim: t = "dim", ...r }) {
|
|
|
708
709
|
...r
|
|
709
710
|
});
|
|
710
711
|
}
|
|
711
|
-
function
|
|
712
|
+
function ir({ className: e, children: t, side: r = "right", withCloseButton: i, inset: a = !1, scrim: o, onOpenAutoFocus: s, onCloseAutoFocus: c, onEscapeKeyDown: l, ref: u, ...d }) {
|
|
712
713
|
let { t: f } = N(), p = ee({
|
|
713
714
|
onOpenAutoFocus: s,
|
|
714
715
|
onCloseAutoFocus: c
|
|
@@ -717,9 +718,9 @@ function rr({ className: e, children: t, side: r = "right", withCloseButton: i,
|
|
|
717
718
|
onEscapeKeyDown: l,
|
|
718
719
|
...d
|
|
719
720
|
});
|
|
720
|
-
return /* @__PURE__ */ H(m, {
|
|
721
|
+
return /* @__PURE__ */ H(Ce, { children: /* @__PURE__ */ H(m, {
|
|
721
722
|
value: !0,
|
|
722
|
-
children: /* @__PURE__ */ U(
|
|
723
|
+
children: /* @__PURE__ */ U(nr, { children: [/* @__PURE__ */ H(rr, {
|
|
723
724
|
ref: g.overlayRef,
|
|
724
725
|
scrim: o
|
|
725
726
|
}), /* @__PURE__ */ U(w, {
|
|
@@ -727,7 +728,7 @@ function rr({ className: e, children: t, side: r = "right", withCloseButton: i,
|
|
|
727
728
|
"data-slot": "sheet-content",
|
|
728
729
|
"data-side": r,
|
|
729
730
|
"data-inset": a || void 0,
|
|
730
|
-
className: n(
|
|
731
|
+
className: n(Jn({
|
|
731
732
|
side: r,
|
|
732
733
|
inset: a
|
|
733
734
|
}), i && (r === "bottom" || a ? "pt-8" : "pt-[calc(2rem+env(safe-area-inset-top))]"), e),
|
|
@@ -738,44 +739,43 @@ function rr({ className: e, children: t, side: r = "right", withCloseButton: i,
|
|
|
738
739
|
...g.outside,
|
|
739
740
|
children: [t, i && /* @__PURE__ */ H(h, {
|
|
740
741
|
"aria-label": f("material.buttons.close", "Close"),
|
|
741
|
-
className: ve({
|
|
742
|
+
className: n(ve({
|
|
742
743
|
variant: "tonal",
|
|
743
|
-
color: "default"
|
|
744
|
-
|
|
745
|
-
})
|
|
746
|
-
children: /* @__PURE__ */ H(lt, { className: "size-4" })
|
|
744
|
+
color: "default"
|
|
745
|
+
}), "absolute right-3 top-3", "pointer-coarse:size-11 pointer-coarse:p-1 pointer-coarse:-m-1 pointer-coarse:bg-clip-content", !a && r !== "bottom" && "top-[max(0.75rem,env(safe-area-inset-top))]", !a && r === "right" && "right-[max(0.75rem,env(safe-area-inset-right))]"),
|
|
746
|
+
children: /* @__PURE__ */ H(ut, { className: "size-4" })
|
|
747
747
|
})]
|
|
748
748
|
})] })
|
|
749
|
-
});
|
|
749
|
+
}) });
|
|
750
750
|
}
|
|
751
751
|
//#endregion
|
|
752
752
|
//#region lib/components/ui/primitives/scroll-area/scroll-area.tsx
|
|
753
|
-
function
|
|
754
|
-
let a =
|
|
755
|
-
return /* @__PURE__ */ U(
|
|
753
|
+
function ar({ className: e, children: t, viewportProps: r, ...i }) {
|
|
754
|
+
let a = Te();
|
|
755
|
+
return /* @__PURE__ */ U(zn, {
|
|
756
756
|
"data-slot": "scroll-area",
|
|
757
757
|
className: n("relative", e),
|
|
758
758
|
...i,
|
|
759
759
|
children: [
|
|
760
|
-
/* @__PURE__ */ H(
|
|
760
|
+
/* @__PURE__ */ H(Bn, {
|
|
761
761
|
...r,
|
|
762
762
|
"data-slot": "scroll-area-viewport",
|
|
763
763
|
nonce: a,
|
|
764
764
|
className: n("focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1", r?.className),
|
|
765
765
|
children: t
|
|
766
766
|
}),
|
|
767
|
-
/* @__PURE__ */ H(
|
|
768
|
-
/* @__PURE__ */ H(
|
|
767
|
+
/* @__PURE__ */ H(or, {}),
|
|
768
|
+
/* @__PURE__ */ H(Vn, {})
|
|
769
769
|
]
|
|
770
770
|
});
|
|
771
771
|
}
|
|
772
|
-
function
|
|
773
|
-
return /* @__PURE__ */ H(
|
|
772
|
+
function or({ className: e, orientation: t = "vertical", ...r }) {
|
|
773
|
+
return /* @__PURE__ */ H(_n, {
|
|
774
774
|
"data-slot": "scroll-area-scrollbar",
|
|
775
775
|
orientation: t,
|
|
776
776
|
className: n("flex touch-none p-px transition-colors select-none", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
|
|
777
777
|
...r,
|
|
778
|
-
children: /* @__PURE__ */ H(
|
|
778
|
+
children: /* @__PURE__ */ H(On, {
|
|
779
779
|
"data-slot": "scroll-area-thumb",
|
|
780
780
|
className: "bg-border relative flex-1 rounded-full"
|
|
781
781
|
})
|
|
@@ -783,7 +783,7 @@ function ar({ className: e, orientation: t = "vertical", ...r }) {
|
|
|
783
783
|
}
|
|
784
784
|
//#endregion
|
|
785
785
|
//#region lib/components/ui/feedback/error-state/partials/error-state-actions.tsx
|
|
786
|
-
function
|
|
786
|
+
function sr({ onRetry: e, retrying: t, retryLabel: n, action: r }) {
|
|
787
787
|
let { t: i } = N(), [a, o] = B(!1);
|
|
788
788
|
return /* @__PURE__ */ U(V, { children: [e && /* @__PURE__ */ H(_e, {
|
|
789
789
|
variant: "outlined",
|
|
@@ -798,13 +798,13 @@ function or({ onRetry: e, retrying: t, retryLabel: n, action: r }) {
|
|
|
798
798
|
t.then(e, e);
|
|
799
799
|
}
|
|
800
800
|
},
|
|
801
|
-
children: n ?? i(
|
|
801
|
+
children: n ?? i(xt.retry.key, xt.retry.fallback)
|
|
802
802
|
}), r] });
|
|
803
803
|
}
|
|
804
804
|
//#endregion
|
|
805
805
|
//#region lib/components/ui/feedback/error-state/partials/error-state-details.tsx
|
|
806
|
-
function
|
|
807
|
-
let { t } = N(), n = (e) => t(
|
|
806
|
+
function cr({ details: e }) {
|
|
807
|
+
let { t } = N(), n = (e) => t(xt[e].key, xt[e].fallback);
|
|
808
808
|
return /* @__PURE__ */ U("details", {
|
|
809
809
|
"data-slot": "error-state-details",
|
|
810
810
|
className: "w-full max-w-sm rounded border border-border px-3 py-2 text-left text-sm text-foreground",
|
|
@@ -831,17 +831,17 @@ function sr({ details: e }) {
|
|
|
831
831
|
}
|
|
832
832
|
//#endregion
|
|
833
833
|
//#region lib/components/ui/feedback/error-state/error-state.tsx
|
|
834
|
-
function
|
|
835
|
-
return e === void 0 ? n.length > 0 && /* @__PURE__ */ H(
|
|
834
|
+
function lr(e, n) {
|
|
835
|
+
return e === void 0 ? n.length > 0 && /* @__PURE__ */ H(cr, { details: n }) : t(e, n);
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
let { t: h } = N(), g =
|
|
837
|
+
function ur({ kind: e = "generic", size: t, title: n, description: r, illustration: i, icon: a, error: o, showDetails: s, details: c, onRetry: l, retrying: u, retryLabel: d, action: f, children: p, ...m }) {
|
|
838
|
+
let { t: h } = N(), g = Ct(e, "error-state"), _ = s === !1 ? [] : St(o), v = (l || f) && /* @__PURE__ */ H(sr, {
|
|
839
839
|
onRetry: l,
|
|
840
840
|
retrying: u,
|
|
841
841
|
retryLabel: d,
|
|
842
842
|
action: f
|
|
843
843
|
});
|
|
844
|
-
return /* @__PURE__ */ U(
|
|
844
|
+
return /* @__PURE__ */ U(Ee, {
|
|
845
845
|
role: "alert",
|
|
846
846
|
"data-slot": "error-state",
|
|
847
847
|
kind: e,
|
|
@@ -852,35 +852,35 @@ function lr({ kind: e = "generic", size: t, title: n, description: r, illustrati
|
|
|
852
852
|
description: r ?? (n == null ? h(g.descriptionKey, g.description) : void 0),
|
|
853
853
|
actions: v || void 0,
|
|
854
854
|
...m,
|
|
855
|
-
children: [p,
|
|
855
|
+
children: [p, lr(c, _)]
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
858
|
//#endregion
|
|
859
859
|
//#region lib/components/ui/media/pdf-viewer/pdf-reader-states.tsx
|
|
860
|
-
function
|
|
860
|
+
function dr({ className: e }) {
|
|
861
861
|
let { t } = N();
|
|
862
|
-
return /* @__PURE__ */ H(
|
|
862
|
+
return /* @__PURE__ */ H(De, {
|
|
863
863
|
size: "compact",
|
|
864
864
|
kind: "empty",
|
|
865
865
|
className: n("min-h-64 h-full", e),
|
|
866
|
-
icon: /* @__PURE__ */ H(
|
|
866
|
+
icon: /* @__PURE__ */ H(Be, { "aria-hidden": !0 }),
|
|
867
867
|
title: t("material.pdf-reader.empty", "No document selected")
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function fr() {
|
|
871
871
|
let { t: e } = N();
|
|
872
872
|
return /* @__PURE__ */ U("div", {
|
|
873
873
|
role: "status",
|
|
874
874
|
className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-background/80 backdrop-blur-sm",
|
|
875
|
-
children: [/* @__PURE__ */ H(
|
|
875
|
+
children: [/* @__PURE__ */ H(Ge, { className: "size-8 animate-spin text-primary-text" }), /* @__PURE__ */ H("p", {
|
|
876
876
|
className: "text-sm text-muted-foreground",
|
|
877
877
|
children: e("material.pdf-reader.loading", "Loading document…")
|
|
878
878
|
})]
|
|
879
879
|
});
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function pr({ error: e, onRetry: t, title: n }) {
|
|
882
882
|
let { t: r } = N();
|
|
883
|
-
return /* @__PURE__ */ H(
|
|
883
|
+
return /* @__PURE__ */ H(ur, {
|
|
884
884
|
size: "compact",
|
|
885
885
|
className: "absolute inset-0",
|
|
886
886
|
title: n ?? r("material.pdf-reader.error", "Failed to load document"),
|
|
@@ -889,14 +889,14 @@ function fr({ error: e, onRetry: t, title: n }) {
|
|
|
889
889
|
retryLabel: r("material.pdf-reader.retry", "Retry")
|
|
890
890
|
});
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
let { t: i } = N(), a =
|
|
892
|
+
function mr({ value: e, incorrect: t = !1, onChange: n, onSubmit: r }) {
|
|
893
|
+
let { t: i } = N(), a = gt(), o = z(null);
|
|
894
894
|
return I(() => {
|
|
895
895
|
t && o.current?.focus();
|
|
896
896
|
}, [t]), /* @__PURE__ */ U("div", {
|
|
897
897
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-4",
|
|
898
898
|
children: [
|
|
899
|
-
/* @__PURE__ */ H(
|
|
899
|
+
/* @__PURE__ */ H(He, { className: "size-10 text-primary-text opacity-70" }),
|
|
900
900
|
/* @__PURE__ */ H("p", {
|
|
901
901
|
className: "text-sm font-semibold",
|
|
902
902
|
children: i("material.pdf-reader.password", "Password protected")
|
|
@@ -935,7 +935,7 @@ function pr({ value: e, incorrect: t = !1, onChange: n, onSubmit: r }) {
|
|
|
935
935
|
}
|
|
936
936
|
//#endregion
|
|
937
937
|
//#region lib/components/ui/media/pdf-reader/use-open-focus-gate.ts
|
|
938
|
-
function
|
|
938
|
+
function hr() {
|
|
939
939
|
let e = z(!1);
|
|
940
940
|
return {
|
|
941
941
|
gate: e,
|
|
@@ -949,8 +949,8 @@ function mr() {
|
|
|
949
949
|
}
|
|
950
950
|
//#endregion
|
|
951
951
|
//#region lib/components/ui/media/pdf-reader/modes/dialog-mode.tsx
|
|
952
|
-
function
|
|
953
|
-
let { t: i } = N(), a =
|
|
952
|
+
function gr({ open: e, onOpenChange: t, title: n, children: r }) {
|
|
953
|
+
let { t: i } = N(), a = hr();
|
|
954
954
|
return /* @__PURE__ */ H(C, {
|
|
955
955
|
open: e,
|
|
956
956
|
onOpenChange: t,
|
|
@@ -973,7 +973,7 @@ function hr({ open: e, onOpenChange: t, title: n, children: r }) {
|
|
|
973
973
|
})
|
|
974
974
|
});
|
|
975
975
|
}
|
|
976
|
-
var
|
|
976
|
+
var _r = bt({
|
|
977
977
|
name: "pdf-reader",
|
|
978
978
|
initialState: ((e) => ({
|
|
979
979
|
size: "expanded",
|
|
@@ -1033,36 +1033,36 @@ var gr = yt({
|
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
});
|
|
1036
|
-
|
|
1037
|
-
var
|
|
1036
|
+
_r.actions;
|
|
1037
|
+
var vr = {
|
|
1038
1038
|
selectEscapeTarget: (e) => e.annotating ? "annotate" : e.searchOpen ? "search" : null,
|
|
1039
1039
|
selectHeaderKind: (e) => e.annotating ? "annotate" : e.searchOpen ? "search" : "default",
|
|
1040
1040
|
selectRailValue: (e) => e.panelOpen ? e.panelTab : ""
|
|
1041
|
-
},
|
|
1042
|
-
function
|
|
1041
|
+
}, yr = pt(null), br = pt(null);
|
|
1042
|
+
function xr(e, t) {
|
|
1043
1043
|
if (!e) throw Error(`${t} must be used within PdfReader`);
|
|
1044
1044
|
return e;
|
|
1045
1045
|
}
|
|
1046
|
-
var Z = () =>
|
|
1047
|
-
function
|
|
1046
|
+
var Z = () => xr(ht(yr), "useReaderChrome"), Q = () => xr(ht(br), "useReaderDocumentContext");
|
|
1047
|
+
function Sr(e) {
|
|
1048
1048
|
return e < 600 ? "compact" : e < 840 ? "medium" : "expanded";
|
|
1049
1049
|
}
|
|
1050
1050
|
//#endregion
|
|
1051
1051
|
//#region lib/components/ui/media/pdf-reader/use-container-size.ts
|
|
1052
|
-
function
|
|
1052
|
+
function Cr(e, t) {
|
|
1053
1053
|
L(() => {
|
|
1054
1054
|
let n = e.current;
|
|
1055
|
-
if (!n || (t(
|
|
1055
|
+
if (!n || (t(Sr(n.getBoundingClientRect().width)), typeof ResizeObserver > "u")) return;
|
|
1056
1056
|
let r = new ResizeObserver((e) => {
|
|
1057
1057
|
let n = e[0]?.contentRect.width;
|
|
1058
|
-
n !== void 0 && t(
|
|
1058
|
+
n !== void 0 && t(Sr(n));
|
|
1059
1059
|
});
|
|
1060
1060
|
return r.observe(n), () => r.disconnect();
|
|
1061
1061
|
}, [e, t]);
|
|
1062
1062
|
}
|
|
1063
1063
|
//#endregion
|
|
1064
1064
|
//#region lib/components/ui/media/pdf-reader/use-focus-hand-off.ts
|
|
1065
|
-
function
|
|
1065
|
+
function wr(e, t) {
|
|
1066
1066
|
let n = z(t);
|
|
1067
1067
|
I(() => {
|
|
1068
1068
|
let r = n.current;
|
|
@@ -1075,7 +1075,7 @@ function Cr(e, t) {
|
|
|
1075
1075
|
}
|
|
1076
1076
|
//#endregion
|
|
1077
1077
|
//#region lib/components/ui/media/pdf-reader/reader-keys.ts
|
|
1078
|
-
function
|
|
1078
|
+
function Tr(e, { typing: t, inBar: n, scrollsSideways: r = !1, rtl: i = !1 }) {
|
|
1079
1079
|
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "f") return "search";
|
|
1080
1080
|
if (e.altKey || e.ctrlKey || e.metaKey) return null;
|
|
1081
1081
|
if (e.key === "F3") return e.shiftKey ? "prev-search" : "next-search";
|
|
@@ -1110,14 +1110,14 @@ function wr(e, { typing: t, inBar: n, scrollsSideways: r = !1, rtl: i = !1 }) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
//#endregion
|
|
1112
1112
|
//#region lib/components/ui/media/pdf-reader/use-reader-keys.ts
|
|
1113
|
-
var
|
|
1114
|
-
function
|
|
1113
|
+
var Er = 1, Dr = "[role=\"toolbar\"], [role=\"menu\"], [role=\"radiogroup\"], [role=\"tablist\"], [role=\"listbox\"], [role=\"tree\"], [role=\"grid\"]";
|
|
1114
|
+
function Or() {
|
|
1115
1115
|
let { chrome: e, chromeActions: t, frameRef: n, openSearch: r } = Z(), { state: i, actions: a, searchHits: o } = Q(), s = le(n) === "rtl", c = F((e) => {
|
|
1116
1116
|
if (e.defaultPrevented) return;
|
|
1117
|
-
let t = e.target, c = n.current?.querySelector("[data-slot=\"scroll-area-viewport\"]"), l =
|
|
1117
|
+
let t = e.target, c = n.current?.querySelector("[data-slot=\"scroll-area-viewport\"]"), l = Tr(e.nativeEvent, {
|
|
1118
1118
|
typing: ["INPUT", "TEXTAREA"].includes(t.tagName),
|
|
1119
|
-
inBar: !!t.closest?.(
|
|
1120
|
-
scrollsSideways: !!(c && c.scrollWidth > c.clientWidth +
|
|
1119
|
+
inBar: !!t.closest?.(Dr),
|
|
1120
|
+
scrollsSideways: !!(c && c.scrollWidth > c.clientWidth + Er),
|
|
1121
1121
|
rtl: s
|
|
1122
1122
|
});
|
|
1123
1123
|
!l || t.closest?.("[role=\"menu\"]") || (e.preventDefault(), {
|
|
@@ -1143,7 +1143,7 @@ function Dr() {
|
|
|
1143
1143
|
s,
|
|
1144
1144
|
o,
|
|
1145
1145
|
i.numPages
|
|
1146
|
-
]), l =
|
|
1146
|
+
]), l = vr.selectEscapeTarget(e), u = F((e) => {
|
|
1147
1147
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
1148
1148
|
let r = e.target;
|
|
1149
1149
|
!(r instanceof Node) || !n.current?.contains(r) || r instanceof Element && r.closest("[role=\"menu\"]") || (e.preventDefault(), e.stopPropagation(), l === "annotate" ? t.stopAnnotating() : t.closeSearchField());
|
|
@@ -1156,7 +1156,7 @@ function Dr() {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
//#endregion
|
|
1158
1158
|
//#region lib/components/ui/media/pdf-reader/format-locale.ts
|
|
1159
|
-
function
|
|
1159
|
+
function kr(e, t = "en") {
|
|
1160
1160
|
return new Intl.NumberFormat(t, {
|
|
1161
1161
|
style: "percent",
|
|
1162
1162
|
maximumFractionDigits: 0
|
|
@@ -1164,7 +1164,7 @@ function Or(e, t = "en") {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
//#endregion
|
|
1166
1166
|
//#region lib/components/ui/media/pdf-reader/partials/announcer.tsx
|
|
1167
|
-
function
|
|
1167
|
+
function Ar() {
|
|
1168
1168
|
let { t: e, language: t } = N(), { state: n, scale: r, announcements: i } = Q(), [a, o] = B(""), { currentPage: s, numPages: c } = n, { recent: l } = i;
|
|
1169
1169
|
return I(() => {
|
|
1170
1170
|
!l("page") || c === 0 || o(e("material.pdf-reader.next.announce-page", "Page {page} of {total}", {
|
|
@@ -1176,7 +1176,7 @@ function kr() {
|
|
|
1176
1176
|
c,
|
|
1177
1177
|
l
|
|
1178
1178
|
]), I(() => {
|
|
1179
|
-
l("zoom") && o(e("material.pdf-reader.next.announce-zoom", "Zoom {level}", { level:
|
|
1179
|
+
l("zoom") && o(e("material.pdf-reader.next.announce-zoom", "Zoom {level}", { level: kr(r, t ?? "en") }));
|
|
1180
1180
|
}, [
|
|
1181
1181
|
r,
|
|
1182
1182
|
t,
|
|
@@ -1190,9 +1190,9 @@ function kr() {
|
|
|
1190
1190
|
}
|
|
1191
1191
|
//#endregion
|
|
1192
1192
|
//#region lib/components/ui/media/pdf-reader/partials/reader-status.tsx
|
|
1193
|
-
function
|
|
1193
|
+
function jr({ onRetry: e }) {
|
|
1194
1194
|
let { t } = N(), { state: n, password: r } = Q();
|
|
1195
|
-
if (n.isPasswordProtected) return /* @__PURE__ */ H(
|
|
1195
|
+
if (n.isPasswordProtected) return /* @__PURE__ */ H(mr, {
|
|
1196
1196
|
value: r.input,
|
|
1197
1197
|
incorrect: n.passwordError ?? !1,
|
|
1198
1198
|
onChange: r.setInput,
|
|
@@ -1200,32 +1200,32 @@ function Ar({ onRetry: e }) {
|
|
|
1200
1200
|
});
|
|
1201
1201
|
if (n.error) {
|
|
1202
1202
|
let r = n.loadError ?? Error(n.error);
|
|
1203
|
-
return /* @__PURE__ */ H(
|
|
1203
|
+
return /* @__PURE__ */ H(pr, {
|
|
1204
1204
|
error: r,
|
|
1205
1205
|
onRetry: e,
|
|
1206
|
-
title:
|
|
1206
|
+
title: Dt(r).kind === "invalid" ? t("material.pdf-reader.next.invalid-error", "This file is not a valid PDF") : void 0
|
|
1207
1207
|
});
|
|
1208
1208
|
}
|
|
1209
|
-
return n.isLoading ? /* @__PURE__ */ H(
|
|
1209
|
+
return n.isLoading ? /* @__PURE__ */ H(fr, {}) : null;
|
|
1210
1210
|
}
|
|
1211
1211
|
//#endregion
|
|
1212
1212
|
//#region lib/components/ui/media/pdf-reader/panel-surface.ts
|
|
1213
|
-
var
|
|
1213
|
+
var Mr = "bg-[color-mix(in_oklab,var(--primary)_5%,var(--background))] dark:bg-[color-mix(in_oklab,var(--primary)_14%,var(--card))]";
|
|
1214
1214
|
//#endregion
|
|
1215
1215
|
//#region lib/components/ui/media/pdf-viewer/pdf-outline-sidebar.tsx
|
|
1216
|
-
function
|
|
1216
|
+
function Nr({ items: e, onSelect: t, className: r }) {
|
|
1217
1217
|
let { t: i } = N();
|
|
1218
1218
|
return /* @__PURE__ */ H("div", {
|
|
1219
1219
|
className: n("flex min-h-0 flex-1 flex-col", r),
|
|
1220
1220
|
children: e.length === 0 ? /* @__PURE__ */ H("p", {
|
|
1221
1221
|
className: "px-3 py-6 text-center text-xs text-muted-foreground",
|
|
1222
1222
|
children: i("material.pdf-reader.outline-empty", "No outline in this document")
|
|
1223
|
-
}) : /* @__PURE__ */ H(
|
|
1223
|
+
}) : /* @__PURE__ */ H(ar, {
|
|
1224
1224
|
className: "flex-1",
|
|
1225
1225
|
children: /* @__PURE__ */ H("nav", {
|
|
1226
1226
|
className: "p-2",
|
|
1227
1227
|
"aria-label": i("material.pdf-reader.outline", "Outline"),
|
|
1228
|
-
children: e.map((e, n) => /* @__PURE__ */ H(
|
|
1228
|
+
children: e.map((e, n) => /* @__PURE__ */ H(Pr, {
|
|
1229
1229
|
item: e,
|
|
1230
1230
|
depth: 0,
|
|
1231
1231
|
onSelect: t
|
|
@@ -1234,7 +1234,7 @@ function Mr({ items: e, onSelect: t, className: r }) {
|
|
|
1234
1234
|
})
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function Pr({ item: e, depth: t, onSelect: n }) {
|
|
1238
1238
|
let { t: r } = N(), [i, a] = B(t < 1), o = e.items.length > 0;
|
|
1239
1239
|
return /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ U("button", {
|
|
1240
1240
|
type: "button",
|
|
@@ -1250,7 +1250,7 @@ function Nr({ item: e, depth: t, onSelect: n }) {
|
|
|
1250
1250
|
className: "truncate",
|
|
1251
1251
|
children: e.title || r("material.pdf-reader.untitled", "Untitled")
|
|
1252
1252
|
})]
|
|
1253
|
-
}), o && i && e.items.map((e, r) => /* @__PURE__ */ H(
|
|
1253
|
+
}), o && i && e.items.map((e, r) => /* @__PURE__ */ H(Pr, {
|
|
1254
1254
|
item: e,
|
|
1255
1255
|
depth: t + 1,
|
|
1256
1256
|
onSelect: n
|
|
@@ -1258,7 +1258,7 @@ function Nr({ item: e, depth: t, onSelect: n }) {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
//#endregion
|
|
1260
1260
|
//#region lib/components/ui/media/pdf-reader/partials/search-field.tsx
|
|
1261
|
-
function
|
|
1261
|
+
function Fr({ autoFocus: e = !0, stacked: t = !1 }) {
|
|
1262
1262
|
let { t: r } = N(), { state: i, actions: a, searchHits: o } = Q(), s = z(null), { chrome: c } = Z(), l = c.searchFocusTick;
|
|
1263
1263
|
I(() => {
|
|
1264
1264
|
e && s.current?.focus();
|
|
@@ -1301,7 +1301,7 @@ function Pr({ autoFocus: e = !0, stacked: t = !1 }) {
|
|
|
1301
1301
|
tooltip: d,
|
|
1302
1302
|
disabled: o.hitCount === 0,
|
|
1303
1303
|
onClick: () => o.jump(-1),
|
|
1304
|
-
children: /* @__PURE__ */ H(
|
|
1304
|
+
children: /* @__PURE__ */ H(Fe, {})
|
|
1305
1305
|
})
|
|
1306
1306
|
}), /* @__PURE__ */ H(k, {
|
|
1307
1307
|
label: f,
|
|
@@ -1312,24 +1312,24 @@ function Pr({ autoFocus: e = !0, stacked: t = !1 }) {
|
|
|
1312
1312
|
tooltip: f,
|
|
1313
1313
|
disabled: o.hitCount === 0,
|
|
1314
1314
|
onClick: () => o.jump(1),
|
|
1315
|
-
children: /* @__PURE__ */ H(
|
|
1315
|
+
children: /* @__PURE__ */ H(Me, {})
|
|
1316
1316
|
})
|
|
1317
1317
|
})]
|
|
1318
1318
|
})
|
|
1319
1319
|
]
|
|
1320
1320
|
});
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1323
|
-
return
|
|
1322
|
+
function Ir(e, t, n, r, i = "single", a = "ltr") {
|
|
1323
|
+
return kt(Array.from({ length: e }, (e, i) => Wt(t[i], n, r)), {
|
|
1324
1324
|
mode: i,
|
|
1325
1325
|
gap: 16,
|
|
1326
1326
|
columnGap: 12,
|
|
1327
1327
|
dir: a
|
|
1328
1328
|
});
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1331
|
-
let o = Math.min(n || 1,
|
|
1332
|
-
return
|
|
1330
|
+
function Lr(e, t, n, r, i, a) {
|
|
1331
|
+
let o = Math.min(n || 1, Rt), s = Ir(o, r, 1, i, t), c = Ir(o, r, 2, i, t).maxWidth - s.maxWidth, l = s.maxWidth - c;
|
|
1332
|
+
return Bt(e, {
|
|
1333
1333
|
width: c,
|
|
1334
1334
|
height: Math.max(...s.rows.map((e) => e.height))
|
|
1335
1335
|
}, {
|
|
@@ -1337,7 +1337,7 @@ function Ir(e, t, n, r, i, a) {
|
|
|
1337
1337
|
height: a.height
|
|
1338
1338
|
});
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1340
|
+
function Rr(e, t) {
|
|
1341
1341
|
let n = 0, r = e.length - 1, i = -1;
|
|
1342
1342
|
for (; n <= r;) {
|
|
1343
1343
|
let a = n + r >> 1;
|
|
@@ -1345,21 +1345,21 @@ function Lr(e, t) {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
return i;
|
|
1347
1347
|
}
|
|
1348
|
-
function
|
|
1349
|
-
let r =
|
|
1348
|
+
function zr(e, t, n) {
|
|
1349
|
+
let r = Rr(e, t);
|
|
1350
1350
|
return r < 0 ? null : e[r + n] ?? null;
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1353
|
-
let r =
|
|
1352
|
+
function Br(e, t, n) {
|
|
1353
|
+
let r = Rr(e, t), i = e[r];
|
|
1354
1354
|
return i === void 0 ? [t, t] : [i, Math.min(n, (e[r + 1] ?? n + 1) - 1)];
|
|
1355
1355
|
}
|
|
1356
1356
|
//#endregion
|
|
1357
1357
|
//#region lib/components/ui/media/pdf-reader/engine/canvas-cache.ts
|
|
1358
|
-
function
|
|
1358
|
+
function Vr(e) {
|
|
1359
1359
|
e && (e.width = 0, e.height = 0);
|
|
1360
1360
|
}
|
|
1361
|
-
var
|
|
1362
|
-
function
|
|
1361
|
+
var Hr = 5e7, Ur = ({ page: e, scale: t, rotation: n }) => `${e}@${t}/${n}`;
|
|
1362
|
+
function Wr(e = Hr) {
|
|
1363
1363
|
let t = /* @__PURE__ */ new Set(), n = 0, r = 0, i = 0, a = () => {
|
|
1364
1364
|
for (; n > e && r > 1;) {
|
|
1365
1365
|
let e;
|
|
@@ -1376,7 +1376,7 @@ function Ur(e = Vr) {
|
|
|
1376
1376
|
};
|
|
1377
1377
|
return {
|
|
1378
1378
|
cache() {
|
|
1379
|
-
return
|
|
1379
|
+
return Gr({
|
|
1380
1380
|
members: t,
|
|
1381
1381
|
stamp: () => ++i,
|
|
1382
1382
|
added(e) {
|
|
@@ -1392,22 +1392,22 @@ function Ur(e = Vr) {
|
|
|
1392
1392
|
}
|
|
1393
1393
|
};
|
|
1394
1394
|
}
|
|
1395
|
-
function
|
|
1395
|
+
function Gr(e) {
|
|
1396
1396
|
let t = /* @__PURE__ */ new Map(), n = !1, r = (n, r) => {
|
|
1397
1397
|
let i = t.get(n);
|
|
1398
|
-
i && (t.delete(n), e.removed(i.pixels), (r === "force" || r === "safe" && !i.canvas.isConnected) &&
|
|
1398
|
+
i && (t.delete(n), e.removed(i.pixels), (r === "force" || r === "safe" && !i.canvas.isConnected) && Vr(i.canvas));
|
|
1399
1399
|
}, i = {
|
|
1400
1400
|
oldest: () => t.values().next().value,
|
|
1401
|
-
drop: (e) => r(
|
|
1401
|
+
drop: (e) => r(Ur(e.key), "safe")
|
|
1402
1402
|
};
|
|
1403
1403
|
return e.members.add(i), {
|
|
1404
1404
|
take(e) {
|
|
1405
|
-
let n =
|
|
1405
|
+
let n = Ur(e), i = t.get(n);
|
|
1406
1406
|
if (i) return r(n, "keep"), i.canvas;
|
|
1407
1407
|
},
|
|
1408
1408
|
put(i, a) {
|
|
1409
|
-
if (n) return
|
|
1410
|
-
let o =
|
|
1409
|
+
if (n) return Vr(a);
|
|
1410
|
+
let o = Ur(i);
|
|
1411
1411
|
r(o, "safe"), t.set(o, {
|
|
1412
1412
|
key: i,
|
|
1413
1413
|
canvas: a,
|
|
@@ -1431,16 +1431,16 @@ function Wr(e) {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
};
|
|
1433
1433
|
}
|
|
1434
|
-
var
|
|
1435
|
-
function
|
|
1436
|
-
return (e === void 0 ?
|
|
1434
|
+
var Kr = Wr();
|
|
1435
|
+
function qr(e) {
|
|
1436
|
+
return (e === void 0 ? Kr : Wr(e)).cache();
|
|
1437
1437
|
}
|
|
1438
1438
|
//#endregion
|
|
1439
1439
|
//#region lib/components/ui/media/pdf-reader/engine/draw-page.ts
|
|
1440
|
-
function
|
|
1440
|
+
function Jr(e) {
|
|
1441
1441
|
return e instanceof Error ? e : Error(String(e));
|
|
1442
1442
|
}
|
|
1443
|
-
async function
|
|
1443
|
+
async function Yr(e, t, n, r, i) {
|
|
1444
1444
|
let a = await e.getPage(t);
|
|
1445
1445
|
if (i.aborted) return null;
|
|
1446
1446
|
let o = (a.rotate + n) % 360, s = "scale" in r ? r.scale : r.width / a.getViewport({
|
|
@@ -1457,9 +1457,9 @@ async function Jr(e, t, n, r, i) {
|
|
|
1457
1457
|
rotation: o
|
|
1458
1458
|
};
|
|
1459
1459
|
}
|
|
1460
|
-
async function
|
|
1460
|
+
async function Xr(e, t, n) {
|
|
1461
1461
|
let { page: r, viewport: i, scale: a, rotation: o } = e;
|
|
1462
|
-
return await
|
|
1462
|
+
return await Ft(r, t, Pt({
|
|
1463
1463
|
cssWidth: i.width,
|
|
1464
1464
|
cssHeight: i.height,
|
|
1465
1465
|
devicePixelRatio: window.devicePixelRatio,
|
|
@@ -1471,7 +1471,7 @@ async function Yr(e, t, n) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
//#endregion
|
|
1473
1473
|
//#region lib/components/ui/media/pdf-reader/engine/use-thumbnail.ts
|
|
1474
|
-
function
|
|
1474
|
+
function Zr(e) {
|
|
1475
1475
|
let { doc: t, pageNumber: n, width: r, rotation: i, box: a, host: o } = e, [s, c] = B(!1), l = z(null), u = z(e.onError);
|
|
1476
1476
|
L(() => {
|
|
1477
1477
|
u.current = e.onError;
|
|
@@ -1485,12 +1485,12 @@ function Xr(e) {
|
|
|
1485
1485
|
if (!t || !e || !s) return;
|
|
1486
1486
|
let a = new AbortController(), { signal: c } = a, d = document.createElement("canvas");
|
|
1487
1487
|
return d.dataset.slot = "pdf-thumbnail-canvas", (async () => {
|
|
1488
|
-
let a = await
|
|
1489
|
-
a && await
|
|
1488
|
+
let a = await Yr(t, n, i, { width: r }, c);
|
|
1489
|
+
a && await Xr(a, d, c) && (l.current = a.page, e.replaceChildren(d));
|
|
1490
1490
|
})().catch((e) => {
|
|
1491
|
-
c.aborted || u.current?.(
|
|
1491
|
+
c.aborted || u.current?.(Jr(e));
|
|
1492
1492
|
}), () => {
|
|
1493
|
-
a.abort(), e.replaceChildren(),
|
|
1493
|
+
a.abort(), e.replaceChildren(), Vr(d);
|
|
1494
1494
|
};
|
|
1495
1495
|
}, [
|
|
1496
1496
|
t,
|
|
@@ -1507,9 +1507,9 @@ function Xr(e) {
|
|
|
1507
1507
|
s
|
|
1508
1508
|
]);
|
|
1509
1509
|
}
|
|
1510
|
-
var
|
|
1510
|
+
var Qr = mt(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, current: o, tabStop: s, onGo: c }) {
|
|
1511
1511
|
let { t: l } = N(), u = z(null), d = z(null);
|
|
1512
|
-
|
|
1512
|
+
Zr({
|
|
1513
1513
|
doc: t,
|
|
1514
1514
|
pageNumber: e,
|
|
1515
1515
|
width: 120,
|
|
@@ -1517,7 +1517,7 @@ var Zr = pt(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, curr
|
|
|
1517
1517
|
box: u,
|
|
1518
1518
|
host: d
|
|
1519
1519
|
});
|
|
1520
|
-
let f =
|
|
1520
|
+
let f = Wt(r, 120 / Jt(r ?? Lt, i).width, i);
|
|
1521
1521
|
return /* @__PURE__ */ U("button", {
|
|
1522
1522
|
ref: u,
|
|
1523
1523
|
"data-lit": a ? "" : void 0,
|
|
@@ -1538,14 +1538,14 @@ var Zr = pt(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, curr
|
|
|
1538
1538
|
children: e
|
|
1539
1539
|
})]
|
|
1540
1540
|
});
|
|
1541
|
-
}),
|
|
1541
|
+
}), $r = {
|
|
1542
1542
|
ArrowDown: (e) => e + 1,
|
|
1543
1543
|
ArrowUp: (e) => e - 1,
|
|
1544
1544
|
Home: () => 1,
|
|
1545
1545
|
End: (e, t) => t
|
|
1546
1546
|
};
|
|
1547
|
-
function
|
|
1548
|
-
let { t: e } = N(), { state: t, actions: n, doc: r, rowStarts: i } = Q(), { numPages: a, currentPage: o, rotation: s } = t, c = z(null), [l, u] = B(null), [d, f] =
|
|
1547
|
+
function ei() {
|
|
1548
|
+
let { t: e } = N(), { state: t, actions: n, doc: r, rowStarts: i } = Q(), { numPages: a, currentPage: o, rotation: s } = t, c = z(null), [l, u] = B(null), [d, f] = Br(i, o, a), p = Math.min(Math.max(l ?? o, 1), a);
|
|
1549
1549
|
return /* @__PURE__ */ H("div", {
|
|
1550
1550
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
1551
1551
|
children: /* @__PURE__ */ H("div", {
|
|
@@ -1553,7 +1553,7 @@ function $r() {
|
|
|
1553
1553
|
role: "group",
|
|
1554
1554
|
"aria-label": e("material.pdf-reader.thumbnails", "Page thumbnails"),
|
|
1555
1555
|
onKeyDown: (e) => {
|
|
1556
|
-
let t =
|
|
1556
|
+
let t = $r[e.key], n = Number(e.target.closest("[data-page-number]")?.getAttribute("data-page-number"));
|
|
1557
1557
|
if (!t || !n || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1558
1558
|
e.preventDefault();
|
|
1559
1559
|
let r = Math.min(Math.max(t(n, a), 1), a);
|
|
@@ -1569,7 +1569,7 @@ function $r() {
|
|
|
1569
1569
|
className: "flex flex-col items-center gap-2 p-2",
|
|
1570
1570
|
children: Array.from({ length: a }, (e, i) => {
|
|
1571
1571
|
let a = i + 1;
|
|
1572
|
-
return /* @__PURE__ */ H(
|
|
1572
|
+
return /* @__PURE__ */ H(Qr, {
|
|
1573
1573
|
pageNumber: a,
|
|
1574
1574
|
doc: r,
|
|
1575
1575
|
size: t.pageSizes?.[i],
|
|
@@ -1585,20 +1585,20 @@ function $r() {
|
|
|
1585
1585
|
}
|
|
1586
1586
|
//#endregion
|
|
1587
1587
|
//#region lib/components/ui/media/pdf-reader/partials/panel-content.tsx
|
|
1588
|
-
function
|
|
1588
|
+
function ti() {
|
|
1589
1589
|
let { t: e } = N(), { chrome: t } = Z(), { state: n, onOutlineSelect: r } = Q();
|
|
1590
|
-
return t.panelTab === "thumbs" ? /* @__PURE__ */ H(
|
|
1590
|
+
return t.panelTab === "thumbs" ? /* @__PURE__ */ H(ei, {}) : t.panelTab === "outline" ? n.outline.length === 0 ? /* @__PURE__ */ U("div", {
|
|
1591
1591
|
className: "flex flex-col items-center gap-2 px-6 py-10 text-center text-muted-foreground text-sm",
|
|
1592
|
-
children: [/* @__PURE__ */ H(
|
|
1592
|
+
children: [/* @__PURE__ */ H(We, {
|
|
1593
1593
|
"aria-hidden": !0,
|
|
1594
1594
|
className: "size-6 opacity-60"
|
|
1595
1595
|
}), /* @__PURE__ */ H("p", { children: e("material.pdf-reader.next.outline-empty", "This document has no outline") })]
|
|
1596
|
-
}) : /* @__PURE__ */ H(
|
|
1596
|
+
}) : /* @__PURE__ */ H(Nr, {
|
|
1597
1597
|
items: n.outline,
|
|
1598
1598
|
onSelect: r
|
|
1599
1599
|
}) : t.panelTab === "search" ? /* @__PURE__ */ H("div", {
|
|
1600
1600
|
className: "p-3",
|
|
1601
|
-
children: /* @__PURE__ */ H(
|
|
1601
|
+
children: /* @__PURE__ */ H(Fr, { stacked: !0 })
|
|
1602
1602
|
}) : /* @__PURE__ */ H("p", {
|
|
1603
1603
|
className: "p-4 text-muted-foreground text-sm",
|
|
1604
1604
|
children: e("material.pdf-reader.next.annotations-empty", "No annotations yet")
|
|
@@ -1606,29 +1606,29 @@ function ei() {
|
|
|
1606
1606
|
}
|
|
1607
1607
|
//#endregion
|
|
1608
1608
|
//#region lib/components/ui/media/pdf-reader/types.ts
|
|
1609
|
-
var
|
|
1609
|
+
var ni = [
|
|
1610
1610
|
"thumbs",
|
|
1611
1611
|
"outline",
|
|
1612
1612
|
"annotations",
|
|
1613
1613
|
"search"
|
|
1614
|
-
],
|
|
1614
|
+
], ri = [
|
|
1615
1615
|
"yellow",
|
|
1616
1616
|
"green",
|
|
1617
1617
|
"blue",
|
|
1618
1618
|
"pink",
|
|
1619
1619
|
"red"
|
|
1620
|
-
],
|
|
1620
|
+
], ii = [
|
|
1621
1621
|
"annotate",
|
|
1622
1622
|
"annotationCount",
|
|
1623
1623
|
"initialChrome",
|
|
1624
1624
|
"showUnfinished"
|
|
1625
|
-
],
|
|
1626
|
-
thumbs:
|
|
1627
|
-
outline:
|
|
1628
|
-
annotations:
|
|
1629
|
-
search:
|
|
1625
|
+
], ai = {
|
|
1626
|
+
thumbs: Ue,
|
|
1627
|
+
outline: We,
|
|
1628
|
+
annotations: qe,
|
|
1629
|
+
search: rt
|
|
1630
1630
|
};
|
|
1631
|
-
function
|
|
1631
|
+
function oi() {
|
|
1632
1632
|
let { t: e } = N();
|
|
1633
1633
|
return {
|
|
1634
1634
|
thumbs: e("material.pdf-reader.next.thumbnails", "Thumbnails"),
|
|
@@ -1637,14 +1637,14 @@ function ai() {
|
|
|
1637
1637
|
search: e("material.pdf-reader.search", "Search")
|
|
1638
1638
|
};
|
|
1639
1639
|
}
|
|
1640
|
-
function
|
|
1640
|
+
function si() {
|
|
1641
1641
|
let { props: e } = Z();
|
|
1642
|
-
return e.annotate ?
|
|
1642
|
+
return e.annotate ? ni : ni.filter((e) => e !== "annotations");
|
|
1643
1643
|
}
|
|
1644
1644
|
//#endregion
|
|
1645
1645
|
//#region lib/components/ui/media/pdf-reader/partials/panel-tabs.tsx
|
|
1646
|
-
function
|
|
1647
|
-
let { t } = N(), { chrome: n, chromeActions: r } = Z(), i =
|
|
1646
|
+
function ci({ iconOnly: e }) {
|
|
1647
|
+
let { t } = N(), { chrome: n, chromeActions: r } = Z(), i = oi(), a = si(), o = e ? a : a.filter((e) => e !== "search");
|
|
1648
1648
|
return /* @__PURE__ */ H(Se, {
|
|
1649
1649
|
type: "single",
|
|
1650
1650
|
variant: "segmented",
|
|
@@ -1653,7 +1653,7 @@ function si({ iconOnly: e }) {
|
|
|
1653
1653
|
onValueChange: (e) => e && r.openPanelTab(e),
|
|
1654
1654
|
className: "mx-3 mt-3 mb-1 w-auto shrink-0",
|
|
1655
1655
|
children: o.map((t) => {
|
|
1656
|
-
let n =
|
|
1656
|
+
let n = ai[t];
|
|
1657
1657
|
return /* @__PURE__ */ U(xe, {
|
|
1658
1658
|
value: t,
|
|
1659
1659
|
"aria-label": e ? i[t] : void 0,
|
|
@@ -1665,29 +1665,29 @@ function si({ iconOnly: e }) {
|
|
|
1665
1665
|
}
|
|
1666
1666
|
//#endregion
|
|
1667
1667
|
//#region lib/components/ui/media/pdf-reader/partials/phone-sheet.tsx
|
|
1668
|
-
function
|
|
1669
|
-
let { t: e } = N(), { chrome: t, chromeActions: r, mode: i } = Z(), a = e("material.pdf-reader.next.panel", "Document panel"), o = /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(
|
|
1668
|
+
function li() {
|
|
1669
|
+
let { t: e } = N(), { chrome: t, chromeActions: r, mode: i } = Z(), a = e("material.pdf-reader.next.panel", "Document panel"), o = /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(ci, { iconOnly: !1 }), /* @__PURE__ */ H("div", {
|
|
1670
1670
|
className: "flex h-[min(46dvh,22rem)] min-h-0 flex-col",
|
|
1671
|
-
children: /* @__PURE__ */ H(
|
|
1671
|
+
children: /* @__PURE__ */ H(ti, {})
|
|
1672
1672
|
})] });
|
|
1673
1673
|
return i === "fullscreen" ? t.panelOpen ? /* @__PURE__ */ U("aside", {
|
|
1674
1674
|
"aria-label": a,
|
|
1675
|
-
className: n("absolute inset-x-0 bottom-0 z-20 flex flex-col rounded-t-2xl border-t pb-2 shadow-2xl",
|
|
1675
|
+
className: n("absolute inset-x-0 bottom-0 z-20 flex flex-col rounded-t-2xl border-t pb-2 shadow-2xl", Mr),
|
|
1676
1676
|
children: [/* @__PURE__ */ H(ye, {
|
|
1677
1677
|
variant: "ghost",
|
|
1678
1678
|
color: "default",
|
|
1679
1679
|
"aria-label": e("material.buttons.close", "Close"),
|
|
1680
1680
|
className: "absolute end-1 top-1 z-10",
|
|
1681
1681
|
onClick: () => r.closePanel(),
|
|
1682
|
-
children: /* @__PURE__ */ H(
|
|
1682
|
+
children: /* @__PURE__ */ H(lt, {})
|
|
1683
1683
|
}), o]
|
|
1684
|
-
}) : null : /* @__PURE__ */ H(
|
|
1684
|
+
}) : null : /* @__PURE__ */ H($n, {
|
|
1685
1685
|
open: t.panelOpen,
|
|
1686
1686
|
onOpenChange: (e) => !e && r.closePanel(),
|
|
1687
|
-
children: /* @__PURE__ */ U(
|
|
1687
|
+
children: /* @__PURE__ */ U(ir, {
|
|
1688
1688
|
side: "bottom",
|
|
1689
|
-
className: n("gap-0 rounded-t-2xl p-0",
|
|
1690
|
-
children: [/* @__PURE__ */ H(
|
|
1689
|
+
className: n("gap-0 rounded-t-2xl p-0", Mr),
|
|
1690
|
+
children: [/* @__PURE__ */ H(Zn, {
|
|
1691
1691
|
className: "sr-only",
|
|
1692
1692
|
children: a
|
|
1693
1693
|
}), o]
|
|
@@ -1696,20 +1696,20 @@ function ci() {
|
|
|
1696
1696
|
}
|
|
1697
1697
|
//#endregion
|
|
1698
1698
|
//#region lib/components/ui/media/pdf-reader/partials/side-panel.tsx
|
|
1699
|
-
function
|
|
1699
|
+
function ui() {
|
|
1700
1700
|
let { t: e } = N(), { chrome: t } = Z();
|
|
1701
|
-
return t.size === "compact" ? /* @__PURE__ */ H(
|
|
1701
|
+
return t.size === "compact" ? /* @__PURE__ */ H(li, {}) : t.panelOpen ? /* @__PURE__ */ U("aside", {
|
|
1702
1702
|
"aria-label": e("material.pdf-reader.next.panel", "Document panel"),
|
|
1703
|
-
className: n("flex h-full w-56 shrink-0 flex-col border-e border-border",
|
|
1704
|
-
children: [t.size === "medium" ? /* @__PURE__ */ H(
|
|
1703
|
+
className: n("flex h-full w-56 shrink-0 flex-col border-e border-border", Mr),
|
|
1704
|
+
children: [t.size === "medium" ? /* @__PURE__ */ H(ci, { iconOnly: !0 }) : null, /* @__PURE__ */ H("div", {
|
|
1705
1705
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1706
|
-
children: /* @__PURE__ */ H(
|
|
1706
|
+
children: /* @__PURE__ */ H(ti, {})
|
|
1707
1707
|
})]
|
|
1708
1708
|
}) : null;
|
|
1709
1709
|
}
|
|
1710
1710
|
//#endregion
|
|
1711
1711
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-canvas.ts
|
|
1712
|
-
function
|
|
1712
|
+
function di(e) {
|
|
1713
1713
|
let { doc: t, pageNumber: n, scale: r, rotation: i, host: a, cache: o, attempt: s } = e, [c, l] = B(null), u = z(null), d = z(e.onError), f = z(e.onDrawn);
|
|
1714
1714
|
return L(() => {
|
|
1715
1715
|
d.current = e.onError, f.current = e.onDrawn;
|
|
@@ -1722,10 +1722,10 @@ function ui(e) {
|
|
|
1722
1722
|
rotation: i
|
|
1723
1723
|
}, c = new AbortController(), { signal: p } = c, m = o.take(s), h = !!m;
|
|
1724
1724
|
return (async () => {
|
|
1725
|
-
let a = await
|
|
1725
|
+
let a = await Yr(t, n, i, { scale: r }, p);
|
|
1726
1726
|
if (a) {
|
|
1727
1727
|
if (!m) {
|
|
1728
|
-
if (m = document.createElement("canvas"), m.dataset.slot = "pdf-page-canvas", !await
|
|
1728
|
+
if (m = document.createElement("canvas"), m.dataset.slot = "pdf-page-canvas", !await Xr(a, m, p)) return;
|
|
1729
1729
|
h = !0;
|
|
1730
1730
|
}
|
|
1731
1731
|
m.setAttribute("aria-hidden", "true"), e.replaceChildren(m), o.keepScale(r), u.current = a.page, l({
|
|
@@ -1734,9 +1734,9 @@ function ui(e) {
|
|
|
1734
1734
|
}), f.current?.();
|
|
1735
1735
|
}
|
|
1736
1736
|
})().catch((e) => {
|
|
1737
|
-
p.aborted || d.current(
|
|
1737
|
+
p.aborted || d.current(Jr(e));
|
|
1738
1738
|
}), () => {
|
|
1739
|
-
c.abort(), m && h ? o.put(s, m) :
|
|
1739
|
+
c.abort(), m && h ? o.put(s, m) : Vr(m);
|
|
1740
1740
|
};
|
|
1741
1741
|
}, [
|
|
1742
1742
|
t,
|
|
@@ -1752,7 +1752,7 @@ function ui(e) {
|
|
|
1752
1752
|
}
|
|
1753
1753
|
//#endregion
|
|
1754
1754
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-failure.ts
|
|
1755
|
-
function
|
|
1755
|
+
function fi() {
|
|
1756
1756
|
let [e, t] = B(null), [n, r] = B(0), i = z(null);
|
|
1757
1757
|
return {
|
|
1758
1758
|
failure: e,
|
|
@@ -1776,7 +1776,7 @@ function di() {
|
|
|
1776
1776
|
}
|
|
1777
1777
|
//#endregion
|
|
1778
1778
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-link-labels.ts
|
|
1779
|
-
function
|
|
1779
|
+
function pi(e) {
|
|
1780
1780
|
let { t } = N(), n = z(/* @__PURE__ */ new Map()), r = R(() => ({
|
|
1781
1781
|
external: (e) => t("material.pdf-reader.link-external", "Link: {host}", { host: e }),
|
|
1782
1782
|
goToPage: (e) => t("material.pdf-reader.go-to-page", "Go to page {page}", { page: e }),
|
|
@@ -1790,39 +1790,39 @@ function fi(e) {
|
|
|
1790
1790
|
onAnnotations: F((e) => {
|
|
1791
1791
|
for (let t of e) t.id && n.current.set(t.id, t);
|
|
1792
1792
|
}, []),
|
|
1793
|
-
labelLinks: F((t) =>
|
|
1793
|
+
labelLinks: F((t) => Ht(t, (e) => n.current.get(e), (t) => Kt(e?.current, t), r), [e, r])
|
|
1794
1794
|
};
|
|
1795
1795
|
}
|
|
1796
1796
|
//#endregion
|
|
1797
1797
|
//#region lib/components/ui/media/pdf-viewer/pdf-note-icons.ts
|
|
1798
|
-
var
|
|
1799
|
-
async function
|
|
1800
|
-
let n = [...e?.querySelectorAll(".textAnnotation > img") ?? []].filter((e) =>
|
|
1798
|
+
var mi = "data:,", hi = /annotation-([a-z]+)\.svg$/, gi, _i = () => (gi ??= import("./pdf-note-icons.data-DtpqXoIm.js").then((e) => e.NOTE_ICONS), gi);
|
|
1799
|
+
async function vi(e, t = _i) {
|
|
1800
|
+
let n = [...e?.querySelectorAll(".textAnnotation > img") ?? []].filter((e) => hi.test(e.getAttribute("src") ?? ""));
|
|
1801
1801
|
if (n.length === 0) return;
|
|
1802
1802
|
let r = await t();
|
|
1803
1803
|
for (let e of n) {
|
|
1804
|
-
let t = r[
|
|
1804
|
+
let t = r[hi.exec(e.getAttribute("src") ?? "")?.[1] ?? ""] ?? r.note;
|
|
1805
1805
|
t && (e.src = t);
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
1808
|
//#endregion
|
|
1809
1809
|
//#region lib/components/ui/media/pdf-viewer/pdf-worker-url.ts
|
|
1810
|
-
function
|
|
1810
|
+
function yi() {
|
|
1811
1811
|
return new URL("" + new URL("pdf.worker.min.mjs", import.meta.url).href, "" + import.meta.url).href;
|
|
1812
1812
|
}
|
|
1813
1813
|
//#endregion
|
|
1814
1814
|
//#region lib/components/ui/media/pdf-reader/engine/pdfjs.lazy.ts
|
|
1815
|
-
var
|
|
1816
|
-
function
|
|
1817
|
-
return
|
|
1815
|
+
var bi;
|
|
1816
|
+
function xi() {
|
|
1817
|
+
return bi ??= import("./pdf-MkmivNXn.js").then((e) => {
|
|
1818
1818
|
let t = e;
|
|
1819
|
-
return t.GlobalWorkerOptions.workerSrc =
|
|
1820
|
-
}),
|
|
1819
|
+
return t.GlobalWorkerOptions.workerSrc = yi(), t;
|
|
1820
|
+
}), bi;
|
|
1821
1821
|
}
|
|
1822
1822
|
//#endregion
|
|
1823
1823
|
//#region lib/components/ui/media/pdf-reader/engine/draw-layers.ts
|
|
1824
|
-
async function
|
|
1825
|
-
let i = await
|
|
1824
|
+
async function Si({ page: e, viewport: t }, n, r) {
|
|
1825
|
+
let i = await xi(), a = await e.getTextContent();
|
|
1826
1826
|
if (r.aborted) return null;
|
|
1827
1827
|
n.replaceChildren();
|
|
1828
1828
|
let o = new i.TextLayer({
|
|
@@ -1835,8 +1835,8 @@ async function xi({ page: e, viewport: t }, n, r) {
|
|
|
1835
1835
|
strs: o.textContentItemsStr
|
|
1836
1836
|
};
|
|
1837
1837
|
}
|
|
1838
|
-
async function
|
|
1839
|
-
let a = await
|
|
1838
|
+
async function Ci({ page: e, viewport: t }, n, r, i) {
|
|
1839
|
+
let a = await xi(), o = await e.getAnnotations({ intent: "display" });
|
|
1840
1840
|
if (i.aborted) return null;
|
|
1841
1841
|
n.replaceChildren();
|
|
1842
1842
|
let s = t.clone({ dontFlip: !0 }), { doc: c, linkService: l } = r;
|
|
@@ -1855,27 +1855,27 @@ async function Si({ page: e, viewport: t }, n, r, i) {
|
|
|
1855
1855
|
annotations: o,
|
|
1856
1856
|
annotationStorage: c.annotationStorage,
|
|
1857
1857
|
div: n,
|
|
1858
|
-
imageResourcesPath:
|
|
1858
|
+
imageResourcesPath: mi,
|
|
1859
1859
|
linkService: l,
|
|
1860
1860
|
page: e,
|
|
1861
1861
|
renderForms: !1,
|
|
1862
1862
|
viewport: s
|
|
1863
|
-
}), i.aborted ? null : (await
|
|
1863
|
+
}), i.aborted ? null : (await vi(n), o);
|
|
1864
1864
|
}
|
|
1865
1865
|
//#endregion
|
|
1866
1866
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-layers.ts
|
|
1867
|
-
function
|
|
1868
|
-
let { drawn: t, pageNumber: n, doc: r, linkService: i, highlight: a } = e, { text: o, annotations: s, page: c } = e, [l, u] = B(null), [d, f] = B(0), { onAnnotations: p, labelLinks: m } =
|
|
1867
|
+
function wi(e) {
|
|
1868
|
+
let { drawn: t, pageNumber: n, doc: r, linkService: i, highlight: a } = e, { text: o, annotations: s, page: c } = e, [l, u] = B(null), [d, f] = B(0), { onAnnotations: p, labelLinks: m } = pi(e.pdfRef);
|
|
1869
1869
|
I(() => {
|
|
1870
1870
|
let e = o.current;
|
|
1871
1871
|
if (!t || !e) return;
|
|
1872
1872
|
let n = new AbortController();
|
|
1873
|
-
return
|
|
1873
|
+
return Si(t, e, n.signal).then((e) => e && u(e)).catch(() => {}), () => n.abort();
|
|
1874
1874
|
}, [t, o]), I(() => {
|
|
1875
1875
|
let e = s.current;
|
|
1876
1876
|
if (!t || !e || !r || !i) return;
|
|
1877
1877
|
let n = new AbortController();
|
|
1878
|
-
return
|
|
1878
|
+
return Ci(t, e, {
|
|
1879
1879
|
doc: r,
|
|
1880
1880
|
linkService: i
|
|
1881
1881
|
}, n.signal).then((e) => {
|
|
@@ -1896,7 +1896,7 @@ function Ci(e) {
|
|
|
1896
1896
|
]);
|
|
1897
1897
|
let h = a.texts[n - 1], g = a.matches[n - 1], _ = a.current?.page === n ? a.current.hit : -1;
|
|
1898
1898
|
I(() => {
|
|
1899
|
-
l &&
|
|
1899
|
+
l && Et(l, {
|
|
1900
1900
|
text: h,
|
|
1901
1901
|
matches: g,
|
|
1902
1902
|
current: _,
|
|
@@ -1912,7 +1912,7 @@ function Ci(e) {
|
|
|
1912
1912
|
}
|
|
1913
1913
|
//#endregion
|
|
1914
1914
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-drawing.ts
|
|
1915
|
-
function
|
|
1915
|
+
function Ti(e) {
|
|
1916
1916
|
let { doc: t, cache: n, pdfRef: r, pageRefs: i, highlight: a, linkService: o } = e, { scale: s, rotation: c, searchQuery: l, nightMode: u } = e;
|
|
1917
1917
|
return R(() => ({
|
|
1918
1918
|
doc: t,
|
|
@@ -1938,8 +1938,8 @@ function wi(e) {
|
|
|
1938
1938
|
u
|
|
1939
1939
|
]);
|
|
1940
1940
|
}
|
|
1941
|
-
function
|
|
1942
|
-
let { doc: n, scale: r, rotation: i, pageRefs: a } = t, o = z(null), s = z(null), c = z(null), l = z(null), u =
|
|
1941
|
+
function Ei(e, t) {
|
|
1942
|
+
let { doc: n, scale: r, rotation: i, pageRefs: a } = t, o = z(null), s = z(null), c = z(null), l = z(null), u = fi(), d = di({
|
|
1943
1943
|
doc: n,
|
|
1944
1944
|
pageNumber: e,
|
|
1945
1945
|
scale: r,
|
|
@@ -1950,7 +1950,7 @@ function Ti(e, t) {
|
|
|
1950
1950
|
onError: u.onError,
|
|
1951
1951
|
onDrawn: u.onDrawn
|
|
1952
1952
|
});
|
|
1953
|
-
return
|
|
1953
|
+
return wi({
|
|
1954
1954
|
drawn: d,
|
|
1955
1955
|
pageNumber: e,
|
|
1956
1956
|
doc: n,
|
|
@@ -1974,18 +1974,18 @@ function Ti(e, t) {
|
|
|
1974
1974
|
}
|
|
1975
1975
|
//#endregion
|
|
1976
1976
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-scroll.ts
|
|
1977
|
-
function
|
|
1977
|
+
function Di(e, t, n) {
|
|
1978
1978
|
let { scrollTop: r, clientHeight: i } = e, a = e.scrollLeft + (t ? e.scrollWidth - e.clientWidth : 0) + e.clientWidth / 2 - e.scrollWidth / 2 + n.maxWidth / 2, o = r + i >= e.scrollHeight - 2;
|
|
1979
1979
|
return {
|
|
1980
|
-
anchor:
|
|
1981
|
-
page:
|
|
1980
|
+
anchor: Tt(n, r, a),
|
|
1981
|
+
page: Nt(n, {
|
|
1982
1982
|
top: r - 20,
|
|
1983
1983
|
height: i,
|
|
1984
1984
|
atEnd: o
|
|
1985
1985
|
})
|
|
1986
1986
|
};
|
|
1987
1987
|
}
|
|
1988
|
-
function
|
|
1988
|
+
function Oi(e) {
|
|
1989
1989
|
let { scroller: t, layout: n, currentPage: r } = e, [i, a] = B({
|
|
1990
1990
|
top: 0,
|
|
1991
1991
|
height: 0
|
|
@@ -2010,7 +2010,7 @@ function Di(e) {
|
|
|
2010
2010
|
}, []);
|
|
2011
2011
|
return L(() => {
|
|
2012
2012
|
let e = t.current;
|
|
2013
|
-
e && u(e,
|
|
2013
|
+
e && u(e, jt(n, o.current));
|
|
2014
2014
|
}, [
|
|
2015
2015
|
n,
|
|
2016
2016
|
t,
|
|
@@ -2020,7 +2020,7 @@ function Di(e) {
|
|
|
2020
2020
|
!e || r === s.current || (s.current = r, o.current = {
|
|
2021
2021
|
page: r,
|
|
2022
2022
|
fraction: 0
|
|
2023
|
-
}, u(e,
|
|
2023
|
+
}, u(e, jt(l.current.layout, o.current)));
|
|
2024
2024
|
}, [
|
|
2025
2025
|
r,
|
|
2026
2026
|
t,
|
|
@@ -2036,7 +2036,7 @@ function Di(e) {
|
|
|
2036
2036
|
height: i
|
|
2037
2037
|
}), c.current !== null && Math.abs(t - (c.current ?? 0)) < 2) return;
|
|
2038
2038
|
c.current = null;
|
|
2039
|
-
let { options: u, layout: d } = l.current, f =
|
|
2039
|
+
let { options: u, layout: d } = l.current, f = Di(e, r, d);
|
|
2040
2040
|
o.current = f.anchor, !(performance.now() < u.spyHold.current) && f.page !== s.current && (s.current = f.page, u.goToPage(f.page));
|
|
2041
2041
|
}, u = () => {
|
|
2042
2042
|
n ||= requestAnimationFrame(i);
|
|
@@ -2048,16 +2048,16 @@ function Di(e) {
|
|
|
2048
2048
|
}
|
|
2049
2049
|
//#endregion
|
|
2050
2050
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-window.ts
|
|
2051
|
-
var
|
|
2052
|
-
function
|
|
2053
|
-
let { state: i, scale: a, doc: o, actions: s } = e, { goToPage: c } = s, { reportPage: l } = e, u = le(t), d = R(() =>
|
|
2051
|
+
var ki = 1;
|
|
2052
|
+
function Ai(e, t, n = "_blank", r = "single") {
|
|
2053
|
+
let { state: i, scale: a, doc: o, actions: s } = e, { goToPage: c } = s, { reportPage: l } = e, u = le(t), d = R(() => Ir(i.numPages, i.pageSizes ?? [], a, i.rotation, r, u), [
|
|
2054
2054
|
i.numPages,
|
|
2055
2055
|
i.pageSizes,
|
|
2056
2056
|
a,
|
|
2057
2057
|
i.rotation,
|
|
2058
2058
|
r,
|
|
2059
2059
|
u
|
|
2060
|
-
]), f =
|
|
2060
|
+
]), f = Oi({
|
|
2061
2061
|
scroller: t,
|
|
2062
2062
|
layout: d,
|
|
2063
2063
|
currentPage: i.currentPage,
|
|
@@ -2066,11 +2066,11 @@ function ki(e, t, n = "_blank", r = "single") {
|
|
|
2066
2066
|
});
|
|
2067
2067
|
return {
|
|
2068
2068
|
layout: d,
|
|
2069
|
-
shown:
|
|
2069
|
+
shown: At(d, {
|
|
2070
2070
|
top: f.top - 20,
|
|
2071
2071
|
height: f.height || (i.containerHeight ?? 800)
|
|
2072
|
-
},
|
|
2073
|
-
linkService: R(() => o ?
|
|
2072
|
+
}, ki),
|
|
2073
|
+
linkService: R(() => o ? Ot({
|
|
2074
2074
|
doc: o,
|
|
2075
2075
|
goToPage: c,
|
|
2076
2076
|
externalLinkTarget: n
|
|
@@ -2083,8 +2083,8 @@ function ki(e, t, n = "_blank", r = "single") {
|
|
|
2083
2083
|
}
|
|
2084
2084
|
//#endregion
|
|
2085
2085
|
//#region lib/components/ui/media/pdf-reader/partials/page-failure.tsx
|
|
2086
|
-
function
|
|
2087
|
-
let { t: o } = N(), s =
|
|
2086
|
+
function ji({ pageNumber: e, error: t, busy: r, onRetry: i, ref: a }) {
|
|
2087
|
+
let { t: o } = N(), s = Dt(t).kind === "canvas" ? o("material.pdf-reader.next.canvas-error", "This page is too large to display on this device") : o("material.pdf-reader.next.page-error", "This page could not be displayed");
|
|
2088
2088
|
return /* @__PURE__ */ U("div", {
|
|
2089
2089
|
ref: a,
|
|
2090
2090
|
"data-page-failure": "",
|
|
@@ -2093,7 +2093,7 @@ function Ai({ pageNumber: e, error: t, busy: r, onRetry: i, ref: a }) {
|
|
|
2093
2093
|
children: [/* @__PURE__ */ U("div", {
|
|
2094
2094
|
role: "status",
|
|
2095
2095
|
className: "flex flex-col items-center gap-3",
|
|
2096
|
-
children: [/* @__PURE__ */ H(
|
|
2096
|
+
children: [/* @__PURE__ */ H(ze, {
|
|
2097
2097
|
"aria-hidden": !0,
|
|
2098
2098
|
className: "size-6 shrink-0"
|
|
2099
2099
|
}), /* @__PURE__ */ H("p", {
|
|
@@ -2107,7 +2107,7 @@ function Ai({ pageNumber: e, error: t, busy: r, onRetry: i, ref: a }) {
|
|
|
2107
2107
|
"aria-disabled": r || void 0,
|
|
2108
2108
|
onClick: r ? void 0 : i,
|
|
2109
2109
|
"aria-label": o("material.pdf-reader.next.retry-page", "Retry page {page}", { page: e }),
|
|
2110
|
-
children: [/* @__PURE__ */ H(
|
|
2110
|
+
children: [/* @__PURE__ */ H(nt, {
|
|
2111
2111
|
"aria-hidden": !0,
|
|
2112
2112
|
className: n(r && "animate-spin motion-reduce:animate-none")
|
|
2113
2113
|
}), o("material.pdf-reader.retry", "Retry")]
|
|
@@ -2116,8 +2116,8 @@ function Ai({ pageNumber: e, error: t, busy: r, onRetry: i, ref: a }) {
|
|
|
2116
2116
|
}
|
|
2117
2117
|
//#endregion
|
|
2118
2118
|
//#region lib/components/ui/media/pdf-reader/partials/page-view.tsx
|
|
2119
|
-
var
|
|
2120
|
-
let { setPage: s, canvas: c, text: l, annotations: u, drawn: d, failed: f } =
|
|
2119
|
+
var Mi = mt(function({ pageNumber: e, top: t, offset: r, width: i, height: a, env: o }) {
|
|
2120
|
+
let { setPage: s, canvas: c, text: l, annotations: u, drawn: d, failed: f } = Ei(e, o), p = {
|
|
2121
2121
|
top: t,
|
|
2122
2122
|
left: `calc(50% + ${r}px)`,
|
|
2123
2123
|
width: i,
|
|
@@ -2145,7 +2145,7 @@ var ji = pt(function({ pageNumber: e, top: t, offset: r, width: i, height: a, en
|
|
|
2145
2145
|
ref: u,
|
|
2146
2146
|
className: "annotationLayer"
|
|
2147
2147
|
}),
|
|
2148
|
-
f.failure && /* @__PURE__ */ H(
|
|
2148
|
+
f.failure && /* @__PURE__ */ H(ji, {
|
|
2149
2149
|
ref: f.box,
|
|
2150
2150
|
pageNumber: e,
|
|
2151
2151
|
error: f.failure.error,
|
|
@@ -2157,8 +2157,8 @@ var ji = pt(function({ pageNumber: e, top: t, offset: r, width: i, height: a, en
|
|
|
2157
2157
|
});
|
|
2158
2158
|
//#endregion
|
|
2159
2159
|
//#region lib/components/ui/media/pdf-reader/partials/viewport.tsx
|
|
2160
|
-
function
|
|
2161
|
-
let { t: e } = N(), { props: t, ...r } = Z(), i = Q(), a = z(null), { layout: o } = r, { layout: s, shown: c, linkService: l } =
|
|
2160
|
+
function Ni() {
|
|
2161
|
+
let { t: e } = N(), { props: t, ...r } = Z(), i = Q(), a = z(null), { layout: o } = r, { layout: s, shown: c, linkService: l } = Ai(i, a, t.externalLinkTarget, o.mode), u = Ti({
|
|
2162
2162
|
doc: i.doc,
|
|
2163
2163
|
cache: i.canvasCache,
|
|
2164
2164
|
pdfRef: i.pdfRef,
|
|
@@ -2170,7 +2170,7 @@ function Mi() {
|
|
|
2170
2170
|
searchQuery: i.state.searchQuery,
|
|
2171
2171
|
nightMode: i.state.nightMode
|
|
2172
2172
|
}), d = [];
|
|
2173
|
-
for (let e = c.first; e <= c.last; e++) d.push(/* @__PURE__ */ H(
|
|
2173
|
+
for (let e = c.first; e <= c.last; e++) d.push(/* @__PURE__ */ H(Mi, {
|
|
2174
2174
|
pageNumber: e + 1,
|
|
2175
2175
|
top: 20 + (s.tops[e] ?? 0),
|
|
2176
2176
|
offset: (s.lefts[e] ?? 0) - s.maxWidth / 2,
|
|
@@ -2197,16 +2197,16 @@ function Mi() {
|
|
|
2197
2197
|
}
|
|
2198
2198
|
//#endregion
|
|
2199
2199
|
//#region lib/components/ui/media/pdf-reader/partials/body.tsx
|
|
2200
|
-
function
|
|
2200
|
+
function Pi() {
|
|
2201
2201
|
let { state: e, containerRef: t, handlers: n } = Q(), r = e.numPages > 0 && !e.error && !e.isPasswordProtected;
|
|
2202
2202
|
return /* @__PURE__ */ U("div", {
|
|
2203
2203
|
className: "flex min-h-0 min-w-0 flex-1",
|
|
2204
|
-
children: [r ? /* @__PURE__ */ H(
|
|
2204
|
+
children: [r ? /* @__PURE__ */ H(ui, {}) : null, /* @__PURE__ */ U("div", {
|
|
2205
2205
|
ref: t,
|
|
2206
2206
|
tabIndex: -1,
|
|
2207
2207
|
"aria-busy": e.isLoading || void 0,
|
|
2208
2208
|
className: "relative min-w-0 flex-1 overflow-hidden bg-[color-mix(in_oklab,var(--primary)_5%,var(--background))] outline-none dark:bg-[color-mix(in_oklab,var(--primary)_10%,var(--background))]",
|
|
2209
|
-
children: [r ? /* @__PURE__ */ H(
|
|
2209
|
+
children: [r ? /* @__PURE__ */ H(Ni, {}) : null, /* @__PURE__ */ H(jr, { onRetry: () => {
|
|
2210
2210
|
t.current?.focus(), n.onRetry();
|
|
2211
2211
|
} })]
|
|
2212
2212
|
})]
|
|
@@ -2224,7 +2224,7 @@ function $() {
|
|
|
2224
2224
|
}
|
|
2225
2225
|
//#endregion
|
|
2226
2226
|
//#region lib/components/ui/media/pdf-reader/partials/fullscreen-exit.tsx
|
|
2227
|
-
function
|
|
2227
|
+
function Fi() {
|
|
2228
2228
|
let { t: e } = N(), t = $(), { leave: n } = Z(), r = e("material.pdf-reader.exit-fullscreen", "Exit fullscreen");
|
|
2229
2229
|
return /* @__PURE__ */ H("div", {
|
|
2230
2230
|
className: "pointer-events-none absolute top-[max(0.75rem,env(safe-area-inset-top))] z-10 ltr:[inset-inline-end:max(0.75rem,env(safe-area-inset-right))] rtl:[inset-inline-end:max(0.75rem,env(safe-area-inset-left))]",
|
|
@@ -2233,7 +2233,7 @@ function Pi() {
|
|
|
2233
2233
|
...t,
|
|
2234
2234
|
className: "pointer-events-auto",
|
|
2235
2235
|
children: /* @__PURE__ */ H(M, {
|
|
2236
|
-
icon: /* @__PURE__ */ H(
|
|
2236
|
+
icon: /* @__PURE__ */ H(Je, {}),
|
|
2237
2237
|
label: r,
|
|
2238
2238
|
onClick: n
|
|
2239
2239
|
})
|
|
@@ -2242,7 +2242,7 @@ function Pi() {
|
|
|
2242
2242
|
}
|
|
2243
2243
|
//#endregion
|
|
2244
2244
|
//#region lib/components/ui/media/pdf-reader/mode-action.ts
|
|
2245
|
-
function
|
|
2245
|
+
function Ii(e, t, n = !0) {
|
|
2246
2246
|
switch (e) {
|
|
2247
2247
|
case "page": return {
|
|
2248
2248
|
kind: "back",
|
|
@@ -2264,13 +2264,13 @@ function Fi(e, t, n = !0) {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
//#endregion
|
|
2266
2266
|
//#region lib/components/ui/media/pdf-reader/use-fullscreen-enabled.ts
|
|
2267
|
-
var
|
|
2268
|
-
function
|
|
2269
|
-
return
|
|
2267
|
+
var Li = () => () => {};
|
|
2268
|
+
function Ri() {
|
|
2269
|
+
return vt(Li, () => document.fullscreenEnabled === !0, () => !1);
|
|
2270
2270
|
}
|
|
2271
2271
|
//#endregion
|
|
2272
2272
|
//#region lib/components/ui/media/pdf-reader/partials/annotate-header.tsx
|
|
2273
|
-
function
|
|
2273
|
+
function zi() {
|
|
2274
2274
|
let { t: e } = N(), t = $(), { chromeActions: n, props: r } = Z(), i = e("material.pdf-reader.next.annotate-done", "Done"), a = e("material.pdf-reader.next.annotate-title", "Annotation");
|
|
2275
2275
|
return /* @__PURE__ */ U(A, {
|
|
2276
2276
|
label: a,
|
|
@@ -2289,7 +2289,7 @@ function Ri() {
|
|
|
2289
2289
|
})]
|
|
2290
2290
|
}),
|
|
2291
2291
|
/* @__PURE__ */ H(M, {
|
|
2292
|
-
icon: /* @__PURE__ */ H(
|
|
2292
|
+
icon: /* @__PURE__ */ H(st, {}),
|
|
2293
2293
|
label: e("material.pdf-reader.next.annotate-undo", "Undo"),
|
|
2294
2294
|
disabled: !0
|
|
2295
2295
|
}),
|
|
@@ -2308,15 +2308,15 @@ function Ri() {
|
|
|
2308
2308
|
}
|
|
2309
2309
|
//#endregion
|
|
2310
2310
|
//#region lib/components/ui/media/pdf-reader/partials/header-title.tsx
|
|
2311
|
-
function
|
|
2312
|
-
let { t: e, language: t } = N(), { chrome: n, props: r } = Z(), { state: i, bytes: a } = Q(), o = r.file ?
|
|
2311
|
+
function Bi() {
|
|
2312
|
+
let { t: e, language: t } = N(), { chrome: n, props: r } = Z(), { state: i, bytes: a } = Q(), o = r.file ? Qt(r.file, r.fileName, e("material.pdf-reader.default-file-name", "document")) : "", s = i.numPages > 0 ? e("material.pdf-reader.next.meta", "{pages, plural, one {# page} other {# pages}} · {size}", {
|
|
2313
2313
|
pages: i.numPages,
|
|
2314
|
-
size:
|
|
2314
|
+
size: wt(a ?? 0, { locale: t ?? "en" })
|
|
2315
2315
|
}) : "";
|
|
2316
2316
|
return /* @__PURE__ */ U("div", {
|
|
2317
2317
|
className: "flex min-w-0 flex-1 items-center gap-2.5 px-1.5",
|
|
2318
2318
|
children: [
|
|
2319
|
-
/* @__PURE__ */ H(
|
|
2319
|
+
/* @__PURE__ */ H(Re, {
|
|
2320
2320
|
"aria-hidden": !0,
|
|
2321
2321
|
className: "size-5 shrink-0 text-primary-text"
|
|
2322
2322
|
}),
|
|
@@ -2334,26 +2334,26 @@ function zi() {
|
|
|
2334
2334
|
}
|
|
2335
2335
|
//#endregion
|
|
2336
2336
|
//#region lib/components/ui/media/pdf-reader/partials/mode-button.tsx
|
|
2337
|
-
function
|
|
2337
|
+
function Vi({ action: e }) {
|
|
2338
2338
|
let { t } = N(), { leave: n, toggleFullscreen: r } = Z();
|
|
2339
2339
|
switch (e.kind) {
|
|
2340
2340
|
case "back": return /* @__PURE__ */ H(M, {
|
|
2341
|
-
icon: /* @__PURE__ */ H(
|
|
2341
|
+
icon: /* @__PURE__ */ H(Ae, {}),
|
|
2342
2342
|
label: t("material.pdf-reader.next.back", "Back"),
|
|
2343
2343
|
onClick: n
|
|
2344
2344
|
});
|
|
2345
2345
|
case "close": return /* @__PURE__ */ H(M, {
|
|
2346
|
-
icon: /* @__PURE__ */ H(
|
|
2346
|
+
icon: /* @__PURE__ */ H(lt, {}),
|
|
2347
2347
|
label: t("material.buttons.close", "Close"),
|
|
2348
2348
|
onClick: n
|
|
2349
2349
|
});
|
|
2350
2350
|
case "exit-fullscreen": return /* @__PURE__ */ H(M, {
|
|
2351
|
-
icon: /* @__PURE__ */ H(
|
|
2351
|
+
icon: /* @__PURE__ */ H(Je, {}),
|
|
2352
2352
|
label: t("material.pdf-reader.exit-fullscreen", "Exit fullscreen"),
|
|
2353
2353
|
onClick: n
|
|
2354
2354
|
});
|
|
2355
2355
|
case "fullscreen": return /* @__PURE__ */ H(M, {
|
|
2356
|
-
icon: /* @__PURE__ */ H(
|
|
2356
|
+
icon: /* @__PURE__ */ H(Ke, {}),
|
|
2357
2357
|
label: t("material.pdf-reader.fullscreen", "Fullscreen"),
|
|
2358
2358
|
onClick: r
|
|
2359
2359
|
});
|
|
@@ -2361,47 +2361,47 @@ function Bi({ action: e }) {
|
|
|
2361
2361
|
}
|
|
2362
2362
|
//#endregion
|
|
2363
2363
|
//#region lib/components/ui/media/pdf-reader/partials/compact-items.tsx
|
|
2364
|
-
function
|
|
2365
|
-
let { chromeActions: e } = Z(), t =
|
|
2366
|
-
return /* @__PURE__ */ U(V, { children: [
|
|
2367
|
-
let r =
|
|
2364
|
+
function Hi() {
|
|
2365
|
+
let { chromeActions: e } = Z(), t = oi();
|
|
2366
|
+
return /* @__PURE__ */ U(V, { children: [si().filter((e) => e !== "search").map((n) => {
|
|
2367
|
+
let r = ai[n];
|
|
2368
2368
|
return /* @__PURE__ */ U(O, {
|
|
2369
2369
|
onSelect: () => e.openPanelTab(n),
|
|
2370
2370
|
children: [/* @__PURE__ */ H(r, {}), t[n]]
|
|
2371
2371
|
}, n);
|
|
2372
2372
|
}), /* @__PURE__ */ H(D, {})] });
|
|
2373
2373
|
}
|
|
2374
|
-
function
|
|
2374
|
+
function Ui() {
|
|
2375
2375
|
let { t: e } = N(), { actions: t } = Q();
|
|
2376
2376
|
return /* @__PURE__ */ U(V, { children: [
|
|
2377
2377
|
/* @__PURE__ */ H(D, {}),
|
|
2378
2378
|
/* @__PURE__ */ U(O, {
|
|
2379
2379
|
onSelect: t.zoomIn,
|
|
2380
|
-
children: [/* @__PURE__ */ H(
|
|
2380
|
+
children: [/* @__PURE__ */ H(dt, {}), e("material.pdf-reader.zoom-in", "Zoom in")]
|
|
2381
2381
|
}),
|
|
2382
2382
|
/* @__PURE__ */ U(O, {
|
|
2383
2383
|
onSelect: t.zoomOut,
|
|
2384
|
-
children: [/* @__PURE__ */ H(
|
|
2384
|
+
children: [/* @__PURE__ */ H(ft, {}), e("material.pdf-reader.zoom-out", "Zoom out")]
|
|
2385
2385
|
}),
|
|
2386
2386
|
/* @__PURE__ */ U(O, {
|
|
2387
2387
|
onSelect: () => t.setFitMode("width"),
|
|
2388
|
-
children: [/* @__PURE__ */ H(
|
|
2388
|
+
children: [/* @__PURE__ */ H(Ze, {}), e("material.pdf-reader.fit-width-full", "Fit Width")]
|
|
2389
2389
|
}),
|
|
2390
2390
|
/* @__PURE__ */ U(O, {
|
|
2391
2391
|
onSelect: () => t.setFitMode("page"),
|
|
2392
|
-
children: [/* @__PURE__ */ H(
|
|
2392
|
+
children: [/* @__PURE__ */ H(Ke, {}), e("material.pdf-reader.fit-page-full", "Fit Page")]
|
|
2393
2393
|
})
|
|
2394
2394
|
] });
|
|
2395
2395
|
}
|
|
2396
2396
|
//#endregion
|
|
2397
2397
|
//#region lib/components/ui/media/pdf-reader/partials/layout-choice.tsx
|
|
2398
|
-
var
|
|
2398
|
+
var Wi = [
|
|
2399
2399
|
"single",
|
|
2400
2400
|
"spread",
|
|
2401
2401
|
"spread-cover"
|
|
2402
2402
|
];
|
|
2403
|
-
function
|
|
2404
|
-
let { t: e } = N(), { chrome: t, chromeActions: n, layout: r } = Z(), i =
|
|
2403
|
+
function Gi() {
|
|
2404
|
+
let { t: e } = N(), { chrome: t, chromeActions: n, layout: r } = Z(), i = gt(), a = r.narrow ? "single" : t.layout, o = {
|
|
2405
2405
|
single: e("material.pdf-reader.next.layout-single", "Single page"),
|
|
2406
2406
|
spread: e("material.pdf-reader.next.layout-two", "Two pages"),
|
|
2407
2407
|
"spread-cover": e("material.pdf-reader.next.layout-two-cover", "Two pages with cover")
|
|
@@ -2414,7 +2414,7 @@ function Wi() {
|
|
|
2414
2414
|
onValueChange: (e) => {
|
|
2415
2415
|
e !== a && n.setLayout(e);
|
|
2416
2416
|
},
|
|
2417
|
-
children:
|
|
2417
|
+
children: Wi.map((e) => /* @__PURE__ */ H(E, {
|
|
2418
2418
|
value: e,
|
|
2419
2419
|
disabled: r.narrow && e !== "single",
|
|
2420
2420
|
"aria-describedby": r.narrow ? i : void 0,
|
|
@@ -2430,7 +2430,7 @@ function Wi() {
|
|
|
2430
2430
|
}
|
|
2431
2431
|
//#endregion
|
|
2432
2432
|
//#region lib/components/ui/media/pdf-reader/partials/more-menu.tsx
|
|
2433
|
-
function
|
|
2433
|
+
function Ki() {
|
|
2434
2434
|
let { t: e } = N(), t = $(), { chrome: n, mode: r, openSearch: i, props: a } = Z(), { state: o, actions: s, fileActions: c } = Q(), l = u(), d = n.size === "compact", f = r === "fullscreen";
|
|
2435
2435
|
return /* @__PURE__ */ U(ce, {
|
|
2436
2436
|
modal: !1,
|
|
@@ -2438,7 +2438,7 @@ function Gi() {
|
|
|
2438
2438
|
asChild: !0,
|
|
2439
2439
|
className: t.selectedLook === "morph" ? "rounded-[var(--c-ss)] focus:bg-(--m-bg) hover:bg-(--m-bg)" : void 0,
|
|
2440
2440
|
children: /* @__PURE__ */ H(M, {
|
|
2441
|
-
icon: /* @__PURE__ */ H(
|
|
2441
|
+
icon: /* @__PURE__ */ H(Ye, {}),
|
|
2442
2442
|
label: e("material.toolbar.more", "More")
|
|
2443
2443
|
})
|
|
2444
2444
|
}), /* @__PURE__ */ U(se, {
|
|
@@ -2448,38 +2448,38 @@ function Gi() {
|
|
|
2448
2448
|
children: [
|
|
2449
2449
|
f ? /* @__PURE__ */ U(O, {
|
|
2450
2450
|
onSelect: i,
|
|
2451
|
-
children: [/* @__PURE__ */ H(
|
|
2451
|
+
children: [/* @__PURE__ */ H(rt, {}), e("material.pdf-reader.search", "Search")]
|
|
2452
2452
|
}) : null,
|
|
2453
|
-
d ? /* @__PURE__ */ H(
|
|
2453
|
+
d ? /* @__PURE__ */ H(Hi, {}) : null,
|
|
2454
2454
|
/* @__PURE__ */ U(O, {
|
|
2455
2455
|
onSelect: s.rotate,
|
|
2456
|
-
children: [/* @__PURE__ */ H(
|
|
2456
|
+
children: [/* @__PURE__ */ H(nt, {}), e("material.pdf-reader.rotate", "Rotate")]
|
|
2457
2457
|
}),
|
|
2458
2458
|
/* @__PURE__ */ U(O, {
|
|
2459
2459
|
onSelect: c.print,
|
|
2460
|
-
children: [/* @__PURE__ */ H(
|
|
2460
|
+
children: [/* @__PURE__ */ H(tt, {}), e("material.pdf-reader.print", "Print")]
|
|
2461
2461
|
}),
|
|
2462
2462
|
d || f ? /* @__PURE__ */ U(O, {
|
|
2463
2463
|
onSelect: c.download,
|
|
2464
|
-
children: [/* @__PURE__ */ H(
|
|
2464
|
+
children: [/* @__PURE__ */ H(Ie, {}), e("material.pdf-reader.download", "Download")]
|
|
2465
2465
|
}) : null,
|
|
2466
2466
|
/* @__PURE__ */ H(oe, {
|
|
2467
2467
|
checked: o.nightMode,
|
|
2468
2468
|
onCheckedChange: s.toggleNightMode,
|
|
2469
2469
|
children: e("material.pdf-reader.night", "Night mode")
|
|
2470
2470
|
}),
|
|
2471
|
-
d ? /* @__PURE__ */ H(
|
|
2471
|
+
d ? /* @__PURE__ */ H(Ui, {}) : null,
|
|
2472
2472
|
/* @__PURE__ */ H(D, {}),
|
|
2473
|
-
/* @__PURE__ */ H(
|
|
2473
|
+
/* @__PURE__ */ H(Gi, {}),
|
|
2474
2474
|
a.showUnfinished ? /* @__PURE__ */ U(V, { children: [
|
|
2475
2475
|
/* @__PURE__ */ H(D, {}),
|
|
2476
2476
|
/* @__PURE__ */ U(O, {
|
|
2477
2477
|
disabled: !0,
|
|
2478
|
-
children: [/* @__PURE__ */ H(
|
|
2478
|
+
children: [/* @__PURE__ */ H(ct, {}), e("material.pdf-reader.next.read-aloud", "Read aloud")]
|
|
2479
2479
|
}),
|
|
2480
2480
|
/* @__PURE__ */ U(O, {
|
|
2481
2481
|
disabled: !0,
|
|
2482
|
-
children: [/* @__PURE__ */ H(
|
|
2482
|
+
children: [/* @__PURE__ */ H(je, {}), e("material.pdf-reader.next.reflow", "Reflowed text")]
|
|
2483
2483
|
})
|
|
2484
2484
|
] }) : null
|
|
2485
2485
|
]
|
|
@@ -2488,7 +2488,7 @@ function Gi() {
|
|
|
2488
2488
|
}
|
|
2489
2489
|
//#endregion
|
|
2490
2490
|
//#region lib/components/ui/media/pdf-reader/partials/search-header.tsx
|
|
2491
|
-
function
|
|
2491
|
+
function qi() {
|
|
2492
2492
|
let { t: e } = N(), t = $(), { chromeActions: n } = Z();
|
|
2493
2493
|
return /* @__PURE__ */ U(A, {
|
|
2494
2494
|
label: e("material.pdf-reader.search", "Search"),
|
|
@@ -2496,85 +2496,85 @@ function Ki() {
|
|
|
2496
2496
|
...t,
|
|
2497
2497
|
className: "shrink-0 border-b border-border",
|
|
2498
2498
|
children: [/* @__PURE__ */ H(M, {
|
|
2499
|
-
icon: /* @__PURE__ */ H(
|
|
2499
|
+
icon: /* @__PURE__ */ H(Ae, {}),
|
|
2500
2500
|
label: e("material.pdf-reader.next.search-close", "Close search"),
|
|
2501
2501
|
onClick: () => n.closeSearchField()
|
|
2502
|
-
}), /* @__PURE__ */ H(
|
|
2502
|
+
}), /* @__PURE__ */ H(Fr, {})]
|
|
2503
2503
|
});
|
|
2504
2504
|
}
|
|
2505
2505
|
//#endregion
|
|
2506
2506
|
//#region lib/components/ui/media/pdf-reader/partials/header.tsx
|
|
2507
|
-
function qi() {
|
|
2508
|
-
let { chrome: e } = Z(), t = _r.selectHeaderKind(e);
|
|
2509
|
-
return H(t === "annotate" ? Ri : t === "search" ? Ki : Ji, {});
|
|
2510
|
-
}
|
|
2511
2507
|
function Ji() {
|
|
2512
|
-
let {
|
|
2508
|
+
let { chrome: e } = Z(), t = vr.selectHeaderKind(e);
|
|
2509
|
+
return H(t === "annotate" ? zi : t === "search" ? qi : Yi, {});
|
|
2510
|
+
}
|
|
2511
|
+
function Yi() {
|
|
2512
|
+
let { t: e } = N(), t = $(), { chrome: n, mode: r, props: i, openSearch: a } = Z(), { fileActions: o } = Q(), s = n.size === "compact", c = Ri(), l = Ii(r, n.size, i.allowFullscreen !== !1 && c);
|
|
2513
2513
|
return /* @__PURE__ */ U(A, {
|
|
2514
2514
|
label: e("material.pdf-reader.next.header", "Document actions"),
|
|
2515
2515
|
variant: "docked",
|
|
2516
2516
|
...t,
|
|
2517
2517
|
className: "shrink-0 border-b border-border",
|
|
2518
2518
|
children: [
|
|
2519
|
-
l?.place === "start" ? /* @__PURE__ */ H(
|
|
2520
|
-
/* @__PURE__ */ H(
|
|
2519
|
+
l?.place === "start" ? /* @__PURE__ */ H(Vi, { action: l }) : null,
|
|
2520
|
+
/* @__PURE__ */ H(Bi, {}),
|
|
2521
2521
|
/* @__PURE__ */ H(M, {
|
|
2522
|
-
icon: /* @__PURE__ */ H(
|
|
2522
|
+
icon: /* @__PURE__ */ H(rt, {}),
|
|
2523
2523
|
label: e("material.pdf-reader.search", "Search"),
|
|
2524
2524
|
onClick: a,
|
|
2525
2525
|
"data-focus-target": "search"
|
|
2526
2526
|
}),
|
|
2527
2527
|
s ? null : /* @__PURE__ */ H(M, {
|
|
2528
|
-
icon: /* @__PURE__ */ H(
|
|
2528
|
+
icon: /* @__PURE__ */ H(Ie, {}),
|
|
2529
2529
|
label: e("material.pdf-reader.download", "Download"),
|
|
2530
2530
|
onClick: o.download
|
|
2531
2531
|
}),
|
|
2532
|
-
/* @__PURE__ */ H(
|
|
2533
|
-
l?.place === "end" ? /* @__PURE__ */ H(
|
|
2532
|
+
/* @__PURE__ */ H(Ki, {}),
|
|
2533
|
+
l?.place === "end" ? /* @__PURE__ */ H(Vi, { action: l }) : null
|
|
2534
2534
|
]
|
|
2535
2535
|
});
|
|
2536
2536
|
}
|
|
2537
2537
|
//#endregion
|
|
2538
2538
|
//#region lib/components/ui/media/pdf-reader/use-pill-visibility.ts
|
|
2539
|
-
function
|
|
2539
|
+
function Xi(e, t, n) {
|
|
2540
2540
|
let r = z(null);
|
|
2541
2541
|
L(() => {
|
|
2542
2542
|
r.current = e.current?.querySelector("[data-slot=\"scroll-area-viewport\"]") ?? null;
|
|
2543
2543
|
});
|
|
2544
|
-
let i =
|
|
2544
|
+
let i = ke(r), [a, o] = B(!1);
|
|
2545
2545
|
return I(() => {
|
|
2546
2546
|
i || o(!1);
|
|
2547
2547
|
}, [i]), I(() => {
|
|
2548
2548
|
let e = t.current;
|
|
2549
2549
|
if (!e || !i) return;
|
|
2550
2550
|
let n = (e) => {
|
|
2551
|
-
e.key === "Tab" &&
|
|
2551
|
+
e.key === "Tab" && yt(() => o(!0));
|
|
2552
2552
|
};
|
|
2553
2553
|
return e.addEventListener("keydown", n, !0), () => e.removeEventListener("keydown", n, !0);
|
|
2554
2554
|
}, [t, i]), i && !a && !n;
|
|
2555
2555
|
}
|
|
2556
2556
|
//#endregion
|
|
2557
2557
|
//#region lib/components/ui/media/pdf-reader/annotate-colors.ts
|
|
2558
|
-
var
|
|
2558
|
+
var Zi = {
|
|
2559
2559
|
yellow: "bg-yellow-300",
|
|
2560
2560
|
green: "bg-green-400",
|
|
2561
2561
|
blue: "bg-blue-400",
|
|
2562
2562
|
pink: "bg-pink-400",
|
|
2563
2563
|
red: "bg-red-500"
|
|
2564
|
-
},
|
|
2565
|
-
pointer: /* @__PURE__ */ H(
|
|
2566
|
-
highlight: /* @__PURE__ */ H(
|
|
2567
|
-
underline: /* @__PURE__ */ H(
|
|
2568
|
-
pen: /* @__PURE__ */ H(
|
|
2569
|
-
note: /* @__PURE__ */ H(
|
|
2570
|
-
text: /* @__PURE__ */ H(
|
|
2571
|
-
eraser: /* @__PURE__ */ H(
|
|
2572
|
-
},
|
|
2564
|
+
}, Qi = "inline-flex cursor-pointer items-center justify-center whitespace-nowrap rounded-full border-0 bg-transparent px-2.5 text-inherit tabular-nums outline-0 outline-offset-2 transition-colors hover:bg-(--tb-hover) active:bg-(--tb-press) focus-visible:outline-2 focus-visible:outline-(--tb-focus,var(--primary-text))", $i = {
|
|
2565
|
+
pointer: /* @__PURE__ */ H(Xe, {}),
|
|
2566
|
+
highlight: /* @__PURE__ */ H(Ve, {}),
|
|
2567
|
+
underline: /* @__PURE__ */ H(ot, {}),
|
|
2568
|
+
pen: /* @__PURE__ */ H($e, {}),
|
|
2569
|
+
note: /* @__PURE__ */ H(it, {}),
|
|
2570
|
+
text: /* @__PURE__ */ H(at, {}),
|
|
2571
|
+
eraser: /* @__PURE__ */ H(Le, {})
|
|
2572
|
+
}, ea = [
|
|
2573
2573
|
"highlight",
|
|
2574
2574
|
"pen",
|
|
2575
2575
|
"note",
|
|
2576
2576
|
"eraser"
|
|
2577
|
-
],
|
|
2577
|
+
], ta = [
|
|
2578
2578
|
"highlight",
|
|
2579
2579
|
"underline",
|
|
2580
2580
|
"pen",
|
|
@@ -2582,7 +2582,7 @@ var Xi = {
|
|
|
2582
2582
|
"text",
|
|
2583
2583
|
"eraser"
|
|
2584
2584
|
];
|
|
2585
|
-
function
|
|
2585
|
+
function na() {
|
|
2586
2586
|
let { t: e } = N();
|
|
2587
2587
|
return {
|
|
2588
2588
|
tool: {
|
|
@@ -2603,14 +2603,14 @@ function ta() {
|
|
|
2603
2603
|
}
|
|
2604
2604
|
};
|
|
2605
2605
|
}
|
|
2606
|
-
function
|
|
2607
|
-
let { t: e } = N(), { chrome: t, chromeActions: r } = Z(), i = u(), a =
|
|
2606
|
+
function ra() {
|
|
2607
|
+
let { t: e } = N(), { chrome: t, chromeActions: r } = Z(), i = u(), a = na(), o = t.size === "compact" ? ea : ta, s = e("material.pdf-reader.next.color", "Colour: {color}", { color: a.color[t.color] }), c = (e) => /* @__PURE__ */ H(Wn, {
|
|
2608
2608
|
value: e,
|
|
2609
|
-
icon:
|
|
2609
|
+
icon: $i[e],
|
|
2610
2610
|
label: a.tool[e]
|
|
2611
2611
|
}, e);
|
|
2612
2612
|
return /* @__PURE__ */ U(V, { children: [
|
|
2613
|
-
/* @__PURE__ */ U(
|
|
2613
|
+
/* @__PURE__ */ U(Un, {
|
|
2614
2614
|
type: "single",
|
|
2615
2615
|
label: e("material.pdf-reader.next.tools", "Annotation tools"),
|
|
2616
2616
|
value: t.tool,
|
|
@@ -2631,10 +2631,10 @@ function na() {
|
|
|
2631
2631
|
children: /* @__PURE__ */ H("button", {
|
|
2632
2632
|
type: "button",
|
|
2633
2633
|
"aria-label": s,
|
|
2634
|
-
className:
|
|
2634
|
+
className: Qi,
|
|
2635
2635
|
children: /* @__PURE__ */ H("span", {
|
|
2636
2636
|
"aria-hidden": !0,
|
|
2637
|
-
className: n("size-[18px] rounded-full ring-2 ring-foreground/30",
|
|
2637
|
+
className: n("size-[18px] rounded-full ring-2 ring-foreground/30", Zi[t.color])
|
|
2638
2638
|
})
|
|
2639
2639
|
})
|
|
2640
2640
|
})
|
|
@@ -2644,11 +2644,11 @@ function na() {
|
|
|
2644
2644
|
children: /* @__PURE__ */ H(ie, {
|
|
2645
2645
|
value: t.color,
|
|
2646
2646
|
onValueChange: (e) => r.setColor(e),
|
|
2647
|
-
children:
|
|
2647
|
+
children: ri.map((e) => /* @__PURE__ */ U(E, {
|
|
2648
2648
|
value: e,
|
|
2649
2649
|
children: [/* @__PURE__ */ H("span", {
|
|
2650
2650
|
"aria-hidden": !0,
|
|
2651
|
-
className: n("size-3.5 rounded-full",
|
|
2651
|
+
className: n("size-3.5 rounded-full", Zi[e])
|
|
2652
2652
|
}), a.color[e]]
|
|
2653
2653
|
}, e))
|
|
2654
2654
|
})
|
|
@@ -2658,7 +2658,7 @@ function na() {
|
|
|
2658
2658
|
}
|
|
2659
2659
|
//#endregion
|
|
2660
2660
|
//#region lib/components/ui/media/pdf-reader/partials/page-field.tsx
|
|
2661
|
-
function
|
|
2661
|
+
function ia() {
|
|
2662
2662
|
let { t: e } = N(), { state: t, actions: n } = Q(), [r, i] = B(null), a = r ?? String(t.currentPage), o = () => {
|
|
2663
2663
|
let e = Number.parseInt(r ?? "", 10);
|
|
2664
2664
|
Number.isFinite(e) && n.goToPage(e), i(null);
|
|
@@ -2694,7 +2694,7 @@ function ra() {
|
|
|
2694
2694
|
}
|
|
2695
2695
|
//#endregion
|
|
2696
2696
|
//#region lib/components/ui/media/pdf-reader/partials/zoom-control.tsx
|
|
2697
|
-
var
|
|
2697
|
+
var aa = [
|
|
2698
2698
|
.5,
|
|
2699
2699
|
.75,
|
|
2700
2700
|
1,
|
|
@@ -2702,11 +2702,11 @@ var ia = [
|
|
|
2702
2702
|
1.5,
|
|
2703
2703
|
2
|
|
2704
2704
|
];
|
|
2705
|
-
function
|
|
2706
|
-
let { t: e, language: t } = N(), { state: n, actions: r, scale: i, limits: a } = Q(), o = u(), s = (e) =>
|
|
2705
|
+
function oa() {
|
|
2706
|
+
let { t: e, language: t } = N(), { state: n, actions: r, scale: i, limits: a } = Q(), o = u(), s = (e) => kr(e, t ?? "en"), c = n.fitMode === "custom" ? String(n.scale) : n.fitMode, l = (e) => e === "width" || e === "page" ? r.setFitMode(e) : r.setScale(Number(e)), d = e("material.pdf-reader.zoom-menu", "Zoom level {level}", { level: s(i) });
|
|
2707
2707
|
return /* @__PURE__ */ U(V, { children: [
|
|
2708
2708
|
/* @__PURE__ */ H(M, {
|
|
2709
|
-
icon: /* @__PURE__ */ H(
|
|
2709
|
+
icon: /* @__PURE__ */ H(ft, {}),
|
|
2710
2710
|
label: e("material.pdf-reader.zoom-out", "Zoom out"),
|
|
2711
2711
|
disabled: i <= a.minScale,
|
|
2712
2712
|
onClick: r.zoomOut
|
|
@@ -2720,7 +2720,7 @@ function aa() {
|
|
|
2720
2720
|
children: /* @__PURE__ */ H("button", {
|
|
2721
2721
|
type: "button",
|
|
2722
2722
|
"aria-label": d,
|
|
2723
|
-
className:
|
|
2723
|
+
className: Qi,
|
|
2724
2724
|
children: s(i)
|
|
2725
2725
|
})
|
|
2726
2726
|
})
|
|
@@ -2740,7 +2740,7 @@ function aa() {
|
|
|
2740
2740
|
children: e("material.pdf-reader.fit-page-full", "Fit Page")
|
|
2741
2741
|
}),
|
|
2742
2742
|
/* @__PURE__ */ H(D, {}),
|
|
2743
|
-
|
|
2743
|
+
aa.map((e) => /* @__PURE__ */ H(E, {
|
|
2744
2744
|
value: String(e),
|
|
2745
2745
|
children: s(e)
|
|
2746
2746
|
}, e))
|
|
@@ -2749,7 +2749,7 @@ function aa() {
|
|
|
2749
2749
|
})]
|
|
2750
2750
|
}),
|
|
2751
2751
|
/* @__PURE__ */ H(M, {
|
|
2752
|
-
icon: /* @__PURE__ */ H(
|
|
2752
|
+
icon: /* @__PURE__ */ H(dt, {}),
|
|
2753
2753
|
label: e("material.pdf-reader.zoom-in", "Zoom in"),
|
|
2754
2754
|
disabled: i >= a.maxScale,
|
|
2755
2755
|
onClick: r.zoomIn
|
|
@@ -2758,11 +2758,11 @@ function aa() {
|
|
|
2758
2758
|
}
|
|
2759
2759
|
//#endregion
|
|
2760
2760
|
//#region lib/components/ui/media/pdf-reader/partials/pill-nav.tsx
|
|
2761
|
-
function
|
|
2761
|
+
function sa() {
|
|
2762
2762
|
let { t: e } = N(), { chrome: t, chromeActions: n, props: r, mode: i } = Z(), { state: a, actions: o, rowStarts: s } = Q(), { size: c } = t;
|
|
2763
2763
|
return /* @__PURE__ */ U(V, { children: [
|
|
2764
2764
|
c === "medium" ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(me, {
|
|
2765
|
-
icon: /* @__PURE__ */ H(
|
|
2765
|
+
icon: /* @__PURE__ */ H(Qe, {
|
|
2766
2766
|
"aria-hidden": !0,
|
|
2767
2767
|
className: "rtl:-scale-x-100"
|
|
2768
2768
|
}),
|
|
@@ -2771,38 +2771,38 @@ function oa() {
|
|
|
2771
2771
|
onPressedChange: () => n.togglePanel()
|
|
2772
2772
|
}), /* @__PURE__ */ H(j, {})] }) : null,
|
|
2773
2773
|
/* @__PURE__ */ H(M, {
|
|
2774
|
-
icon: /* @__PURE__ */ H(
|
|
2774
|
+
icon: /* @__PURE__ */ H(Ne, {
|
|
2775
2775
|
"aria-hidden": !0,
|
|
2776
2776
|
className: "rtl:rotate-180"
|
|
2777
2777
|
}),
|
|
2778
2778
|
label: e("material.pdf-reader.previous-page", "Previous page"),
|
|
2779
|
-
disabled:
|
|
2779
|
+
disabled: zr(s, a.currentPage, -1) === null,
|
|
2780
2780
|
onClick: o.prevPage
|
|
2781
2781
|
}),
|
|
2782
|
-
/* @__PURE__ */ H(
|
|
2782
|
+
/* @__PURE__ */ H(ia, {}),
|
|
2783
2783
|
/* @__PURE__ */ H(M, {
|
|
2784
|
-
icon: /* @__PURE__ */ H(
|
|
2784
|
+
icon: /* @__PURE__ */ H(Pe, {
|
|
2785
2785
|
"aria-hidden": !0,
|
|
2786
2786
|
className: "rtl:rotate-180"
|
|
2787
2787
|
}),
|
|
2788
2788
|
label: e("material.pdf-reader.next-page", "Next page"),
|
|
2789
|
-
disabled:
|
|
2789
|
+
disabled: zr(s, a.currentPage, 1) === null,
|
|
2790
2790
|
onClick: o.nextPage
|
|
2791
2791
|
}),
|
|
2792
|
-
c === "compact" ? null : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(j, {}), /* @__PURE__ */ H(
|
|
2792
|
+
c === "compact" ? null : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(j, {}), /* @__PURE__ */ H(oa, {})] }),
|
|
2793
2793
|
r.annotate ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(j, {}), /* @__PURE__ */ H(M, {
|
|
2794
|
-
icon: /* @__PURE__ */ H(
|
|
2794
|
+
icon: /* @__PURE__ */ H(et, {}),
|
|
2795
2795
|
label: e("material.pdf-reader.next.annotate", "Annotate"),
|
|
2796
2796
|
onClick: () => n.startAnnotating(),
|
|
2797
2797
|
"data-focus-target": "annotate"
|
|
2798
2798
|
})] }) : null,
|
|
2799
|
-
i === "fullscreen" ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(j, {}), /* @__PURE__ */ H(
|
|
2799
|
+
i === "fullscreen" ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(j, {}), /* @__PURE__ */ H(Ki, {})] }) : null
|
|
2800
2800
|
] });
|
|
2801
2801
|
}
|
|
2802
2802
|
//#endregion
|
|
2803
2803
|
//#region lib/components/ui/media/pdf-reader/partials/pill.tsx
|
|
2804
|
-
function
|
|
2805
|
-
let { t: e } = N(), t = $(), { chrome: n, frameRef: r } = Z(), { state: i, containerRef: a } = Q(), o =
|
|
2804
|
+
function ca() {
|
|
2805
|
+
let { t: e } = N(), t = $(), { chrome: n, frameRef: r } = Z(), { state: i, containerRef: a } = Q(), o = Xi(a, r, n.annotating);
|
|
2806
2806
|
return i.numPages === 0 ? null : /* @__PURE__ */ H("div", {
|
|
2807
2807
|
className: "pointer-events-none absolute inset-x-0 bottom-4 z-10 flex justify-center px-4",
|
|
2808
2808
|
children: /* @__PURE__ */ H(A, {
|
|
@@ -2813,28 +2813,28 @@ function sa() {
|
|
|
2813
2813
|
hidden: o,
|
|
2814
2814
|
className: "pointer-events-auto",
|
|
2815
2815
|
"data-focus-target": "pill",
|
|
2816
|
-
children: n.annotating ? /* @__PURE__ */ H(
|
|
2816
|
+
children: n.annotating ? /* @__PURE__ */ H(ra, {}) : /* @__PURE__ */ H(sa, {})
|
|
2817
2817
|
})
|
|
2818
2818
|
});
|
|
2819
2819
|
}
|
|
2820
2820
|
//#endregion
|
|
2821
2821
|
//#region lib/components/ui/media/pdf-reader/partials/rail.tsx
|
|
2822
|
-
function
|
|
2823
|
-
let { t: e } = N(), { chrome: t, chromeActions: n } = Z(), r =
|
|
2822
|
+
function la() {
|
|
2823
|
+
let { t: e } = N(), { chrome: t, chromeActions: n } = Z(), r = oi(), i = si(), a = vr.selectRailValue(t), o = $();
|
|
2824
2824
|
return /* @__PURE__ */ H(A, {
|
|
2825
2825
|
label: e("material.pdf-reader.next.rail", "Document views"),
|
|
2826
2826
|
variant: "docked",
|
|
2827
2827
|
orientation: "vertical",
|
|
2828
2828
|
...o,
|
|
2829
2829
|
className: "h-auto w-14 shrink-0 self-stretch border-e border-border",
|
|
2830
|
-
children: /* @__PURE__ */ H(
|
|
2830
|
+
children: /* @__PURE__ */ H(Un, {
|
|
2831
2831
|
type: "single",
|
|
2832
2832
|
label: e("material.pdf-reader.next.panel-views", "Panel views"),
|
|
2833
2833
|
value: a,
|
|
2834
2834
|
onValueChange: (e) => n.openPanelTab(e),
|
|
2835
2835
|
children: i.map((e) => {
|
|
2836
|
-
let t =
|
|
2837
|
-
return /* @__PURE__ */ H(
|
|
2836
|
+
let t = ai[e];
|
|
2837
|
+
return /* @__PURE__ */ H(Wn, {
|
|
2838
2838
|
value: e,
|
|
2839
2839
|
icon: /* @__PURE__ */ H(t, {}),
|
|
2840
2840
|
label: r[e],
|
|
@@ -2848,10 +2848,10 @@ function ca() {
|
|
|
2848
2848
|
}
|
|
2849
2849
|
//#endregion
|
|
2850
2850
|
//#region lib/components/ui/media/pdf-reader/partials/frame.tsx
|
|
2851
|
-
function
|
|
2851
|
+
function ua() {
|
|
2852
2852
|
let { t: e } = N(), { chrome: t, chromeActions: r, frameRef: i, mode: a, props: o } = Z();
|
|
2853
|
-
|
|
2854
|
-
let s = a === "fullscreen" &&
|
|
2853
|
+
Cr(i, r.setSize), wr(i, t);
|
|
2854
|
+
let s = a === "fullscreen" && vr.selectHeaderKind(t) === "default", c = Or();
|
|
2855
2855
|
return /* @__PURE__ */ U("section", {
|
|
2856
2856
|
ref: i,
|
|
2857
2857
|
"data-slot": "pdf-reader",
|
|
@@ -2861,23 +2861,23 @@ function la() {
|
|
|
2861
2861
|
onKeyDown: c,
|
|
2862
2862
|
className: n("relative flex h-full min-h-0 flex-col overflow-hidden bg-background text-foreground", a === "embedded" && "rounded-xl border border-border", o.className),
|
|
2863
2863
|
children: [
|
|
2864
|
-
s ? null : /* @__PURE__ */ H(
|
|
2864
|
+
s ? null : /* @__PURE__ */ H(Ji, {}),
|
|
2865
2865
|
/* @__PURE__ */ U("div", {
|
|
2866
2866
|
className: "relative flex min-h-0 flex-1",
|
|
2867
2867
|
children: [
|
|
2868
|
-
s ? /* @__PURE__ */ H(
|
|
2869
|
-
t.size === "expanded" ? /* @__PURE__ */ H(
|
|
2870
|
-
/* @__PURE__ */ H(
|
|
2871
|
-
/* @__PURE__ */ H(
|
|
2868
|
+
s ? /* @__PURE__ */ H(Fi, {}) : null,
|
|
2869
|
+
t.size === "expanded" ? /* @__PURE__ */ H(la, {}) : null,
|
|
2870
|
+
/* @__PURE__ */ H(Pi, {}),
|
|
2871
|
+
/* @__PURE__ */ H(ca, {})
|
|
2872
2872
|
]
|
|
2873
2873
|
}),
|
|
2874
|
-
/* @__PURE__ */ H(
|
|
2874
|
+
/* @__PURE__ */ H(Ar, {})
|
|
2875
2875
|
]
|
|
2876
2876
|
});
|
|
2877
2877
|
}
|
|
2878
2878
|
//#endregion
|
|
2879
2879
|
//#region lib/components/ui/media/pdf-reader/reader-layout.ts
|
|
2880
|
-
function
|
|
2880
|
+
function da(e, t, n) {
|
|
2881
2881
|
let r = n === "compact";
|
|
2882
2882
|
return {
|
|
2883
2883
|
mode: r ? "single" : e === "spread" && t ? "spread-cover" : e,
|
|
@@ -2886,24 +2886,24 @@ function ua(e, t, n) {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
//#endregion
|
|
2888
2888
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-file-actions.ts
|
|
2889
|
-
function
|
|
2889
|
+
function fa({ file: e, fileName: t, pdfRef: n, onDownload: r, onPrint: i }) {
|
|
2890
2890
|
let { t: a } = N(), o = () => n.current?.getData?.();
|
|
2891
2891
|
return {
|
|
2892
2892
|
download: r ?? (() => {
|
|
2893
|
-
e &&
|
|
2893
|
+
e && $t(e, {
|
|
2894
2894
|
fileName: t,
|
|
2895
2895
|
getData: o,
|
|
2896
2896
|
defaultName: a("material.pdf-reader.default-file-name", "document")
|
|
2897
2897
|
});
|
|
2898
2898
|
}),
|
|
2899
2899
|
print: i ?? (() => {
|
|
2900
|
-
e &&
|
|
2900
|
+
e && en(e, { getData: o });
|
|
2901
2901
|
})
|
|
2902
2902
|
};
|
|
2903
2903
|
}
|
|
2904
2904
|
//#endregion
|
|
2905
2905
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-outline-select.ts
|
|
2906
|
-
function
|
|
2906
|
+
function pa(e, t) {
|
|
2907
2907
|
return F(async (n) => {
|
|
2908
2908
|
let r = e.current;
|
|
2909
2909
|
if (!(!r || n.dest == null)) try {
|
|
@@ -2914,14 +2914,14 @@ function fa(e, t) {
|
|
|
2914
2914
|
}
|
|
2915
2915
|
//#endregion
|
|
2916
2916
|
//#region lib/components/ui/media/pdf-viewer/pdf-reader.reducer.ts
|
|
2917
|
-
var
|
|
2918
|
-
function
|
|
2919
|
-
return Math.min(Math.max(e,
|
|
2917
|
+
var ma = .15, ha = .25;
|
|
2918
|
+
function ga(e) {
|
|
2919
|
+
return Math.min(Math.max(e, ha), 5);
|
|
2920
2920
|
}
|
|
2921
|
-
function
|
|
2921
|
+
function _a(e, t) {
|
|
2922
2922
|
return Math.min(Math.max(Math.round(e), 1), t || 1);
|
|
2923
2923
|
}
|
|
2924
|
-
function
|
|
2924
|
+
function va(e) {
|
|
2925
2925
|
return {
|
|
2926
2926
|
numPages: 0,
|
|
2927
2927
|
currentPage: e.initialPage ?? 1,
|
|
@@ -2945,12 +2945,12 @@ function _a(e) {
|
|
|
2945
2945
|
outline: []
|
|
2946
2946
|
};
|
|
2947
2947
|
}
|
|
2948
|
-
function
|
|
2948
|
+
function ya(e, t) {
|
|
2949
2949
|
switch (t.type) {
|
|
2950
2950
|
case "SET_NUM_PAGES": return {
|
|
2951
2951
|
...e,
|
|
2952
2952
|
numPages: t.payload,
|
|
2953
|
-
currentPage:
|
|
2953
|
+
currentPage: _a(e.currentPage, t.payload),
|
|
2954
2954
|
isLoading: !1,
|
|
2955
2955
|
isPasswordProtected: !1,
|
|
2956
2956
|
passwordError: !1,
|
|
@@ -2992,15 +2992,15 @@ function va(e, t) {
|
|
|
2992
2992
|
default: return e;
|
|
2993
2993
|
}
|
|
2994
2994
|
}
|
|
2995
|
-
function
|
|
2995
|
+
function ba(e, t) {
|
|
2996
2996
|
switch (t.type) {
|
|
2997
2997
|
case "SET_PAGE": return {
|
|
2998
2998
|
...e,
|
|
2999
|
-
currentPage:
|
|
2999
|
+
currentPage: _a(t.payload, e.numPages)
|
|
3000
3000
|
};
|
|
3001
3001
|
case "SET_SCALE": return {
|
|
3002
3002
|
...e,
|
|
3003
|
-
scale:
|
|
3003
|
+
scale: ga(t.payload),
|
|
3004
3004
|
fitMode: "custom"
|
|
3005
3005
|
};
|
|
3006
3006
|
case "SET_FIT_MODE": return {
|
|
@@ -3043,12 +3043,12 @@ function ya(e, t) {
|
|
|
3043
3043
|
...e,
|
|
3044
3044
|
outline: t.payload
|
|
3045
3045
|
};
|
|
3046
|
-
default: return
|
|
3046
|
+
default: return ya(e, t);
|
|
3047
3047
|
}
|
|
3048
3048
|
}
|
|
3049
3049
|
//#endregion
|
|
3050
3050
|
//#region lib/components/ui/media/pdf-viewer/pdf-reader-handlers.ts
|
|
3051
|
-
function
|
|
3051
|
+
function xa({ dispatch: e, options: t, pageSizes: n, reload: r }) {
|
|
3052
3052
|
return {
|
|
3053
3053
|
onDocumentLoadSuccess: (r) => {
|
|
3054
3054
|
e({
|
|
@@ -3073,7 +3073,7 @@ function ba({ dispatch: e, options: t, pageSizes: n, reload: r }) {
|
|
|
3073
3073
|
onPasswordSubmit: () => e({ type: "SUBMIT_PASSWORD" })
|
|
3074
3074
|
};
|
|
3075
3075
|
}
|
|
3076
|
-
function
|
|
3076
|
+
function Sa(e, t) {
|
|
3077
3077
|
return {
|
|
3078
3078
|
setScale: (t) => e({
|
|
3079
3079
|
type: "SET_SCALE",
|
|
@@ -3105,8 +3105,8 @@ function xa(e, t) {
|
|
|
3105
3105
|
}
|
|
3106
3106
|
//#endregion
|
|
3107
3107
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-computed-scale.ts
|
|
3108
|
-
function
|
|
3109
|
-
return F(() => e.fitMode === "custom" ? e.scale :
|
|
3108
|
+
function Ca(e) {
|
|
3109
|
+
return F(() => e.fitMode === "custom" ? e.scale : Gt(e.fitMode, e.pageSizes ?? [], e.rotation, {
|
|
3110
3110
|
width: e.containerWidth,
|
|
3111
3111
|
height: e.containerHeight ?? 600
|
|
3112
3112
|
}), [
|
|
@@ -3120,7 +3120,7 @@ function Sa(e) {
|
|
|
3120
3120
|
}
|
|
3121
3121
|
//#endregion
|
|
3122
3122
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-page-area.ts
|
|
3123
|
-
function
|
|
3123
|
+
function wa(e, t, n) {
|
|
3124
3124
|
I(() => {
|
|
3125
3125
|
let r = e.current;
|
|
3126
3126
|
if (!r || !t) return;
|
|
@@ -3140,7 +3140,7 @@ function Ca(e, t, n) {
|
|
|
3140
3140
|
t,
|
|
3141
3141
|
n
|
|
3142
3142
|
]);
|
|
3143
|
-
let [r] = B(() =>
|
|
3143
|
+
let [r] = B(() => zt((e) => n({
|
|
3144
3144
|
type: "SET_PAGE_SIZES",
|
|
3145
3145
|
payload: e
|
|
3146
3146
|
})));
|
|
@@ -3148,9 +3148,9 @@ function Ca(e, t, n) {
|
|
|
3148
3148
|
}
|
|
3149
3149
|
//#endregion
|
|
3150
3150
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-page-report.ts
|
|
3151
|
-
function
|
|
3151
|
+
function Ta(e, t, n) {
|
|
3152
3152
|
let r = z(e.currentPage), i = F((e) => {
|
|
3153
|
-
let { state: i, options: a } = n.current, o =
|
|
3153
|
+
let { state: i, options: a } = n.current, o = _a(e, i.numPages);
|
|
3154
3154
|
o !== i.currentPage && (t({
|
|
3155
3155
|
type: "SET_PAGE",
|
|
3156
3156
|
payload: o
|
|
@@ -3166,15 +3166,15 @@ function wa(e, t, n) {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
//#endregion
|
|
3168
3168
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-reader.ts
|
|
3169
|
-
function
|
|
3170
|
-
let [t, n] =
|
|
3169
|
+
function Ea(e) {
|
|
3170
|
+
let [t, n] = _t(ba, e, va), r = z(null), [i, a] = B(0), o = wa(r, t.numPages > 0, n);
|
|
3171
3171
|
I(() => {
|
|
3172
3172
|
o.reset(), n({
|
|
3173
3173
|
type: "RESET_DOCUMENT",
|
|
3174
3174
|
payload: { page: c.current.options.initialPage ?? 1 }
|
|
3175
3175
|
});
|
|
3176
|
-
}, [
|
|
3177
|
-
let s =
|
|
3176
|
+
}, [tn(e.file), o]);
|
|
3177
|
+
let s = Ca(t), c = z({
|
|
3178
3178
|
state: t,
|
|
3179
3179
|
options: e
|
|
3180
3180
|
});
|
|
@@ -3184,11 +3184,11 @@ function Ta(e) {
|
|
|
3184
3184
|
options: e
|
|
3185
3185
|
};
|
|
3186
3186
|
});
|
|
3187
|
-
let l =
|
|
3187
|
+
let l = Ta(t, n, c), u = F((e) => {
|
|
3188
3188
|
let r = t.fitMode === "custom" ? t.scale : s();
|
|
3189
3189
|
n({
|
|
3190
3190
|
type: "SET_SCALE",
|
|
3191
|
-
payload:
|
|
3191
|
+
payload: ga(r + e)
|
|
3192
3192
|
});
|
|
3193
3193
|
}, [
|
|
3194
3194
|
s,
|
|
@@ -3203,11 +3203,11 @@ function Ta(e) {
|
|
|
3203
3203
|
goToPage: l,
|
|
3204
3204
|
nextPage: () => l(t.currentPage + 1),
|
|
3205
3205
|
prevPage: () => l(t.currentPage - 1),
|
|
3206
|
-
zoomIn: () => u(
|
|
3207
|
-
zoomOut: () => u(-
|
|
3208
|
-
...
|
|
3206
|
+
zoomIn: () => u(ma),
|
|
3207
|
+
zoomOut: () => u(-ma),
|
|
3208
|
+
...Sa(n, t.rotation)
|
|
3209
3209
|
},
|
|
3210
|
-
handlers:
|
|
3210
|
+
handlers: xa({
|
|
3211
3211
|
dispatch: n,
|
|
3212
3212
|
options: e,
|
|
3213
3213
|
pageSizes: o,
|
|
@@ -3215,25 +3215,25 @@ function Ta(e) {
|
|
|
3215
3215
|
}),
|
|
3216
3216
|
reloadKey: i,
|
|
3217
3217
|
limits: {
|
|
3218
|
-
minScale:
|
|
3218
|
+
minScale: ha,
|
|
3219
3219
|
maxScale: 5
|
|
3220
3220
|
}
|
|
3221
3221
|
};
|
|
3222
3222
|
}
|
|
3223
3223
|
//#endregion
|
|
3224
3224
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-document-search.ts
|
|
3225
|
-
var
|
|
3225
|
+
var Da = {
|
|
3226
3226
|
texts: [],
|
|
3227
3227
|
matches: []
|
|
3228
3228
|
};
|
|
3229
|
-
function
|
|
3230
|
-
let [i, a] = B(
|
|
3229
|
+
function Oa(e, t, n, r = 150) {
|
|
3230
|
+
let [i, a] = B(Da);
|
|
3231
3231
|
return I(() => {
|
|
3232
|
-
a(
|
|
3232
|
+
a(Da);
|
|
3233
3233
|
let i = e.current;
|
|
3234
3234
|
if (!i || n === 0 || !t.trim()) return;
|
|
3235
3235
|
let o = !1, s = setTimeout(() => {
|
|
3236
|
-
|
|
3236
|
+
Yt(i, t, (e) => a((t) => Zt(t, e)), () => o).catch(() => {});
|
|
3237
3237
|
}, r);
|
|
3238
3238
|
return () => {
|
|
3239
3239
|
o = !0, clearTimeout(s);
|
|
@@ -3247,8 +3247,8 @@ function Da(e, t, n, r = 150) {
|
|
|
3247
3247
|
}
|
|
3248
3248
|
//#endregion
|
|
3249
3249
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-search-hits.ts
|
|
3250
|
-
function
|
|
3251
|
-
let { pdfRef: t, query: n, numPages: r, goToPage: i, pageRefs: a, holdScrollSpy: o } = e, s =
|
|
3250
|
+
function ka(e) {
|
|
3251
|
+
let { pdfRef: t, query: n, numPages: r, goToPage: i, pageRefs: a, holdScrollSpy: o } = e, s = Oa(t, n, r), [c, l] = B(-1), u = z(() => {});
|
|
3252
3252
|
I(() => {
|
|
3253
3253
|
l(-1), u.current();
|
|
3254
3254
|
}, [
|
|
@@ -3256,7 +3256,7 @@ function Oa(e) {
|
|
|
3256
3256
|
n,
|
|
3257
3257
|
r
|
|
3258
3258
|
]), I(() => () => u.current(), []);
|
|
3259
|
-
let d = R(() => Array.from(s.matches, (e) => e?.length ?? 0), [s.matches]), f = d.reduce((e, t) => e + t, 0), p = c < 0 ? null :
|
|
3259
|
+
let d = R(() => Array.from(s.matches, (e) => e?.length ?? 0), [s.matches]), f = d.reduce((e, t) => e + t, 0), p = c < 0 ? null : Vt(d, c), m = z({
|
|
3260
3260
|
counts: d,
|
|
3261
3261
|
hitCount: f,
|
|
3262
3262
|
hitIndex: c
|
|
@@ -3269,7 +3269,7 @@ function Oa(e) {
|
|
|
3269
3269
|
};
|
|
3270
3270
|
});
|
|
3271
3271
|
let h = F((e) => {
|
|
3272
|
-
let { counts: t, hitCount: n, hitIndex: r } = m.current, s =
|
|
3272
|
+
let { counts: t, hitCount: n, hitIndex: r } = m.current, s = Xt(r, e, n);
|
|
3273
3273
|
if (s < 0) return {
|
|
3274
3274
|
index: 0,
|
|
3275
3275
|
count: n
|
|
@@ -3278,8 +3278,8 @@ function Oa(e) {
|
|
|
3278
3278
|
...m.current,
|
|
3279
3279
|
hitIndex: s
|
|
3280
3280
|
}, l(s);
|
|
3281
|
-
let c =
|
|
3282
|
-
return c && (i(c.page), u.current(), u.current =
|
|
3281
|
+
let c = Vt(t, s);
|
|
3282
|
+
return c && (i(c.page), u.current(), u.current = qt(() => a.current?.get(c.page), c.hit, o)), {
|
|
3283
3283
|
index: s,
|
|
3284
3284
|
count: n
|
|
3285
3285
|
};
|
|
@@ -3309,10 +3309,10 @@ function Oa(e) {
|
|
|
3309
3309
|
}
|
|
3310
3310
|
//#endregion
|
|
3311
3311
|
//#region lib/components/ui/media/pdf-reader/engine/open-engine-document.ts
|
|
3312
|
-
async function
|
|
3313
|
-
let [r, i] = await Promise.all([
|
|
3312
|
+
async function Aa(e, t, n) {
|
|
3313
|
+
let [r, i] = await Promise.all([xi(), nn(e)]);
|
|
3314
3314
|
if (t.aborted) return null;
|
|
3315
|
-
let a = await
|
|
3315
|
+
let a = await Mt(r, i, {
|
|
3316
3316
|
signal: t,
|
|
3317
3317
|
onPassword: n
|
|
3318
3318
|
});
|
|
@@ -3320,7 +3320,7 @@ async function ka(e, t, n) {
|
|
|
3320
3320
|
}
|
|
3321
3321
|
//#endregion
|
|
3322
3322
|
//#region lib/components/ui/media/pdf-reader/engine/use-engine-document.ts
|
|
3323
|
-
function
|
|
3323
|
+
function ja(e, t, n) {
|
|
3324
3324
|
let r = z({
|
|
3325
3325
|
file: e,
|
|
3326
3326
|
events: n
|
|
@@ -3335,17 +3335,17 @@ function Aa(e, t, n) {
|
|
|
3335
3335
|
if (!e) return;
|
|
3336
3336
|
let t = new AbortController(), n;
|
|
3337
3337
|
return (async () => {
|
|
3338
|
-
n = await
|
|
3338
|
+
n = await Aa(e, t.signal, (e, t) => r.current.events.onPassword(e, t === "wrong")) ?? void 0, n && r.current.events.onOpen(n.doc);
|
|
3339
3339
|
})().catch((e) => {
|
|
3340
|
-
t.signal.aborted ||
|
|
3340
|
+
t.signal.aborted || Dt(e).kind !== "aborted" && r.current.events.onFail(Jr(e));
|
|
3341
3341
|
}), () => {
|
|
3342
3342
|
t.abort(), n?.destroy().catch(() => {}), r.current.events.onClose();
|
|
3343
3343
|
};
|
|
3344
|
-
}, [
|
|
3344
|
+
}, [tn(e), t]);
|
|
3345
3345
|
}
|
|
3346
3346
|
//#endregion
|
|
3347
3347
|
//#region lib/components/ui/media/pdf-reader/engine/use-reader-password.ts
|
|
3348
|
-
function
|
|
3348
|
+
function Ma() {
|
|
3349
3349
|
let [e, t] = B(""), n = z(null);
|
|
3350
3350
|
return {
|
|
3351
3351
|
input: e,
|
|
@@ -3363,21 +3363,21 @@ function ja() {
|
|
|
3363
3363
|
}
|
|
3364
3364
|
//#endregion
|
|
3365
3365
|
//#region lib/components/ui/media/pdf-reader/engine/use-reader-engine.ts
|
|
3366
|
-
function
|
|
3366
|
+
function Na(e) {
|
|
3367
3367
|
let [t, n] = B(null);
|
|
3368
3368
|
return I(() => {
|
|
3369
3369
|
if (!e) return;
|
|
3370
|
-
let t =
|
|
3370
|
+
let t = qr();
|
|
3371
3371
|
return n(t), () => {
|
|
3372
3372
|
t.dispose(), n(null);
|
|
3373
3373
|
};
|
|
3374
3374
|
}, [e]), t;
|
|
3375
3375
|
}
|
|
3376
|
-
function
|
|
3377
|
-
let { actions: n, handlers: r } = t, [i, a] = B(null), o = z(null), [s, c] = B(null), l =
|
|
3378
|
-
return
|
|
3376
|
+
function Pa(e, t) {
|
|
3377
|
+
let { actions: n, handlers: r } = t, [i, a] = B(null), o = z(null), [s, c] = B(null), l = Ma(), u = Na(i);
|
|
3378
|
+
return ja(e, t.reloadKey, {
|
|
3379
3379
|
onOpen: (e) => {
|
|
3380
|
-
o.current = e, a(e), r.onDocumentLoadSuccess(e), e.getOutline().then((e) => n.setOutline(
|
|
3380
|
+
o.current = e, a(e), r.onDocumentLoadSuccess(e), e.getOutline().then((e) => n.setOutline(Ut(e))).catch(() => {}), e.getDownloadInfo().then((e) => c(e.length)).catch(() => c(null));
|
|
3381
3381
|
},
|
|
3382
3382
|
onFail: r.onDocumentLoadError,
|
|
3383
3383
|
onPassword: (e, t) => {
|
|
@@ -3396,8 +3396,8 @@ function Na(e, t) {
|
|
|
3396
3396
|
}
|
|
3397
3397
|
//#endregion
|
|
3398
3398
|
//#region lib/components/ui/media/pdf-reader/use-announcements.ts
|
|
3399
|
-
var
|
|
3400
|
-
function
|
|
3399
|
+
var Fa = 1e3;
|
|
3400
|
+
function Ia() {
|
|
3401
3401
|
let e = z({
|
|
3402
3402
|
page: -Infinity,
|
|
3403
3403
|
zoom: -Infinity
|
|
@@ -3408,14 +3408,14 @@ function Fa() {
|
|
|
3408
3408
|
e.current[t] = performance.now(), n(...r);
|
|
3409
3409
|
};
|
|
3410
3410
|
},
|
|
3411
|
-
recent: (t) => performance.now() - e.current[t] <
|
|
3411
|
+
recent: (t) => performance.now() - e.current[t] < Fa
|
|
3412
3412
|
}), []);
|
|
3413
3413
|
}
|
|
3414
3414
|
//#endregion
|
|
3415
3415
|
//#region lib/components/ui/media/pdf-reader/use-asked-actions.ts
|
|
3416
|
-
function
|
|
3417
|
-
let { reader: t, announcements: n, askedPage: r, layout: i, starts: a, scale: o } = e, { actions: s, state: c } = t, { asked: l } = n, u = (e) => s.setScale(
|
|
3418
|
-
let t =
|
|
3416
|
+
function La(e) {
|
|
3417
|
+
let { reader: t, announcements: n, askedPage: r, layout: i, starts: a, scale: o } = e, { actions: s, state: c } = t, { asked: l } = n, u = (e) => s.setScale(ga(o + e)), d = (e) => {
|
|
3418
|
+
let t = zr(a, c.currentPage, e);
|
|
3419
3419
|
t !== null && s.goToPage(t);
|
|
3420
3420
|
}, f = i !== "single";
|
|
3421
3421
|
return {
|
|
@@ -3423,24 +3423,24 @@ function Ia(e) {
|
|
|
3423
3423
|
goToPage: r,
|
|
3424
3424
|
nextPage: l("page", f ? () => d(1) : s.nextPage),
|
|
3425
3425
|
prevPage: l("page", f ? () => d(-1) : s.prevPage),
|
|
3426
|
-
zoomIn: l("zoom", f ? () => u(
|
|
3427
|
-
zoomOut: l("zoom", f ? () => u(-
|
|
3426
|
+
zoomIn: l("zoom", f ? () => u(ma) : s.zoomIn),
|
|
3427
|
+
zoomOut: l("zoom", f ? () => u(-ma) : s.zoomOut),
|
|
3428
3428
|
setScale: l("zoom", s.setScale),
|
|
3429
3429
|
setFitMode: l("zoom", s.setFitMode)
|
|
3430
3430
|
};
|
|
3431
3431
|
}
|
|
3432
3432
|
//#endregion
|
|
3433
3433
|
//#region lib/components/ui/media/pdf-reader/use-reader-document.ts
|
|
3434
|
-
var
|
|
3435
|
-
function
|
|
3434
|
+
var Ra = 900;
|
|
3435
|
+
function za(e, t) {
|
|
3436
3436
|
let { state: n, computedScale: r } = e;
|
|
3437
|
-
return t === "single" || n.fitMode === "custom" ? r() :
|
|
3437
|
+
return t === "single" || n.fitMode === "custom" ? r() : Lr(n.fitMode, t, n.numPages, n.pageSizes ?? [], n.rotation, {
|
|
3438
3438
|
width: n.containerWidth,
|
|
3439
3439
|
height: n.containerHeight ?? 600
|
|
3440
3440
|
});
|
|
3441
3441
|
}
|
|
3442
|
-
function
|
|
3443
|
-
let { file: n, fileName: r, onDownload: i, onPrint: a } = e, o =
|
|
3442
|
+
function Ba(e, t = "single") {
|
|
3443
|
+
let { file: n, fileName: r, onDownload: i, onPrint: a } = e, o = Ea({
|
|
3444
3444
|
file: n,
|
|
3445
3445
|
initialPage: e.initialPage,
|
|
3446
3446
|
initialScale: e.initialScale,
|
|
@@ -3448,22 +3448,22 @@ function za(e, t = "single") {
|
|
|
3448
3448
|
onPageChange: e.onPageChange,
|
|
3449
3449
|
onLoadSuccess: e.onLoadSuccess,
|
|
3450
3450
|
onLoadError: e.onLoadError
|
|
3451
|
-
}), { state: s, actions: c } = o, l =
|
|
3451
|
+
}), { state: s, actions: c } = o, l = Pa(n, o), { pdfRef: u } = l, d = Ia(), { asked: f } = d, p = R(() => f("page", c.goToPage), [f, c.goToPage]), m = z(/* @__PURE__ */ new Map()), h = z(0), g = ka({
|
|
3452
3452
|
pdfRef: u,
|
|
3453
3453
|
query: s.searchQuery,
|
|
3454
3454
|
numPages: s.numPages,
|
|
3455
3455
|
goToPage: p,
|
|
3456
3456
|
pageRefs: m,
|
|
3457
3457
|
holdScrollSpy: () => {
|
|
3458
|
-
h.current = performance.now() +
|
|
3458
|
+
h.current = performance.now() + Ra;
|
|
3459
3459
|
}
|
|
3460
|
-
}), _ =
|
|
3460
|
+
}), _ = fa({
|
|
3461
3461
|
file: n,
|
|
3462
3462
|
fileName: r,
|
|
3463
3463
|
pdfRef: u,
|
|
3464
3464
|
onDownload: i,
|
|
3465
3465
|
onPrint: a
|
|
3466
|
-
}), v =
|
|
3466
|
+
}), v = pa(u, p), y = za(o, t), b = R(() => It(s.numPages, t), [s.numPages, t]), x = La({
|
|
3467
3467
|
reader: o,
|
|
3468
3468
|
announcements: d,
|
|
3469
3469
|
askedPage: p,
|
|
@@ -3488,8 +3488,8 @@ function za(e, t = "single") {
|
|
|
3488
3488
|
}
|
|
3489
3489
|
//#endregion
|
|
3490
3490
|
//#region lib/components/ui/media/pdf-reader/pdf-reader-provider.tsx
|
|
3491
|
-
function
|
|
3492
|
-
let [n, r] =
|
|
3491
|
+
function Va({ props: e, children: t }) {
|
|
3492
|
+
let [n, r] = we(_r, e.defaultLayout ? {
|
|
3493
3493
|
...e.initialChrome,
|
|
3494
3494
|
layout: e.defaultLayout
|
|
3495
3495
|
} : e.initialChrome), i = e.layout ?? n.layout, a = R(() => ({
|
|
@@ -3505,12 +3505,12 @@ function Ba({ props: e, children: t }) {
|
|
|
3505
3505
|
i,
|
|
3506
3506
|
o,
|
|
3507
3507
|
s
|
|
3508
|
-
]), l = R(() =>
|
|
3508
|
+
]), l = R(() => da(i, e.coverPage, a.size), [
|
|
3509
3509
|
i,
|
|
3510
3510
|
e.coverPage,
|
|
3511
3511
|
a.size
|
|
3512
|
-
]), d =
|
|
3513
|
-
return /* @__PURE__ */ H(
|
|
3512
|
+
]), d = Ba(e, l.mode), f = z(null), p = u(), m = p !== null && p === f.current ? "fullscreen" : e.mode ?? "embedded", { onOpenChange: h, onBack: g, onExitFullscreen: _ } = e, v = a.size;
|
|
3513
|
+
return /* @__PURE__ */ H(yr, {
|
|
3514
3514
|
value: R(() => ({
|
|
3515
3515
|
chrome: a,
|
|
3516
3516
|
chromeActions: c,
|
|
@@ -3538,7 +3538,7 @@ function Ba({ props: e, children: t }) {
|
|
|
3538
3538
|
g,
|
|
3539
3539
|
_
|
|
3540
3540
|
]),
|
|
3541
|
-
children: /* @__PURE__ */ H(
|
|
3541
|
+
children: /* @__PURE__ */ H(br, {
|
|
3542
3542
|
value: d,
|
|
3543
3543
|
children: t
|
|
3544
3544
|
})
|
|
@@ -3546,24 +3546,24 @@ function Ba({ props: e, children: t }) {
|
|
|
3546
3546
|
}
|
|
3547
3547
|
//#endregion
|
|
3548
3548
|
//#region lib/components/ui/media/pdf-reader/pdf-reader.tsx
|
|
3549
|
-
function
|
|
3550
|
-
let t = e.file ? /* @__PURE__ */ H(
|
|
3549
|
+
function Ha(e) {
|
|
3550
|
+
let t = e.file ? /* @__PURE__ */ H(Va, {
|
|
3551
3551
|
props: e,
|
|
3552
|
-
children: /* @__PURE__ */ H(
|
|
3553
|
-
}) : /* @__PURE__ */ H(
|
|
3554
|
-
return e.mode === "dialog" ? /* @__PURE__ */ H(
|
|
3552
|
+
children: /* @__PURE__ */ H(ua, {})
|
|
3553
|
+
}) : /* @__PURE__ */ H(dr, { className: e.className });
|
|
3554
|
+
return e.mode === "dialog" ? /* @__PURE__ */ H(gr, {
|
|
3555
3555
|
open: e.open ?? !0,
|
|
3556
3556
|
onOpenChange: e.onOpenChange,
|
|
3557
3557
|
title: e.fileName,
|
|
3558
3558
|
children: t
|
|
3559
3559
|
}) : t;
|
|
3560
3560
|
}
|
|
3561
|
-
var
|
|
3562
|
-
function Ga(e) {
|
|
3563
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) => !Wa.has(e)));
|
|
3564
|
-
}
|
|
3561
|
+
var Ua = Oe(Ha), Wa = /* @__PURE__ */ e({ PdfReader: () => qa }), Ga = new Set(ii);
|
|
3565
3562
|
function Ka(e) {
|
|
3566
|
-
return
|
|
3563
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => !Ga.has(e)));
|
|
3564
|
+
}
|
|
3565
|
+
function qa(e) {
|
|
3566
|
+
return /* @__PURE__ */ H(Ua, { ...Ka(e) });
|
|
3567
3567
|
}
|
|
3568
3568
|
//#endregion
|
|
3569
|
-
export {
|
|
3569
|
+
export { Wn as _, or as a, ir as c, Xn as d, Yn as f, Un as g, Kn as h, ar as i, er as l, Gn as m, Wa as n, $n as o, Zn as p, ur as r, tr as s, qa as t, Qn as u, on as v };
|