@nxgt/material 3.5.0 → 3.7.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 +92 -0
- package/README.md +46 -1
- package/dist/components/components.css +2 -0
- package/dist/components/theme-tokens.css +84 -72
- package/dist/components/tones/tokens.css +5 -5
- package/dist/components/ui/display/chip/chip-hairline.css +1 -1
- package/dist/components/ui/layout/sidebar/sidebar-tokens.css +1 -1
- package/dist/components/ui/overlays/dialog/dialog.css +2 -2
- package/dist/components/ui/primitives/field-box/field-box-tokens.css +1 -1
- package/dist/components/ui/primitives/toggle-group/toggle-group-segmented.css +2 -2
- package/dist/components/ui/primitives/toggle-group/toggle-group-separate.css +1 -1
- package/dist/components/ui/widgets/drawing/drawing-animate.css +123 -0
- package/dist/components/ui/widgets/drawing/drawing.css +459 -0
- package/dist/{components-CXpL1zEs.js → components-BX4icy-g.js} +734 -734
- package/dist/components.js +16 -16
- package/dist/{dialog-JQT6iETD.js → dialog-DdJ1C4BR.js} +168 -168
- package/dist/dnd.js +1 -1
- package/dist/draw-animate.js +106 -0
- package/dist/draw-png.js +2 -0
- package/dist/draw-sketch.js +38 -0
- package/dist/draw.js +65 -0
- package/dist/drawing-B8VuG7nx.js +390 -0
- package/dist/drawing-context-CeKeZE6b.js +10 -0
- package/dist/editor.js +110 -110
- package/dist/{icon-badge-C30yKsAM.js → icon-badge-Bb5-73XP.js} +18 -18
- package/dist/{icon-button-BXlI3DJ_.js → icon-button-5A6Mrj6w.js} +60 -90
- package/dist/lib/components/ui/display/shape/use-shape-morph.d.ts +1 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-a11y.d.ts +20 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-context.d.ts +23 -0
- package/dist/lib/components/ui/widgets/drawing/drawing-types.d.ts +63 -0
- package/dist/lib/components/ui/widgets/drawing/drawing.d.ts +17 -0
- package/dist/lib/components/ui/widgets/drawing/index.d.ts +5 -0
- package/dist/lib/components/ui/widgets/drawing/partials/drawing-root.d.ts +17 -0
- package/dist/lib/components/ui/widgets/drawing/partials/interactive-node.d.ts +22 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/content.d.ts +20 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/path.d.ts +29 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/primitive.d.ts +19 -0
- package/dist/lib/components/ui/widgets/drawing/partials/primitives/shapes.d.ts +18 -0
- package/dist/lib/components/ui/widgets/drawing/partials/react-attrs.d.ts +5 -0
- package/dist/lib/components/ui/widgets/drawing/partials/ring.d.ts +9 -0
- package/dist/lib/components/ui/widgets/drawing/partials/svg-tree.d.ts +29 -0
- package/dist/lib/components/ui/widgets/drawing/use-exact-text.d.ts +16 -0
- package/dist/lib/draw/index.d.ts +32 -0
- package/dist/lib/draw-animate/index.d.ts +19 -0
- package/dist/lib/draw-animate/morph-drawing.d.ts +32 -0
- package/dist/lib/draw-animate/reduced-motion.d.ts +2 -0
- package/dist/lib/draw-animate/use-drawing-controls.d.ts +27 -0
- package/dist/lib/draw-animate/use-scene-morph.d.ts +15 -0
- package/dist/lib/draw-png/index.d.ts +11 -0
- package/dist/lib/draw-sketch/index.d.ts +17 -0
- package/dist/lib/draw-sketch/sketch.d.ts +19 -0
- package/dist/lib/print/components/print-drawing.d.ts +16 -0
- package/dist/lib/print/index.d.ts +2 -1
- package/dist/main.js +21 -21
- package/dist/map.js +63 -63
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +123 -115
- package/dist/{public-Cde8_SN8.js → public-CBlV2XuA.js} +742 -742
- package/dist/{sortable-provider-DYlpq8lP.js → sortable-provider-BvD98s8Y.js} +19 -19
- package/dist/{use-chat-composer-BwpSgP_D.js → use-chat-composer-BhdPNmYm.js} +912 -911
- package/dist/use-shape-morph-BKA_R5P5.js +35 -0
- package/docs/README.md +1 -0
- package/docs/components/data-display.md +2 -2
- package/docs/components/rich-widgets.md +196 -0
- package/docs/guides/drawing.md +499 -0
- package/docs/guides/printing.md +47 -0
- package/docs/guides/theming.md +86 -43
- package/docs/previews/rich-widgets-drawing.webp +0 -0
- package/docs/roadmap.md +17 -0
- package/docs/troubleshooting.md +166 -2
- package/lib/components/components.css +2 -0
- package/lib/components/theme-tokens.css +84 -72
- package/lib/components/tones/tokens.css +5 -5
- package/lib/components/ui/display/chip/chip-hairline.css +1 -1
- package/lib/components/ui/layout/sidebar/sidebar-tokens.css +1 -1
- package/lib/components/ui/overlays/dialog/dialog.css +2 -2
- package/lib/components/ui/primitives/field-box/field-box-tokens.css +1 -1
- package/lib/components/ui/primitives/toggle-group/toggle-group-segmented.css +2 -2
- package/lib/components/ui/primitives/toggle-group/toggle-group-separate.css +1 -1
- package/lib/components/ui/widgets/drawing/drawing-animate.css +123 -0
- package/lib/components/ui/widgets/drawing/drawing.css +459 -0
- package/package.json +22 -2
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
2
|
import { n as t } from "./ui.utils-CAnKTCw5.js";
|
|
3
3
|
import { t as n } from "./utils-Bcd2Z3ea.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { r as
|
|
8
|
-
import {
|
|
9
|
-
import { S as pe, a as D, d as O, g as me, h as he, i as ge, m as _e, n as k, r as ve, t as A, u as ye, w as be } from "./toolbar-items-DnkS3bDY.js";
|
|
4
|
+
import { A as r, E as i, M as a, O as o, R as s, a as c, k as l, o as u, w as d } from "./tooltip-tmFoTU_d.js";
|
|
5
|
+
import { $ as f, c as p, d as m, f as h, i as g, l as _, n as v, o as y, t as b, u as x } from "./dropdown-menu-DiZvX4tG.js";
|
|
6
|
+
import { r as S, t as ee } from "./in-dialog-AiwTD3DK.js";
|
|
7
|
+
import { C, D as w, E as T, O as te, S as E, T as ne, _ as re, f as ie, g as ae, k as oe, r as se, t as ce, u as le, w as ue } from "./dialog-DdJ1C4BR.js";
|
|
8
|
+
import { S as de, a as D, d as O, g as fe, h as pe, i as me, m as he, n as k, r as ge, t as A, u as _e, w as ve } from "./toolbar-items-DnkS3bDY.js";
|
|
10
9
|
import { t as j } from "./use-material-translation-hLQzOjF0.js";
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import { n as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
10
|
+
import { t as M } from "./button-1Fornjtn.js";
|
|
11
|
+
import { n as ye, t as be } from "./icon-button-5A6Mrj6w.js";
|
|
12
|
+
import { t as xe } from "./useEvent-2fKq-6w8.js";
|
|
13
|
+
import { i as Se, n as Ce, r as we, t as Te } from "./empty-state-Cpvsmk0R.js";
|
|
14
|
+
import { n as Ee } from "./use-slice-reducer-0r5dXnJe.js";
|
|
15
|
+
import { r as De } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
16
|
+
import { t as Oe } from "./client-only.utils-lQ7GqP8w.js";
|
|
17
|
+
import { t as ke } from "./use-scroll-away-PQRFZkT2.js";
|
|
18
|
+
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";
|
|
19
|
+
import * as N from "react";
|
|
20
|
+
import { createContext as pt, memo as mt, useCallback as P, useContext as ht, useEffect as F, useId as gt, useLayoutEffect as I, useMemo as L, useReducer as _t, useRef as R, useState as z, useSyncExternalStore as vt } from "react";
|
|
21
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
22
|
+
import { flushSync as yt } from "react-dom";
|
|
23
|
+
import { createSlice as bt } from "@reduxjs/toolkit";
|
|
24
|
+
import { STATE_ACTION_KEYS as U, describeError as xt, stateCopy as St } from "@nxgt/material-core/states";
|
|
25
|
+
import { formatFileSize as Ct } from "@nxgt/material-core/format-file-size";
|
|
26
|
+
import { anchorAt as wt, applyPageHighlight as Tt, classifyPdfError as Et, createPdfLinkService as Dt, layoutSpreads as Ot, mountedPages as kt, offsetOf as At, openPdfDocument as jt, pageAtOffset as Mt, planRender as Nt, renderPageToCanvas as Pt, rowStarts as Ft } from "@nxgt/material-core/pdf-reader";
|
|
27
|
+
import { DEFAULT_PAGE_SIZE as It, FIT_PAGES as Lt, createPageSizesLoader as Rt, fitScale as zt, hitAt as Bt, labelLinkAnchors as Vt, mapPdfOutline as Ht, placeholderSize as Ut, readerFitScale as Wt, resolveDestinationPage as Gt, revealHit as Kt, rotatedSize as qt, searchDocument as Jt, stepHit as Yt, withPageMatches as Xt } from "@nxgt/material-core/pdf-viewer";
|
|
28
|
+
import { resolvePdfFileName as Zt } from "@nxgt/material-core/pdf-file-name";
|
|
29
|
+
import { downloadPdfFile as Qt, printPdfFile as $t } from "@nxgt/material-core/pdf-download";
|
|
30
|
+
import { pdfSourceKey as en, toPdfjsParams as tn } from "@nxgt/material-core/pdf-source";
|
|
31
31
|
//#region ../../node_modules/@radix-ui/number/dist/index.mjs
|
|
32
|
-
var
|
|
32
|
+
var nn = Object.defineProperty, rn = (e, t) => nn(e, "name", {
|
|
33
33
|
value: t,
|
|
34
34
|
configurable: !0
|
|
35
35
|
});
|
|
36
|
-
function
|
|
36
|
+
function an(e, [t, n]) {
|
|
37
37
|
return Math.min(n, Math.max(t, e));
|
|
38
38
|
}
|
|
39
|
-
an
|
|
39
|
+
rn(an, "clamp");
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region ../../node_modules/@radix-ui/react-scroll-area/dist/index.mjs
|
|
42
|
-
var
|
|
42
|
+
var on = Object.defineProperty, W = (e, t) => on(e, "name", {
|
|
43
43
|
value: t,
|
|
44
44
|
configurable: !0
|
|
45
45
|
});
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function sn(e, t) {
|
|
47
|
+
return N.useReducer((e, n) => t[e][n] ?? e, e);
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
let { __scopeScrollArea: n, type: r = "hover", dir: i, scrollHideDelay:
|
|
52
|
-
return /* @__PURE__ */
|
|
49
|
+
W(sn, "useStateMachine");
|
|
50
|
+
var cn = "ScrollArea", [ln, un] = r(cn), [dn, G] = ln(cn), fn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
51
|
+
let { __scopeScrollArea: n, type: r = "hover", dir: i, scrollHideDelay: o = 600, ...c } = e, [l, u] = N.useState(null), [d, p] = N.useState(null), [m, h] = N.useState(null), [g, _] = N.useState(null), [v, y] = N.useState(null), [b, x] = N.useState(0), [S, ee] = N.useState(0), [C, w] = N.useState(!1), [T, te] = N.useState(!1), E = s(t, u), ne = f(i);
|
|
52
|
+
return /* @__PURE__ */ V(dn, {
|
|
53
53
|
scope: n,
|
|
54
54
|
type: r,
|
|
55
55
|
dir: ne,
|
|
56
|
-
scrollHideDelay:
|
|
57
|
-
scrollArea:
|
|
56
|
+
scrollHideDelay: o,
|
|
57
|
+
scrollArea: l,
|
|
58
58
|
viewport: d,
|
|
59
|
-
onViewportChange:
|
|
60
|
-
content:
|
|
59
|
+
onViewportChange: p,
|
|
60
|
+
content: m,
|
|
61
61
|
onContentChange: h,
|
|
62
62
|
scrollbarX: g,
|
|
63
63
|
onScrollbarXChange: _,
|
|
64
|
-
scrollbarXEnabled:
|
|
65
|
-
onScrollbarXEnabledChange:
|
|
64
|
+
scrollbarXEnabled: C,
|
|
65
|
+
onScrollbarXEnabledChange: w,
|
|
66
66
|
scrollbarY: v,
|
|
67
67
|
onScrollbarYChange: y,
|
|
68
|
-
scrollbarYEnabled:
|
|
69
|
-
onScrollbarYEnabledChange:
|
|
68
|
+
scrollbarYEnabled: T,
|
|
69
|
+
onScrollbarYEnabledChange: te,
|
|
70
70
|
onCornerWidthChange: x,
|
|
71
|
-
onCornerHeightChange:
|
|
72
|
-
children: /* @__PURE__ */
|
|
71
|
+
onCornerHeightChange: ee,
|
|
72
|
+
children: /* @__PURE__ */ V(a.div, {
|
|
73
73
|
dir: ne,
|
|
74
|
-
...
|
|
74
|
+
...c,
|
|
75
75
|
ref: E,
|
|
76
76
|
style: {
|
|
77
77
|
position: "relative",
|
|
@@ -81,19 +81,19 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
81
81
|
}
|
|
82
82
|
})
|
|
83
83
|
});
|
|
84
|
-
}, "ScrollArea")),
|
|
85
|
-
let { __scopeScrollArea: n, children: r, nonce: i, ...
|
|
86
|
-
return /* @__PURE__ */
|
|
84
|
+
}, "ScrollArea")), pn = "ScrollAreaViewport", mn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
85
|
+
let { __scopeScrollArea: n, children: r, nonce: i, ...o } = e, c = G(pn, n), l = s(t, N.useRef(null), c.onViewportChange);
|
|
86
|
+
return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(hn, { nonce: i }), /* @__PURE__ */ V(a.div, {
|
|
87
87
|
"data-radix-scroll-area-viewport": "",
|
|
88
|
-
...
|
|
89
|
-
ref:
|
|
88
|
+
...o,
|
|
89
|
+
ref: l,
|
|
90
90
|
style: {
|
|
91
|
-
overflowX:
|
|
92
|
-
overflowY:
|
|
91
|
+
overflowX: c.scrollbarXEnabled ? "scroll" : "hidden",
|
|
92
|
+
overflowY: c.scrollbarYEnabled ? "scroll" : "hidden",
|
|
93
93
|
...e.style
|
|
94
94
|
},
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
ref:
|
|
95
|
+
children: /* @__PURE__ */ V("div", {
|
|
96
|
+
ref: c.onContentChange,
|
|
97
97
|
style: {
|
|
98
98
|
minWidth: "100%",
|
|
99
99
|
display: "table"
|
|
@@ -101,60 +101,60 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
101
101
|
children: r
|
|
102
102
|
})
|
|
103
103
|
})] });
|
|
104
|
-
}, "ScrollAreaViewport")),
|
|
105
|
-
return /* @__PURE__ */
|
|
104
|
+
}, "ScrollAreaViewport")), hn = /* @__PURE__ */ N.memo(/* @__PURE__ */ W(function({ nonce: e }) {
|
|
105
|
+
return /* @__PURE__ */ V("style", {
|
|
106
106
|
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}" },
|
|
107
107
|
nonce: e
|
|
108
108
|
});
|
|
109
|
-
}, "ScrollAreaViewportStyle"), (e, t) => e.nonce === t.nonce),
|
|
110
|
-
let { forceMount: n, ...r } = e, i =
|
|
111
|
-
return
|
|
109
|
+
}, "ScrollAreaViewportStyle"), (e, t) => e.nonce === t.nonce), K = "ScrollAreaScrollbar", gn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
110
|
+
let { forceMount: n, ...r } = e, i = G(K, e.__scopeScrollArea), { onScrollbarXEnabledChange: a, onScrollbarYEnabledChange: o } = i, s = e.orientation === "horizontal";
|
|
111
|
+
return N.useEffect(() => (s ? a(!0) : o(!0), () => {
|
|
112
112
|
s ? a(!1) : o(!1);
|
|
113
113
|
}), [
|
|
114
114
|
s,
|
|
115
115
|
a,
|
|
116
116
|
o
|
|
117
|
-
]), i.type === "hover" ? /* @__PURE__ */
|
|
117
|
+
]), i.type === "hover" ? /* @__PURE__ */ V(_n, {
|
|
118
118
|
...r,
|
|
119
119
|
ref: t,
|
|
120
120
|
forceMount: n
|
|
121
|
-
}) : i.type === "scroll" ? /* @__PURE__ */
|
|
121
|
+
}) : i.type === "scroll" ? /* @__PURE__ */ V(vn, {
|
|
122
122
|
...r,
|
|
123
123
|
ref: t,
|
|
124
124
|
forceMount: n
|
|
125
|
-
}) : i.type === "auto" ? /* @__PURE__ */
|
|
125
|
+
}) : i.type === "auto" ? /* @__PURE__ */ V(yn, {
|
|
126
126
|
...r,
|
|
127
127
|
ref: t,
|
|
128
128
|
forceMount: n
|
|
129
|
-
}) : i.type === "always" ? /* @__PURE__ */
|
|
129
|
+
}) : i.type === "always" ? /* @__PURE__ */ V(bn, {
|
|
130
130
|
...r,
|
|
131
131
|
ref: t,
|
|
132
132
|
"data-state": "visible"
|
|
133
133
|
}) : null;
|
|
134
|
-
}, "ScrollAreaScrollbar")),
|
|
135
|
-
let { forceMount: n, ...r } = e,
|
|
136
|
-
return
|
|
137
|
-
let e =
|
|
134
|
+
}, "ScrollAreaScrollbar")), _n = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
135
|
+
let { forceMount: n, ...r } = e, a = G(K, e.__scopeScrollArea), [o, s] = N.useState(!1);
|
|
136
|
+
return N.useEffect(() => {
|
|
137
|
+
let e = a.scrollArea, t = 0;
|
|
138
138
|
if (e) {
|
|
139
|
-
let n = /* @__PURE__ */
|
|
139
|
+
let n = /* @__PURE__ */ W(() => {
|
|
140
140
|
window.clearTimeout(t), s(!0);
|
|
141
|
-
}, "handlePointerEnter"), r = /* @__PURE__ */
|
|
142
|
-
t = window.setTimeout(() => s(!1),
|
|
141
|
+
}, "handlePointerEnter"), r = /* @__PURE__ */ W(() => {
|
|
142
|
+
t = window.setTimeout(() => s(!1), a.scrollHideDelay);
|
|
143
143
|
}, "handlePointerLeave");
|
|
144
144
|
return e.addEventListener("pointerenter", n), e.addEventListener("pointerleave", r), () => {
|
|
145
145
|
window.clearTimeout(t), e.removeEventListener("pointerenter", n), e.removeEventListener("pointerleave", r);
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
}, [
|
|
149
|
-
present: n ||
|
|
150
|
-
children: /* @__PURE__ */
|
|
151
|
-
"data-state":
|
|
148
|
+
}, [a.scrollArea, a.scrollHideDelay]), /* @__PURE__ */ V(i, {
|
|
149
|
+
present: n || o,
|
|
150
|
+
children: /* @__PURE__ */ V(yn, {
|
|
151
|
+
"data-state": o ? "visible" : "hidden",
|
|
152
152
|
...r,
|
|
153
153
|
ref: t
|
|
154
154
|
})
|
|
155
155
|
});
|
|
156
|
-
}, "ScrollAreaScrollbarHover")),
|
|
157
|
-
let { forceMount: n, ...r } = e,
|
|
156
|
+
}, "ScrollAreaScrollbarHover")), vn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
157
|
+
let { forceMount: n, ...r } = e, a = G(K, e.__scopeScrollArea), o = e.orientation === "horizontal", s = Y(() => u("SCROLL_END"), 100), [c, u] = sn("hidden", {
|
|
158
158
|
hidden: { SCROLL: "scrolling" },
|
|
159
159
|
scrolling: {
|
|
160
160
|
SCROLL_END: "idle",
|
|
@@ -170,56 +170,56 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
170
170
|
POINTER_ENTER: "interacting"
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
|
-
return
|
|
173
|
+
return N.useEffect(() => {
|
|
174
174
|
if (c === "idle") {
|
|
175
|
-
let e = window.setTimeout(() =>
|
|
175
|
+
let e = window.setTimeout(() => u("HIDE"), a.scrollHideDelay);
|
|
176
176
|
return () => window.clearTimeout(e);
|
|
177
177
|
}
|
|
178
178
|
}, [
|
|
179
179
|
c,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
]),
|
|
183
|
-
let e =
|
|
180
|
+
a.scrollHideDelay,
|
|
181
|
+
u
|
|
182
|
+
]), N.useEffect(() => {
|
|
183
|
+
let e = a.viewport, t = o ? "scrollLeft" : "scrollTop";
|
|
184
184
|
if (e) {
|
|
185
|
-
let n = e[t], r = /* @__PURE__ */
|
|
185
|
+
let n = e[t], r = /* @__PURE__ */ W(() => {
|
|
186
186
|
let r = e[t];
|
|
187
|
-
n !== r && (
|
|
187
|
+
n !== r && (u("SCROLL"), s()), n = r;
|
|
188
188
|
}, "handleScroll");
|
|
189
189
|
return e.addEventListener("scroll", r), () => e.removeEventListener("scroll", r);
|
|
190
190
|
}
|
|
191
191
|
}, [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
a.viewport,
|
|
193
|
+
o,
|
|
194
|
+
u,
|
|
195
195
|
s
|
|
196
|
-
]), /* @__PURE__ */
|
|
196
|
+
]), /* @__PURE__ */ V(i, {
|
|
197
197
|
present: n || c !== "hidden",
|
|
198
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ V(bn, {
|
|
199
199
|
"data-state": c === "hidden" ? "hidden" : "visible",
|
|
200
200
|
...r,
|
|
201
201
|
ref: t,
|
|
202
|
-
onPointerEnter:
|
|
203
|
-
onPointerLeave:
|
|
202
|
+
onPointerEnter: l(e.onPointerEnter, () => u("POINTER_ENTER")),
|
|
203
|
+
onPointerLeave: l(e.onPointerLeave, () => u("POINTER_LEAVE"))
|
|
204
204
|
})
|
|
205
205
|
});
|
|
206
|
-
}, "ScrollAreaScrollbarScroll")),
|
|
207
|
-
let n =
|
|
206
|
+
}, "ScrollAreaScrollbarScroll")), yn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
207
|
+
let n = G(K, e.__scopeScrollArea), { forceMount: r, ...a } = e, [o, s] = N.useState(!1), c = e.orientation === "horizontal", l = Y(() => {
|
|
208
208
|
if (n.viewport) {
|
|
209
209
|
let e = n.viewport.offsetWidth < n.viewport.scrollWidth, t = n.viewport.offsetHeight < n.viewport.scrollHeight;
|
|
210
210
|
s(c ? e : t);
|
|
211
211
|
}
|
|
212
212
|
}, 10);
|
|
213
|
-
return
|
|
214
|
-
present: r ||
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
-
"data-state":
|
|
217
|
-
...
|
|
213
|
+
return X(n.viewport, l), X(n.content, l), /* @__PURE__ */ V(i, {
|
|
214
|
+
present: r || o,
|
|
215
|
+
children: /* @__PURE__ */ V(bn, {
|
|
216
|
+
"data-state": o ? "visible" : "hidden",
|
|
217
|
+
...a,
|
|
218
218
|
ref: t
|
|
219
219
|
})
|
|
220
220
|
});
|
|
221
|
-
}, "ScrollAreaScrollbarAuto")),
|
|
222
|
-
let { orientation: n = "vertical", ...r } = e, i =
|
|
221
|
+
}, "ScrollAreaScrollbarAuto")), bn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
222
|
+
let { orientation: n = "vertical", ...r } = e, i = G(K, e.__scopeScrollArea), a = N.useRef(null), o = N.useRef(0), [s, c] = N.useState({
|
|
223
223
|
content: 0,
|
|
224
224
|
viewport: 0,
|
|
225
225
|
scrollbar: {
|
|
@@ -227,24 +227,24 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
227
227
|
paddingStart: 0,
|
|
228
228
|
paddingEnd: 0
|
|
229
229
|
}
|
|
230
|
-
}), l =
|
|
230
|
+
}), l = Mn(s.viewport, s.content), u = {
|
|
231
231
|
...r,
|
|
232
232
|
sizes: s,
|
|
233
233
|
onSizesChange: c,
|
|
234
234
|
hasThumb: l > 0 && l < 1,
|
|
235
|
-
onThumbChange: /* @__PURE__ */
|
|
236
|
-
onThumbPointerUp: /* @__PURE__ */
|
|
237
|
-
onThumbPointerDown: /* @__PURE__ */
|
|
235
|
+
onThumbChange: /* @__PURE__ */ W((e) => a.current = e, "onThumbChange"),
|
|
236
|
+
onThumbPointerUp: /* @__PURE__ */ W(() => o.current = 0, "onThumbPointerUp"),
|
|
237
|
+
onThumbPointerDown: /* @__PURE__ */ W((e) => o.current = e, "onThumbPointerDown")
|
|
238
238
|
};
|
|
239
239
|
function d(e, t) {
|
|
240
|
-
return
|
|
240
|
+
return Nn(e, o.current, s, t);
|
|
241
241
|
}
|
|
242
|
-
return
|
|
242
|
+
return W(d, "getScrollPosition"), n === "horizontal" ? /* @__PURE__ */ V(xn, {
|
|
243
243
|
...u,
|
|
244
244
|
ref: t,
|
|
245
245
|
onThumbPositionChange: () => {
|
|
246
246
|
if (i.viewport && a.current) {
|
|
247
|
-
let e = i.viewport.scrollLeft, t =
|
|
247
|
+
let e = i.viewport.scrollLeft, t = Pn(e, s, i.dir);
|
|
248
248
|
a.current.style.transform = `translate3d(${t}px, 0, 0)`;
|
|
249
249
|
}
|
|
250
250
|
},
|
|
@@ -254,12 +254,12 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
254
254
|
onDragScroll: (e) => {
|
|
255
255
|
i.viewport && (i.viewport.scrollLeft = d(e, i.dir));
|
|
256
256
|
}
|
|
257
|
-
}) : n === "vertical" ? /* @__PURE__ */
|
|
257
|
+
}) : n === "vertical" ? /* @__PURE__ */ V(Sn, {
|
|
258
258
|
...u,
|
|
259
259
|
ref: t,
|
|
260
260
|
onThumbPositionChange: () => {
|
|
261
261
|
if (i.viewport && a.current) {
|
|
262
|
-
let e = i.viewport.scrollTop, t =
|
|
262
|
+
let e = i.viewport.scrollTop, t = Pn(e, s);
|
|
263
263
|
a.current.style.transform = `translate3d(0, ${t}px, 0)`;
|
|
264
264
|
}
|
|
265
265
|
},
|
|
@@ -270,11 +270,11 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
270
270
|
i.viewport && (i.viewport.scrollTop = d(e));
|
|
271
271
|
}
|
|
272
272
|
}) : null;
|
|
273
|
-
}, "ScrollAreaScrollbarVisible")),
|
|
274
|
-
let { sizes: n, onSizesChange: r, ...i } = e, a =
|
|
275
|
-
return
|
|
276
|
-
|
|
277
|
-
}, [
|
|
273
|
+
}, "ScrollAreaScrollbarVisible")), xn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
274
|
+
let { sizes: n, onSizesChange: r, ...i } = e, a = G(K, e.__scopeScrollArea), [o, c] = N.useState(), l = N.useRef(null), u = s(t, l, a.onScrollbarXChange);
|
|
275
|
+
return N.useEffect(() => {
|
|
276
|
+
l.current && c(getComputedStyle(l.current));
|
|
277
|
+
}, [l]), /* @__PURE__ */ V(Tn, {
|
|
278
278
|
"data-orientation": "horizontal",
|
|
279
279
|
...i,
|
|
280
280
|
ref: u,
|
|
@@ -283,7 +283,7 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
283
283
|
bottom: 0,
|
|
284
284
|
left: a.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
285
285
|
right: a.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
286
|
-
"--radix-scroll-area-thumb-width":
|
|
286
|
+
"--radix-scroll-area-thumb-width": J(n) + "px",
|
|
287
287
|
...e.style
|
|
288
288
|
},
|
|
289
289
|
onThumbPointerDown: (t) => e.onThumbPointerDown(t.x),
|
|
@@ -291,26 +291,26 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
291
291
|
onWheelScroll: (t, n) => {
|
|
292
292
|
if (a.viewport) {
|
|
293
293
|
let r = a.viewport.scrollLeft + t.deltaX;
|
|
294
|
-
e.onWheelScroll(r),
|
|
294
|
+
e.onWheelScroll(r), In(r, n) && t.preventDefault();
|
|
295
295
|
}
|
|
296
296
|
},
|
|
297
297
|
onResize: () => {
|
|
298
|
-
|
|
298
|
+
l.current && a.viewport && o && r({
|
|
299
299
|
content: a.viewport.scrollWidth,
|
|
300
300
|
viewport: a.viewport.offsetWidth,
|
|
301
301
|
scrollbar: {
|
|
302
|
-
size:
|
|
303
|
-
paddingStart:
|
|
304
|
-
paddingEnd:
|
|
302
|
+
size: l.current.clientWidth,
|
|
303
|
+
paddingStart: q(o.paddingLeft),
|
|
304
|
+
paddingEnd: q(o.paddingRight)
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
|
-
}, "ScrollAreaScrollbarX")),
|
|
310
|
-
let { sizes: n, onSizesChange: r, ...i } = e, a =
|
|
311
|
-
return
|
|
312
|
-
|
|
313
|
-
}, [
|
|
309
|
+
}, "ScrollAreaScrollbarX")), Sn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
310
|
+
let { sizes: n, onSizesChange: r, ...i } = e, a = G(K, e.__scopeScrollArea), [o, c] = N.useState(), l = N.useRef(null), u = s(t, l, a.onScrollbarYChange);
|
|
311
|
+
return N.useEffect(() => {
|
|
312
|
+
l.current && c(getComputedStyle(l.current));
|
|
313
|
+
}, [l]), /* @__PURE__ */ V(Tn, {
|
|
314
314
|
"data-orientation": "vertical",
|
|
315
315
|
...i,
|
|
316
316
|
ref: u,
|
|
@@ -320,7 +320,7 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
320
320
|
right: a.dir === "ltr" ? 0 : void 0,
|
|
321
321
|
left: a.dir === "rtl" ? 0 : void 0,
|
|
322
322
|
bottom: "var(--radix-scroll-area-corner-height)",
|
|
323
|
-
"--radix-scroll-area-thumb-height":
|
|
323
|
+
"--radix-scroll-area-thumb-height": J(n) + "px",
|
|
324
324
|
...e.style
|
|
325
325
|
},
|
|
326
326
|
onThumbPointerDown: (t) => e.onThumbPointerDown(t.y),
|
|
@@ -328,135 +328,135 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
328
328
|
onWheelScroll: (t, n) => {
|
|
329
329
|
if (a.viewport) {
|
|
330
330
|
let r = a.viewport.scrollTop + t.deltaY;
|
|
331
|
-
e.onWheelScroll(r),
|
|
331
|
+
e.onWheelScroll(r), In(r, n) && t.preventDefault();
|
|
332
332
|
}
|
|
333
333
|
},
|
|
334
334
|
onResize: () => {
|
|
335
|
-
|
|
335
|
+
l.current && a.viewport && o && r({
|
|
336
336
|
content: a.viewport.scrollHeight,
|
|
337
337
|
viewport: a.viewport.offsetHeight,
|
|
338
338
|
scrollbar: {
|
|
339
|
-
size:
|
|
340
|
-
paddingStart:
|
|
341
|
-
paddingEnd:
|
|
339
|
+
size: l.current.clientHeight,
|
|
340
|
+
paddingStart: q(o.paddingTop),
|
|
341
|
+
paddingEnd: q(o.paddingBottom)
|
|
342
342
|
}
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
});
|
|
346
|
-
}, "ScrollAreaScrollbarY")), [
|
|
347
|
-
let { __scopeScrollArea: n, sizes: r, hasThumb: i, onThumbChange:
|
|
346
|
+
}, "ScrollAreaScrollbarY")), [Cn, wn] = ln(K), Tn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
347
|
+
let { __scopeScrollArea: n, sizes: r, hasThumb: i, onThumbChange: o, onThumbPointerUp: c, onThumbPointerDown: u, onThumbPositionChange: f, onDragScroll: p, onWheelScroll: m, onResize: h, ...g } = e, _ = G(K, n), [v, y] = N.useState(null), b = s(t, y), x = N.useRef(null), S = N.useRef(""), ee = _.viewport, C = r.content - r.viewport, w = d(m), T = d(f), te = Y(h, 10);
|
|
348
348
|
function E(e) {
|
|
349
349
|
if (x.current) {
|
|
350
350
|
let t = e.clientX - x.current.left, n = e.clientY - x.current.top;
|
|
351
|
-
|
|
351
|
+
p({
|
|
352
352
|
x: t,
|
|
353
353
|
y: n
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
return
|
|
358
|
-
let e = /* @__PURE__ */
|
|
357
|
+
return W(E, "handleDragScroll"), N.useEffect(() => {
|
|
358
|
+
let e = /* @__PURE__ */ W((e) => {
|
|
359
359
|
let t = e.target;
|
|
360
|
-
v?.contains(t) &&
|
|
360
|
+
v?.contains(t) && w(e, C);
|
|
361
361
|
}, "handleWheel");
|
|
362
362
|
return document.addEventListener("wheel", e, { passive: !1 }), () => document.removeEventListener("wheel", e, { passive: !1 });
|
|
363
363
|
}, [
|
|
364
|
-
C,
|
|
365
|
-
v,
|
|
366
364
|
ee,
|
|
367
|
-
|
|
368
|
-
|
|
365
|
+
v,
|
|
366
|
+
C,
|
|
367
|
+
w
|
|
368
|
+
]), N.useEffect(T, [r, T]), X(v, te), X(_.content, te), /* @__PURE__ */ V(Cn, {
|
|
369
369
|
scope: n,
|
|
370
370
|
scrollbar: v,
|
|
371
371
|
hasThumb: i,
|
|
372
|
-
onThumbChange:
|
|
373
|
-
onThumbPointerUp:
|
|
374
|
-
onThumbPositionChange:
|
|
375
|
-
onThumbPointerDown:
|
|
376
|
-
children: /* @__PURE__ */
|
|
372
|
+
onThumbChange: d(o),
|
|
373
|
+
onThumbPointerUp: d(c),
|
|
374
|
+
onThumbPositionChange: T,
|
|
375
|
+
onThumbPointerDown: d(u),
|
|
376
|
+
children: /* @__PURE__ */ V(a.div, {
|
|
377
377
|
...g,
|
|
378
378
|
ref: b,
|
|
379
379
|
style: {
|
|
380
380
|
position: "absolute",
|
|
381
381
|
...g.style
|
|
382
382
|
},
|
|
383
|
-
onPointerDown:
|
|
383
|
+
onPointerDown: l(e.onPointerDown, (e) => {
|
|
384
384
|
e.button === 0 && (e.target.setPointerCapture(e.pointerId), x.current = v.getBoundingClientRect(), S.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", _.viewport && (_.viewport.style.scrollBehavior = "auto"), E(e));
|
|
385
385
|
}),
|
|
386
|
-
onPointerMove:
|
|
387
|
-
onPointerUp:
|
|
386
|
+
onPointerMove: l(e.onPointerMove, E),
|
|
387
|
+
onPointerUp: l(e.onPointerUp, (e) => {
|
|
388
388
|
let t = e.target;
|
|
389
389
|
t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), document.body.style.webkitUserSelect = S.current, _.viewport && (_.viewport.style.scrollBehavior = ""), x.current = null;
|
|
390
390
|
})
|
|
391
391
|
})
|
|
392
392
|
});
|
|
393
|
-
}, "ScrollAreaScrollbarImpl")),
|
|
394
|
-
let { forceMount: n, ...r } = e,
|
|
395
|
-
return /* @__PURE__ */
|
|
396
|
-
present: n ||
|
|
397
|
-
children: /* @__PURE__ */
|
|
393
|
+
}, "ScrollAreaScrollbarImpl")), En = "ScrollAreaThumb", Dn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
394
|
+
let { forceMount: n, ...r } = e, a = wn(En, e.__scopeScrollArea);
|
|
395
|
+
return /* @__PURE__ */ V(i, {
|
|
396
|
+
present: n || a.hasThumb,
|
|
397
|
+
children: /* @__PURE__ */ V(On, {
|
|
398
398
|
ref: t,
|
|
399
399
|
...r
|
|
400
400
|
})
|
|
401
401
|
});
|
|
402
|
-
}, "ScrollAreaThumb")),
|
|
403
|
-
let { __scopeScrollArea: n, style: r, ...i } = e,
|
|
402
|
+
}, "ScrollAreaThumb")), On = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
403
|
+
let { __scopeScrollArea: n, style: r, ...i } = e, o = G(En, n), c = wn(En, n), { onThumbPositionChange: u } = c, d = s(t, c.onThumbChange), f = N.useRef(void 0), p = Y(() => {
|
|
404
404
|
f.current &&= (f.current(), void 0);
|
|
405
405
|
}, 100);
|
|
406
|
-
return
|
|
407
|
-
let e =
|
|
406
|
+
return N.useEffect(() => {
|
|
407
|
+
let e = o.viewport;
|
|
408
408
|
if (e) {
|
|
409
|
-
let t = /* @__PURE__ */
|
|
409
|
+
let t = /* @__PURE__ */ W(() => {
|
|
410
410
|
if (p(), !f.current) {
|
|
411
|
-
let t =
|
|
412
|
-
f.current = t,
|
|
411
|
+
let t = Ln(e, u);
|
|
412
|
+
f.current = t, u();
|
|
413
413
|
}
|
|
414
414
|
}, "handleScroll");
|
|
415
|
-
return
|
|
415
|
+
return u(), e.addEventListener("scroll", t), () => e.removeEventListener("scroll", t);
|
|
416
416
|
}
|
|
417
417
|
}, [
|
|
418
|
-
|
|
418
|
+
o.viewport,
|
|
419
419
|
p,
|
|
420
|
-
|
|
421
|
-
]), /* @__PURE__ */
|
|
422
|
-
"data-state":
|
|
420
|
+
u
|
|
421
|
+
]), /* @__PURE__ */ V(a.div, {
|
|
422
|
+
"data-state": c.hasThumb ? "visible" : "hidden",
|
|
423
423
|
...i,
|
|
424
|
-
ref:
|
|
424
|
+
ref: d,
|
|
425
425
|
style: {
|
|
426
426
|
width: "var(--radix-scroll-area-thumb-width)",
|
|
427
427
|
height: "var(--radix-scroll-area-thumb-height)",
|
|
428
428
|
...r
|
|
429
429
|
},
|
|
430
|
-
onPointerDownCapture:
|
|
430
|
+
onPointerDownCapture: l(e.onPointerDownCapture, (e) => {
|
|
431
431
|
let t = e.target.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top;
|
|
432
|
-
|
|
432
|
+
c.onThumbPointerDown({
|
|
433
433
|
x: n,
|
|
434
434
|
y: r
|
|
435
435
|
});
|
|
436
436
|
}),
|
|
437
|
-
onPointerUp:
|
|
437
|
+
onPointerUp: l(e.onPointerUp, c.onThumbPointerUp)
|
|
438
438
|
});
|
|
439
|
-
}, "ScrollAreaThumbImpl")),
|
|
440
|
-
let n =
|
|
441
|
-
return n.type !== "scroll" && r ? /* @__PURE__ */
|
|
439
|
+
}, "ScrollAreaThumbImpl")), kn = "ScrollAreaCorner", An = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
440
|
+
let n = G(kn, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
441
|
+
return n.type !== "scroll" && r ? /* @__PURE__ */ V(jn, {
|
|
442
442
|
...e,
|
|
443
443
|
ref: t
|
|
444
444
|
}) : null;
|
|
445
|
-
}, "ScrollAreaCorner")),
|
|
446
|
-
let { __scopeScrollArea: n, ...r } = e, i =
|
|
447
|
-
return
|
|
445
|
+
}, "ScrollAreaCorner")), jn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ W(function(e, t) {
|
|
446
|
+
let { __scopeScrollArea: n, ...r } = e, i = G(kn, n), [o, s] = N.useState(0), [c, l] = N.useState(0), u = !!(o && c), { onCornerWidthChange: d, onCornerHeightChange: f } = i;
|
|
447
|
+
return X(i.scrollbarX, () => {
|
|
448
448
|
let e = i.scrollbarX?.offsetHeight || 0;
|
|
449
449
|
i.onCornerHeightChange(e), l(e);
|
|
450
|
-
}),
|
|
450
|
+
}), X(i.scrollbarY, () => {
|
|
451
451
|
let e = i.scrollbarY?.offsetWidth || 0;
|
|
452
|
-
i.onCornerWidthChange(e),
|
|
453
|
-
}),
|
|
452
|
+
i.onCornerWidthChange(e), s(e);
|
|
453
|
+
}), N.useEffect(() => () => {
|
|
454
454
|
d(0), f(0);
|
|
455
|
-
}, [d, f]), u ? /* @__PURE__ */
|
|
455
|
+
}, [d, f]), u ? /* @__PURE__ */ V(a.div, {
|
|
456
456
|
...r,
|
|
457
457
|
ref: t,
|
|
458
458
|
style: {
|
|
459
|
-
width:
|
|
459
|
+
width: o,
|
|
460
460
|
height: c,
|
|
461
461
|
position: "absolute",
|
|
462
462
|
right: i.dir === "ltr" ? 0 : void 0,
|
|
@@ -466,48 +466,48 @@ var ln = "ScrollArea", [un, dn] = a(ln), [fn, W] = un(ln), pn = /* @__PURE__ */
|
|
|
466
466
|
}
|
|
467
467
|
}) : null;
|
|
468
468
|
}, "ScrollAreaCornerImpl"));
|
|
469
|
-
function
|
|
469
|
+
function q(e) {
|
|
470
470
|
return e ? parseInt(e, 10) : 0;
|
|
471
471
|
}
|
|
472
|
-
|
|
473
|
-
function
|
|
472
|
+
W(q, "toInt");
|
|
473
|
+
function Mn(e, t) {
|
|
474
474
|
let n = e / t;
|
|
475
475
|
return isNaN(n) ? 0 : n;
|
|
476
476
|
}
|
|
477
|
-
|
|
478
|
-
function
|
|
479
|
-
let t =
|
|
477
|
+
W(Mn, "getThumbRatio");
|
|
478
|
+
function J(e) {
|
|
479
|
+
let t = Mn(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
|
|
480
480
|
return Math.max(r, 18);
|
|
481
481
|
}
|
|
482
|
-
|
|
483
|
-
function
|
|
484
|
-
let i =
|
|
485
|
-
return
|
|
482
|
+
W(J, "getThumbSize");
|
|
483
|
+
function Nn(e, t, n, r = "ltr") {
|
|
484
|
+
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];
|
|
485
|
+
return Fn([c, l], d)(e);
|
|
486
486
|
}
|
|
487
|
-
|
|
488
|
-
function
|
|
489
|
-
let r =
|
|
490
|
-
return
|
|
487
|
+
W(Nn, "getScrollPositionFromPointer");
|
|
488
|
+
function Pn(e, t, n = "ltr") {
|
|
489
|
+
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 = an(e, n === "ltr" ? [0, o] : [o * -1, 0]);
|
|
490
|
+
return Fn([0, o], [0, s])(c);
|
|
491
491
|
}
|
|
492
|
-
|
|
493
|
-
function
|
|
492
|
+
W(Pn, "getThumbOffsetFromScroll");
|
|
493
|
+
function Fn(e, t) {
|
|
494
494
|
return (n) => {
|
|
495
495
|
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
496
496
|
let r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
497
497
|
return t[0] + r * (n - e[0]);
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
|
-
|
|
501
|
-
function
|
|
500
|
+
W(Fn, "linearScale");
|
|
501
|
+
function In(e, t) {
|
|
502
502
|
return e > 0 && e < t;
|
|
503
503
|
}
|
|
504
|
-
|
|
505
|
-
var
|
|
504
|
+
W(In, "isScrollingWithinScrollbarBounds");
|
|
505
|
+
var Ln = /* @__PURE__ */ W((e, t = () => {}) => {
|
|
506
506
|
let n = {
|
|
507
507
|
left: e.scrollLeft,
|
|
508
508
|
top: e.scrollTop
|
|
509
509
|
}, r = 0;
|
|
510
|
-
return (/* @__PURE__ */
|
|
510
|
+
return (/* @__PURE__ */ W((function i() {
|
|
511
511
|
let a = {
|
|
512
512
|
left: e.scrollLeft,
|
|
513
513
|
top: e.scrollTop
|
|
@@ -515,16 +515,16 @@ var Rn = /* @__PURE__ */ U((e, t = () => {}) => {
|
|
|
515
515
|
(o || s) && t(), n = a, r = window.requestAnimationFrame(i);
|
|
516
516
|
}), "loop"))(), () => window.cancelAnimationFrame(r);
|
|
517
517
|
}, "addUnlinkedScrollListener");
|
|
518
|
-
function
|
|
519
|
-
let n =
|
|
520
|
-
return
|
|
518
|
+
function Y(e, t) {
|
|
519
|
+
let n = d(e), r = N.useRef(0);
|
|
520
|
+
return N.useEffect(() => () => window.clearTimeout(r.current), []), N.useCallback(() => {
|
|
521
521
|
window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
|
|
522
522
|
}, [n, t]);
|
|
523
523
|
}
|
|
524
|
-
|
|
525
|
-
function
|
|
526
|
-
let n =
|
|
527
|
-
|
|
524
|
+
W(Y, "useDebounceCallback");
|
|
525
|
+
function X(e, t) {
|
|
526
|
+
let n = d(t);
|
|
527
|
+
o(() => {
|
|
528
528
|
let t = 0;
|
|
529
529
|
if (e) {
|
|
530
530
|
let r = new ResizeObserver(() => {
|
|
@@ -536,12 +536,12 @@ function Y(e, t) {
|
|
|
536
536
|
}
|
|
537
537
|
}, [e, n]);
|
|
538
538
|
}
|
|
539
|
-
|
|
540
|
-
var
|
|
539
|
+
W(X, "useResizeObserver");
|
|
540
|
+
var Rn = fn, zn = mn, Bn = An;
|
|
541
541
|
//#endregion
|
|
542
542
|
//#region lib/components/ui/actions/toolbar/toolbar-toggle-group.tsx
|
|
543
|
-
function
|
|
544
|
-
let [r, i] =
|
|
543
|
+
function Vn(e, t, n) {
|
|
544
|
+
let [r, i] = z(t ?? "");
|
|
545
545
|
return {
|
|
546
546
|
value: e ?? r,
|
|
547
547
|
onValueChange: (e) => {
|
|
@@ -549,28 +549,28 @@ function Hn(e, t, n) {
|
|
|
549
549
|
}
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
-
function
|
|
553
|
-
let { label: t, children: r, priority: i, moreAs: a, disabled: o, className: s } = e, { spilled: c, inside: l, props: u } =
|
|
552
|
+
function Hn(e) {
|
|
553
|
+
let { label: t, children: r, priority: i, moreAs: a, disabled: o, className: s } = e, { spilled: c, inside: l, props: u } = fe({
|
|
554
554
|
label: t,
|
|
555
555
|
group: !0,
|
|
556
556
|
choice: e.type,
|
|
557
557
|
moreAs: a
|
|
558
|
-
}, i), d =
|
|
558
|
+
}, i), d = L(() => ({ spilled: c }), [c]), f = Vn(e.type === "single" ? e.value : void 0, e.type === "single" ? e.defaultValue : void 0, e.type === "single" ? e.onValueChange : void 0), p = {
|
|
559
559
|
...u,
|
|
560
560
|
"aria-label": t,
|
|
561
561
|
disabled: o,
|
|
562
562
|
"data-slot": "toolbar-toggle-group",
|
|
563
563
|
className: n(l && "nxgt-toolbar-group", s),
|
|
564
|
-
children: /* @__PURE__ */
|
|
564
|
+
children: /* @__PURE__ */ V(he, {
|
|
565
565
|
value: d,
|
|
566
566
|
children: r
|
|
567
567
|
})
|
|
568
568
|
};
|
|
569
|
-
return e.type === "single" ? /* @__PURE__ */
|
|
569
|
+
return e.type === "single" ? /* @__PURE__ */ V(ve, {
|
|
570
570
|
...p,
|
|
571
571
|
type: "single",
|
|
572
572
|
...f
|
|
573
|
-
}) : /* @__PURE__ */
|
|
573
|
+
}) : /* @__PURE__ */ V(ve, {
|
|
574
574
|
...p,
|
|
575
575
|
type: "multiple",
|
|
576
576
|
role: "group",
|
|
@@ -579,8 +579,8 @@ function Un(e) {
|
|
|
579
579
|
onValueChange: e.onValueChange
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
return /* @__PURE__ */
|
|
582
|
+
function Un({ value: e, ...t }) {
|
|
583
|
+
return /* @__PURE__ */ V(me, {
|
|
584
584
|
...t,
|
|
585
585
|
toggle: !0,
|
|
586
586
|
toggleValue: e
|
|
@@ -588,7 +588,7 @@ function Wn({ value: e, ...t }) {
|
|
|
588
588
|
}
|
|
589
589
|
//#endregion
|
|
590
590
|
//#region lib/components/touch-box.ts
|
|
591
|
-
var
|
|
591
|
+
var Wn = "pointer-coarse:size-11 pointer-coarse:p-1.5 pointer-coarse:bg-clip-content", Gn = `${Wn} pointer-coarse:-m-1.5`, Kn = "pointer-coarse:size-11 pointer-coarse:p-1 pointer-coarse:-m-1 pointer-coarse:bg-clip-content", qn = u("nxgt-sheet fixed z-50 flex flex-col gap-4 overflow-y-auto overscroll-contain", {
|
|
592
592
|
variants: {
|
|
593
593
|
side: {
|
|
594
594
|
right: "inset-y-0 right-0 h-full w-[calc(100%-3.5rem)] sm:max-w-sm",
|
|
@@ -630,29 +630,29 @@ var Gn = "pointer-coarse:size-11 pointer-coarse:p-1.5 pointer-coarse:bg-clip-con
|
|
|
630
630
|
});
|
|
631
631
|
//#endregion
|
|
632
632
|
//#region lib/components/ui/overlays/sheet/sheet-parts.tsx
|
|
633
|
-
function
|
|
634
|
-
return /* @__PURE__ */
|
|
633
|
+
function Jn({ className: e, ...t }) {
|
|
634
|
+
return /* @__PURE__ */ V("div", {
|
|
635
635
|
"data-slot": "sheet-header",
|
|
636
636
|
className: n("flex flex-col gap-1.5 p-4", e),
|
|
637
637
|
...t
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
return /* @__PURE__ */
|
|
640
|
+
function Yn({ className: e, ...t }) {
|
|
641
|
+
return /* @__PURE__ */ V("div", {
|
|
642
642
|
"data-slot": "sheet-footer",
|
|
643
643
|
className: n("mt-auto flex flex-col gap-2 p-4 *:w-full", e),
|
|
644
644
|
...t
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
|
-
function
|
|
648
|
-
return /* @__PURE__ */
|
|
647
|
+
function Xn({ className: e, ...t }) {
|
|
648
|
+
return /* @__PURE__ */ V(te, {
|
|
649
649
|
"data-slot": "sheet-title",
|
|
650
650
|
className: n("text-foreground text-xl/7 font-medium tracking-tight", e),
|
|
651
651
|
...t
|
|
652
652
|
});
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
return /* @__PURE__ */
|
|
654
|
+
function Zn({ className: e, ...t }) {
|
|
655
|
+
return /* @__PURE__ */ V(ne, {
|
|
656
656
|
"data-slot": "sheet-description",
|
|
657
657
|
className: n("text-muted-foreground text-sm/5", e),
|
|
658
658
|
...t
|
|
@@ -660,118 +660,118 @@ function Qn({ className: e, ...t }) {
|
|
|
660
660
|
}
|
|
661
661
|
//#endregion
|
|
662
662
|
//#region lib/components/ui/overlays/sheet/sheet.tsx
|
|
663
|
-
function
|
|
664
|
-
return /* @__PURE__ */
|
|
663
|
+
function Qn({ ...e }) {
|
|
664
|
+
return /* @__PURE__ */ V(S, {
|
|
665
665
|
value: e.modal ?? !0,
|
|
666
|
-
children: /* @__PURE__ */
|
|
666
|
+
children: /* @__PURE__ */ V(E, {
|
|
667
667
|
"data-slot": "sheet",
|
|
668
668
|
...e
|
|
669
669
|
})
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
|
-
function
|
|
673
|
-
return /* @__PURE__ */
|
|
672
|
+
function $n({ ...e }) {
|
|
673
|
+
return /* @__PURE__ */ V(oe, {
|
|
674
674
|
"data-slot": "sheet-trigger",
|
|
675
675
|
...e
|
|
676
676
|
});
|
|
677
677
|
}
|
|
678
|
-
function
|
|
679
|
-
let { t:
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
"aria-label":
|
|
682
|
-
...
|
|
683
|
-
type:
|
|
684
|
-
className: n("absolute top-2 right-2",
|
|
685
|
-
variant:
|
|
678
|
+
function er({ className: e, color: t, children: r, type: i = "button", variant: a = "ghost", ...o }) {
|
|
679
|
+
let { t: s } = j();
|
|
680
|
+
return /* @__PURE__ */ V(C, {
|
|
681
|
+
"aria-label": r ? void 0 : s("material.buttons.close", "Close"),
|
|
682
|
+
...o,
|
|
683
|
+
type: i,
|
|
684
|
+
className: n("absolute top-2 right-2", ye({
|
|
685
|
+
variant: a,
|
|
686
686
|
color: t,
|
|
687
|
-
className: n(
|
|
687
|
+
className: n(Kn, e)
|
|
688
688
|
})),
|
|
689
689
|
"data-slot": "sheet-close",
|
|
690
|
-
children:
|
|
690
|
+
children: r || /* @__PURE__ */ V(lt, { className: "size-4" })
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
|
-
function
|
|
694
|
-
return /* @__PURE__ */
|
|
693
|
+
function tr({ ...e }) {
|
|
694
|
+
return /* @__PURE__ */ V(w, {
|
|
695
695
|
"data-slot": "sheet-portal",
|
|
696
696
|
...e
|
|
697
697
|
});
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
return /* @__PURE__ */
|
|
699
|
+
function nr({ className: e, scrim: t = "dim", ...r }) {
|
|
700
|
+
return /* @__PURE__ */ V(T, {
|
|
701
701
|
"data-slot": "sheet-overlay",
|
|
702
702
|
"data-scrim": t,
|
|
703
703
|
className: n("nxgt-scrim fixed inset-0 z-50", e),
|
|
704
704
|
...r
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
let { t:
|
|
709
|
-
onOpenAutoFocus:
|
|
710
|
-
onCloseAutoFocus:
|
|
711
|
-
}),
|
|
712
|
-
ref:
|
|
713
|
-
onEscapeKeyDown:
|
|
714
|
-
...
|
|
707
|
+
function rr({ className: e, children: t, side: r = "right", withCloseButton: i, inset: a = !1, scrim: o, onOpenAutoFocus: s, onCloseAutoFocus: c, onEscapeKeyDown: l, ref: u, ...d }) {
|
|
708
|
+
let { t: f } = j(), p = ae({
|
|
709
|
+
onOpenAutoFocus: s,
|
|
710
|
+
onCloseAutoFocus: c
|
|
711
|
+
}), m = re({
|
|
712
|
+
ref: u,
|
|
713
|
+
onEscapeKeyDown: l,
|
|
714
|
+
...d
|
|
715
715
|
});
|
|
716
|
-
return /* @__PURE__ */
|
|
716
|
+
return /* @__PURE__ */ V(ee, {
|
|
717
717
|
value: !0,
|
|
718
|
-
children: /* @__PURE__ */
|
|
719
|
-
ref:
|
|
720
|
-
scrim:
|
|
721
|
-
}), /* @__PURE__ */
|
|
722
|
-
ref:
|
|
718
|
+
children: /* @__PURE__ */ H(tr, { children: [/* @__PURE__ */ V(nr, {
|
|
719
|
+
ref: m.overlayRef,
|
|
720
|
+
scrim: o
|
|
721
|
+
}), /* @__PURE__ */ H(ue, {
|
|
722
|
+
ref: m.ref,
|
|
723
723
|
"data-slot": "sheet-content",
|
|
724
|
-
"data-side":
|
|
725
|
-
"data-inset":
|
|
726
|
-
className: n(
|
|
727
|
-
side:
|
|
728
|
-
inset:
|
|
729
|
-
}),
|
|
730
|
-
onOpenAutoFocus:
|
|
731
|
-
onCloseAutoFocus:
|
|
732
|
-
onEscapeKeyDown:
|
|
733
|
-
...
|
|
734
|
-
...
|
|
735
|
-
children: [t,
|
|
736
|
-
"aria-label":
|
|
737
|
-
className:
|
|
724
|
+
"data-side": r,
|
|
725
|
+
"data-inset": a || void 0,
|
|
726
|
+
className: n(qn({
|
|
727
|
+
side: r,
|
|
728
|
+
inset: a
|
|
729
|
+
}), i && (r === "bottom" || a ? "pt-8" : "pt-[calc(2rem+env(safe-area-inset-top))]"), e),
|
|
730
|
+
onOpenAutoFocus: p.onOpenAutoFocus,
|
|
731
|
+
onCloseAutoFocus: p.onCloseAutoFocus,
|
|
732
|
+
onEscapeKeyDown: m.onEscapeKeyDown,
|
|
733
|
+
...d,
|
|
734
|
+
...m.outside,
|
|
735
|
+
children: [t, i && /* @__PURE__ */ V(C, {
|
|
736
|
+
"aria-label": f("material.buttons.close", "Close"),
|
|
737
|
+
className: ye({
|
|
738
738
|
variant: "tonal",
|
|
739
739
|
color: "default",
|
|
740
|
-
className: n("absolute right-3 top-3", "pointer-coarse:size-11 pointer-coarse:p-1 pointer-coarse:-m-1 pointer-coarse:bg-clip-content", !
|
|
740
|
+
className: n("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))]")
|
|
741
741
|
}),
|
|
742
|
-
children: /* @__PURE__ */
|
|
742
|
+
children: /* @__PURE__ */ V(ut, { className: "size-4" })
|
|
743
743
|
})]
|
|
744
744
|
})] })
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
747
|
//#endregion
|
|
748
748
|
//#region lib/components/ui/primitives/scroll-area/scroll-area.tsx
|
|
749
|
-
function
|
|
750
|
-
let a =
|
|
751
|
-
return /* @__PURE__ */
|
|
749
|
+
function ir({ className: e, children: t, viewportProps: r, ...i }) {
|
|
750
|
+
let a = De();
|
|
751
|
+
return /* @__PURE__ */ H(Rn, {
|
|
752
752
|
"data-slot": "scroll-area",
|
|
753
753
|
className: n("relative", e),
|
|
754
754
|
...i,
|
|
755
755
|
children: [
|
|
756
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ V(zn, {
|
|
757
757
|
...r,
|
|
758
758
|
"data-slot": "scroll-area-viewport",
|
|
759
759
|
nonce: a,
|
|
760
760
|
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),
|
|
761
761
|
children: t
|
|
762
762
|
}),
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ V(ar, {}),
|
|
764
|
+
/* @__PURE__ */ V(Bn, {})
|
|
765
765
|
]
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
return /* @__PURE__ */
|
|
768
|
+
function ar({ className: e, orientation: t = "vertical", ...r }) {
|
|
769
|
+
return /* @__PURE__ */ V(gn, {
|
|
770
770
|
"data-slot": "scroll-area-scrollbar",
|
|
771
771
|
orientation: t,
|
|
772
772
|
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),
|
|
773
773
|
...r,
|
|
774
|
-
children: /* @__PURE__ */
|
|
774
|
+
children: /* @__PURE__ */ V(Dn, {
|
|
775
775
|
"data-slot": "scroll-area-thumb",
|
|
776
776
|
className: "bg-border relative flex-1 rounded-full"
|
|
777
777
|
})
|
|
@@ -779,9 +779,9 @@ function or({ className: e, orientation: t = "vertical", ...r }) {
|
|
|
779
779
|
}
|
|
780
780
|
//#endregion
|
|
781
781
|
//#region lib/components/ui/feedback/error-state/partials/error-state-actions.tsx
|
|
782
|
-
function
|
|
783
|
-
let { t: i } = j(), [a, o] =
|
|
784
|
-
return /* @__PURE__ */
|
|
782
|
+
function or({ onRetry: e, retrying: t, retryLabel: n, action: r }) {
|
|
783
|
+
let { t: i } = j(), [a, o] = z(!1);
|
|
784
|
+
return /* @__PURE__ */ H(B, { children: [e && /* @__PURE__ */ V(M, {
|
|
785
785
|
variant: "outlined",
|
|
786
786
|
className: "text-foreground",
|
|
787
787
|
"data-slot": "error-state-retry",
|
|
@@ -794,29 +794,29 @@ function sr({ onRetry: e, retrying: t, retryLabel: n, action: r }) {
|
|
|
794
794
|
t.then(e, e);
|
|
795
795
|
}
|
|
796
796
|
},
|
|
797
|
-
children: n ?? i(
|
|
797
|
+
children: n ?? i(U.retry.key, U.retry.fallback)
|
|
798
798
|
}), r] });
|
|
799
799
|
}
|
|
800
800
|
//#endregion
|
|
801
801
|
//#region lib/components/ui/feedback/error-state/partials/error-state-details.tsx
|
|
802
|
-
function
|
|
803
|
-
let { t } = j(), n = (e) => t(
|
|
804
|
-
return /* @__PURE__ */
|
|
802
|
+
function sr({ details: e }) {
|
|
803
|
+
let { t } = j(), n = (e) => t(U[e].key, U[e].fallback);
|
|
804
|
+
return /* @__PURE__ */ H("details", {
|
|
805
805
|
"data-slot": "error-state-details",
|
|
806
806
|
className: "w-full max-w-sm rounded border border-border px-3 py-2 text-left text-sm text-foreground",
|
|
807
|
-
children: [/* @__PURE__ */
|
|
807
|
+
children: [/* @__PURE__ */ V("summary", {
|
|
808
808
|
className: "cursor-pointer font-medium",
|
|
809
809
|
children: n("details")
|
|
810
|
-
}), /* @__PURE__ */
|
|
810
|
+
}), /* @__PURE__ */ V("dl", {
|
|
811
811
|
className: "mt-2 flex flex-col gap-2",
|
|
812
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
812
|
+
children: e.map((e, t) => /* @__PURE__ */ H("div", {
|
|
813
813
|
className: "flex flex-col gap-0.5",
|
|
814
|
-
children: [/* @__PURE__ */
|
|
814
|
+
children: [/* @__PURE__ */ H("dt", {
|
|
815
815
|
className: "font-medium",
|
|
816
816
|
children: [n(t === 0 ? "detailsName" : "detailsCause"), `: ${e.name}`]
|
|
817
|
-
}), /* @__PURE__ */
|
|
817
|
+
}), /* @__PURE__ */ H("dd", {
|
|
818
818
|
className: "break-words",
|
|
819
|
-
children: [/* @__PURE__ */
|
|
819
|
+
children: [/* @__PURE__ */ H("span", {
|
|
820
820
|
className: "font-medium",
|
|
821
821
|
children: [n("detailsMessage"), ": "]
|
|
822
822
|
}), e.message]
|
|
@@ -827,17 +827,17 @@ function cr({ details: e }) {
|
|
|
827
827
|
}
|
|
828
828
|
//#endregion
|
|
829
829
|
//#region lib/components/ui/feedback/error-state/error-state.tsx
|
|
830
|
-
function
|
|
831
|
-
return e === void 0 ? n.length > 0 && /* @__PURE__ */
|
|
830
|
+
function cr(e, n) {
|
|
831
|
+
return e === void 0 ? n.length > 0 && /* @__PURE__ */ V(sr, { details: n }) : t(e, n);
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
let { t: h } = j(), g =
|
|
833
|
+
function lr({ 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 }) {
|
|
834
|
+
let { t: h } = j(), g = St(e, "error-state"), _ = s === !1 ? [] : xt(o), v = (l || f) && /* @__PURE__ */ V(or, {
|
|
835
835
|
onRetry: l,
|
|
836
836
|
retrying: u,
|
|
837
837
|
retryLabel: d,
|
|
838
838
|
action: f
|
|
839
839
|
});
|
|
840
|
-
return /* @__PURE__ */
|
|
840
|
+
return /* @__PURE__ */ H(Ce, {
|
|
841
841
|
role: "alert",
|
|
842
842
|
"data-slot": "error-state",
|
|
843
843
|
kind: e,
|
|
@@ -848,35 +848,35 @@ function ur({ kind: e = "generic", size: t, title: n, description: r, illustrati
|
|
|
848
848
|
description: r ?? (n == null ? h(g.descriptionKey, g.description) : void 0),
|
|
849
849
|
actions: v || void 0,
|
|
850
850
|
...m,
|
|
851
|
-
children: [p,
|
|
851
|
+
children: [p, cr(c, _)]
|
|
852
852
|
});
|
|
853
853
|
}
|
|
854
854
|
//#endregion
|
|
855
855
|
//#region lib/components/ui/media/pdf-viewer/pdf-reader-states.tsx
|
|
856
|
-
function
|
|
856
|
+
function ur({ className: e }) {
|
|
857
857
|
let { t } = j();
|
|
858
|
-
return /* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ V(Te, {
|
|
859
859
|
size: "compact",
|
|
860
860
|
kind: "empty",
|
|
861
861
|
className: n("min-h-64 h-full", e),
|
|
862
|
-
icon: /* @__PURE__ */
|
|
862
|
+
icon: /* @__PURE__ */ V(Be, { "aria-hidden": !0 }),
|
|
863
863
|
title: t("material.pdf-reader.empty", "No document selected")
|
|
864
864
|
});
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function dr() {
|
|
867
867
|
let { t: e } = j();
|
|
868
|
-
return /* @__PURE__ */
|
|
868
|
+
return /* @__PURE__ */ H("div", {
|
|
869
869
|
role: "status",
|
|
870
870
|
className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-background/80 backdrop-blur-sm",
|
|
871
|
-
children: [/* @__PURE__ */
|
|
871
|
+
children: [/* @__PURE__ */ V(Ge, { className: "size-8 animate-spin text-primary-text" }), /* @__PURE__ */ V("p", {
|
|
872
872
|
className: "text-sm text-muted-foreground",
|
|
873
873
|
children: e("material.pdf-reader.loading", "Loading document…")
|
|
874
874
|
})]
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function fr({ error: e, onRetry: t, title: n }) {
|
|
878
878
|
let { t: r } = j();
|
|
879
|
-
return /* @__PURE__ */
|
|
879
|
+
return /* @__PURE__ */ V(lr, {
|
|
880
880
|
size: "compact",
|
|
881
881
|
className: "absolute inset-0",
|
|
882
882
|
title: n ?? r("material.pdf-reader.error", "Failed to load document"),
|
|
@@ -885,21 +885,21 @@ function pr({ error: e, onRetry: t, title: n }) {
|
|
|
885
885
|
retryLabel: r("material.pdf-reader.retry", "Retry")
|
|
886
886
|
});
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
let { t: i } = j(), a =
|
|
890
|
-
return
|
|
888
|
+
function pr({ value: e, incorrect: t = !1, onChange: n, onSubmit: r }) {
|
|
889
|
+
let { t: i } = j(), a = gt(), o = R(null);
|
|
890
|
+
return F(() => {
|
|
891
891
|
t && o.current?.focus();
|
|
892
|
-
}, [t]), /* @__PURE__ */
|
|
892
|
+
}, [t]), /* @__PURE__ */ H("div", {
|
|
893
893
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-4",
|
|
894
894
|
children: [
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ V(He, { className: "size-10 text-primary-text opacity-70" }),
|
|
896
|
+
/* @__PURE__ */ V("p", {
|
|
897
897
|
className: "text-sm font-semibold",
|
|
898
898
|
children: i("material.pdf-reader.password", "Password protected")
|
|
899
899
|
}),
|
|
900
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ H("div", {
|
|
901
901
|
className: "flex gap-2",
|
|
902
|
-
children: [/* @__PURE__ */
|
|
902
|
+
children: [/* @__PURE__ */ V(ie, {
|
|
903
903
|
type: "password",
|
|
904
904
|
placeholder: i("material.pdf-reader.password-placeholder", "Enter password"),
|
|
905
905
|
ref: o,
|
|
@@ -913,14 +913,14 @@ function mr({ value: e, incorrect: t = !1, onChange: n, onSubmit: r }) {
|
|
|
913
913
|
e.key === "Enter" && r();
|
|
914
914
|
},
|
|
915
915
|
autoFocus: !0
|
|
916
|
-
}), /* @__PURE__ */
|
|
916
|
+
}), /* @__PURE__ */ V(M, {
|
|
917
917
|
variant: "filled",
|
|
918
918
|
color: "primary",
|
|
919
919
|
onClick: r,
|
|
920
920
|
children: i("material.pdf-reader.unlock", "Unlock")
|
|
921
921
|
})]
|
|
922
922
|
}),
|
|
923
|
-
t && /* @__PURE__ */
|
|
923
|
+
t && /* @__PURE__ */ V("p", {
|
|
924
924
|
id: a,
|
|
925
925
|
role: "alert",
|
|
926
926
|
className: "text-sm text-error-text",
|
|
@@ -931,26 +931,26 @@ function mr({ value: e, incorrect: t = !1, onChange: n, onSubmit: r }) {
|
|
|
931
931
|
}
|
|
932
932
|
//#endregion
|
|
933
933
|
//#region lib/components/ui/media/pdf-reader/use-open-focus-gate.ts
|
|
934
|
-
function
|
|
935
|
-
let e =
|
|
934
|
+
function mr() {
|
|
935
|
+
let e = R(!1);
|
|
936
936
|
return {
|
|
937
937
|
gate: e,
|
|
938
938
|
onOpenAutoFocus: () => {
|
|
939
939
|
e.current = !0;
|
|
940
940
|
},
|
|
941
|
-
clear:
|
|
941
|
+
clear: P(() => {
|
|
942
942
|
e.current = !1;
|
|
943
943
|
}, [])
|
|
944
944
|
};
|
|
945
945
|
}
|
|
946
946
|
//#endregion
|
|
947
947
|
//#region lib/components/ui/media/pdf-reader/modes/dialog-mode.tsx
|
|
948
|
-
function
|
|
949
|
-
let { t: i } = j(), a =
|
|
950
|
-
return /* @__PURE__ */
|
|
948
|
+
function hr({ open: e, onOpenChange: t, title: n, children: r }) {
|
|
949
|
+
let { t: i } = j(), a = mr();
|
|
950
|
+
return /* @__PURE__ */ V(ce, {
|
|
951
951
|
open: e,
|
|
952
952
|
onOpenChange: t,
|
|
953
|
-
children: /* @__PURE__ */
|
|
953
|
+
children: /* @__PURE__ */ H(se, {
|
|
954
954
|
size: "full",
|
|
955
955
|
mobilePresentation: "fullscreen",
|
|
956
956
|
"aria-describedby": void 0,
|
|
@@ -959,17 +959,17 @@ function gr({ open: e, onOpenChange: t, title: n, children: r }) {
|
|
|
959
959
|
onPointerMoveCapture: a.clear,
|
|
960
960
|
onKeyDownCapture: a.clear,
|
|
961
961
|
className: "h-[min(56rem,calc(100dvh-4rem))] gap-0 overflow-hidden p-0 max-sm:h-dvh max-sm:p-0",
|
|
962
|
-
children: [/* @__PURE__ */
|
|
962
|
+
children: [/* @__PURE__ */ V(le, {
|
|
963
963
|
className: "sr-only",
|
|
964
964
|
children: n || i("material.pdf-reader.label", "PDF reader")
|
|
965
|
-
}), /* @__PURE__ */
|
|
965
|
+
}), /* @__PURE__ */ V(pe, {
|
|
966
966
|
value: a.gate,
|
|
967
967
|
children: r
|
|
968
968
|
})]
|
|
969
969
|
})
|
|
970
970
|
});
|
|
971
971
|
}
|
|
972
|
-
var
|
|
972
|
+
var gr = bt({
|
|
973
973
|
name: "pdf-reader",
|
|
974
974
|
initialState: ((e) => ({
|
|
975
975
|
size: "expanded",
|
|
@@ -1029,24 +1029,24 @@ var _r = xt({
|
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
1031
|
});
|
|
1032
|
-
|
|
1033
|
-
var
|
|
1032
|
+
gr.actions;
|
|
1033
|
+
var _r = {
|
|
1034
1034
|
selectEscapeTarget: (e) => e.annotating ? "annotate" : e.searchOpen ? "search" : null,
|
|
1035
1035
|
selectHeaderKind: (e) => e.annotating ? "annotate" : e.searchOpen ? "search" : "default",
|
|
1036
1036
|
selectRailValue: (e) => e.panelOpen ? e.panelTab : ""
|
|
1037
|
-
}, vr =
|
|
1037
|
+
}, vr = pt(null), yr = pt(null);
|
|
1038
1038
|
function br(e, t) {
|
|
1039
1039
|
if (!e) throw Error(`${t} must be used within PdfReader`);
|
|
1040
1040
|
return e;
|
|
1041
1041
|
}
|
|
1042
|
-
var Z = () => br(
|
|
1042
|
+
var Z = () => br(ht(vr), "useReaderChrome"), Q = () => br(ht(yr), "useReaderDocumentContext");
|
|
1043
1043
|
function xr(e) {
|
|
1044
1044
|
return e < 600 ? "compact" : e < 840 ? "medium" : "expanded";
|
|
1045
1045
|
}
|
|
1046
1046
|
//#endregion
|
|
1047
1047
|
//#region lib/components/ui/media/pdf-reader/use-container-size.ts
|
|
1048
1048
|
function Sr(e, t) {
|
|
1049
|
-
|
|
1049
|
+
I(() => {
|
|
1050
1050
|
let n = e.current;
|
|
1051
1051
|
if (!n || (t(xr(n.getBoundingClientRect().width)), typeof ResizeObserver > "u")) return;
|
|
1052
1052
|
let r = new ResizeObserver((e) => {
|
|
@@ -1059,8 +1059,8 @@ function Sr(e, t) {
|
|
|
1059
1059
|
//#endregion
|
|
1060
1060
|
//#region lib/components/ui/media/pdf-reader/use-focus-hand-off.ts
|
|
1061
1061
|
function Cr(e, t) {
|
|
1062
|
-
let n =
|
|
1063
|
-
|
|
1062
|
+
let n = R(t);
|
|
1063
|
+
F(() => {
|
|
1064
1064
|
let r = n.current;
|
|
1065
1065
|
n.current = t;
|
|
1066
1066
|
let i = e.current;
|
|
@@ -1108,7 +1108,7 @@ function wr(e, { typing: t, inBar: n, scrollsSideways: r = !1, rtl: i = !1 }) {
|
|
|
1108
1108
|
//#region lib/components/ui/media/pdf-reader/use-reader-keys.ts
|
|
1109
1109
|
var Tr = 1, Er = "[role=\"toolbar\"], [role=\"menu\"], [role=\"radiogroup\"], [role=\"tablist\"], [role=\"listbox\"], [role=\"tree\"], [role=\"grid\"]";
|
|
1110
1110
|
function Dr() {
|
|
1111
|
-
let { chrome: e, chromeActions: t, frameRef: n, openSearch: r } = Z(), { state: i, actions: a, searchHits: o } = Q(), s =
|
|
1111
|
+
let { chrome: e, chromeActions: t, frameRef: n, openSearch: r } = Z(), { state: i, actions: a, searchHits: o } = Q(), s = de(n) === "rtl", c = P((e) => {
|
|
1112
1112
|
if (e.defaultPrevented) return;
|
|
1113
1113
|
let t = e.target, c = n.current?.querySelector("[data-slot=\"scroll-area-viewport\"]"), l = wr(e.nativeEvent, {
|
|
1114
1114
|
typing: ["INPUT", "TEXTAREA"].includes(t.tagName),
|
|
@@ -1139,7 +1139,7 @@ function Dr() {
|
|
|
1139
1139
|
s,
|
|
1140
1140
|
o,
|
|
1141
1141
|
i.numPages
|
|
1142
|
-
]), l =
|
|
1142
|
+
]), l = _r.selectEscapeTarget(e), u = P((e) => {
|
|
1143
1143
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
1144
1144
|
let r = e.target;
|
|
1145
1145
|
!(r instanceof Node) || !n.current?.contains(r) || r instanceof Element && r.closest("[role=\"menu\"]") || (e.preventDefault(), e.stopPropagation(), l === "annotate" ? t.stopAnnotating() : t.closeSearchField());
|
|
@@ -1148,7 +1148,7 @@ function Dr() {
|
|
|
1148
1148
|
l,
|
|
1149
1149
|
n
|
|
1150
1150
|
]);
|
|
1151
|
-
return
|
|
1151
|
+
return xe("keydown", l ? u : null, void 0, !0), c;
|
|
1152
1152
|
}
|
|
1153
1153
|
//#endregion
|
|
1154
1154
|
//#region lib/components/ui/media/pdf-reader/format-locale.ts
|
|
@@ -1161,8 +1161,8 @@ function Or(e, t = "en") {
|
|
|
1161
1161
|
//#endregion
|
|
1162
1162
|
//#region lib/components/ui/media/pdf-reader/partials/announcer.tsx
|
|
1163
1163
|
function kr() {
|
|
1164
|
-
let { t: e, language: t } = j(), { state: n, scale: r, announcements: i } = Q(), [a, o] =
|
|
1165
|
-
return
|
|
1164
|
+
let { t: e, language: t } = j(), { state: n, scale: r, announcements: i } = Q(), [a, o] = z(""), { currentPage: s, numPages: c } = n, { recent: l } = i;
|
|
1165
|
+
return F(() => {
|
|
1166
1166
|
!l("page") || c === 0 || o(e("material.pdf-reader.next.announce-page", "Page {page} of {total}", {
|
|
1167
1167
|
page: s,
|
|
1168
1168
|
total: c
|
|
@@ -1171,13 +1171,13 @@ function kr() {
|
|
|
1171
1171
|
s,
|
|
1172
1172
|
c,
|
|
1173
1173
|
l
|
|
1174
|
-
]),
|
|
1174
|
+
]), F(() => {
|
|
1175
1175
|
l("zoom") && o(e("material.pdf-reader.next.announce-zoom", "Zoom {level}", { level: Or(r, t ?? "en") }));
|
|
1176
1176
|
}, [
|
|
1177
1177
|
r,
|
|
1178
1178
|
t,
|
|
1179
1179
|
l
|
|
1180
|
-
]), /* @__PURE__ */
|
|
1180
|
+
]), /* @__PURE__ */ V("div", {
|
|
1181
1181
|
"aria-live": "polite",
|
|
1182
1182
|
"aria-atomic": "true",
|
|
1183
1183
|
className: "sr-only",
|
|
@@ -1188,7 +1188,7 @@ function kr() {
|
|
|
1188
1188
|
//#region lib/components/ui/media/pdf-reader/partials/reader-status.tsx
|
|
1189
1189
|
function Ar({ onRetry: e }) {
|
|
1190
1190
|
let { t } = j(), { state: n, password: r } = Q();
|
|
1191
|
-
if (n.isPasswordProtected) return /* @__PURE__ */
|
|
1191
|
+
if (n.isPasswordProtected) return /* @__PURE__ */ V(pr, {
|
|
1192
1192
|
value: r.input,
|
|
1193
1193
|
incorrect: n.passwordError ?? !1,
|
|
1194
1194
|
onChange: r.setInput,
|
|
@@ -1196,13 +1196,13 @@ function Ar({ onRetry: e }) {
|
|
|
1196
1196
|
});
|
|
1197
1197
|
if (n.error) {
|
|
1198
1198
|
let r = n.loadError ?? Error(n.error);
|
|
1199
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ V(fr, {
|
|
1200
1200
|
error: r,
|
|
1201
1201
|
onRetry: e,
|
|
1202
|
-
title:
|
|
1202
|
+
title: Et(r).kind === "invalid" ? t("material.pdf-reader.next.invalid-error", "This file is not a valid PDF") : void 0
|
|
1203
1203
|
});
|
|
1204
1204
|
}
|
|
1205
|
-
return n.isLoading ? /* @__PURE__ */
|
|
1205
|
+
return n.isLoading ? /* @__PURE__ */ V(dr, {}) : null;
|
|
1206
1206
|
}
|
|
1207
1207
|
//#endregion
|
|
1208
1208
|
//#region lib/components/ui/media/pdf-reader/panel-surface.ts
|
|
@@ -1211,17 +1211,17 @@ var jr = "bg-[color-mix(in_oklab,var(--primary)_5%,var(--background))] dark:bg-[
|
|
|
1211
1211
|
//#region lib/components/ui/media/pdf-viewer/pdf-outline-sidebar.tsx
|
|
1212
1212
|
function Mr({ items: e, onSelect: t, className: r }) {
|
|
1213
1213
|
let { t: i } = j();
|
|
1214
|
-
return /* @__PURE__ */
|
|
1214
|
+
return /* @__PURE__ */ V("div", {
|
|
1215
1215
|
className: n("flex min-h-0 flex-1 flex-col", r),
|
|
1216
|
-
children: e.length === 0 ? /* @__PURE__ */
|
|
1216
|
+
children: e.length === 0 ? /* @__PURE__ */ V("p", {
|
|
1217
1217
|
className: "px-3 py-6 text-center text-xs text-muted-foreground",
|
|
1218
1218
|
children: i("material.pdf-reader.outline-empty", "No outline in this document")
|
|
1219
|
-
}) : /* @__PURE__ */
|
|
1219
|
+
}) : /* @__PURE__ */ V(ir, {
|
|
1220
1220
|
className: "flex-1",
|
|
1221
|
-
children: /* @__PURE__ */
|
|
1221
|
+
children: /* @__PURE__ */ V("nav", {
|
|
1222
1222
|
className: "p-2",
|
|
1223
1223
|
"aria-label": i("material.pdf-reader.outline", "Outline"),
|
|
1224
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
1224
|
+
children: e.map((e, n) => /* @__PURE__ */ V(Nr, {
|
|
1225
1225
|
item: e,
|
|
1226
1226
|
depth: 0,
|
|
1227
1227
|
onSelect: t
|
|
@@ -1231,22 +1231,22 @@ function Mr({ items: e, onSelect: t, className: r }) {
|
|
|
1231
1231
|
});
|
|
1232
1232
|
}
|
|
1233
1233
|
function Nr({ item: e, depth: t, onSelect: n }) {
|
|
1234
|
-
let { t: r } = j(), [i, a] =
|
|
1235
|
-
return /* @__PURE__ */
|
|
1234
|
+
let { t: r } = j(), [i, a] = z(t < 1), o = e.items.length > 0;
|
|
1235
|
+
return /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("button", {
|
|
1236
1236
|
type: "button",
|
|
1237
1237
|
style: { paddingLeft: 8 + t * 12 },
|
|
1238
1238
|
className: "flex w-full items-center gap-1 rounded px-2 py-1 text-left text-xs hover:bg-accent",
|
|
1239
1239
|
onClick: () => {
|
|
1240
1240
|
n(e), o && a((e) => !e);
|
|
1241
1241
|
},
|
|
1242
|
-
children: [o && /* @__PURE__ */
|
|
1242
|
+
children: [o && /* @__PURE__ */ V("span", {
|
|
1243
1243
|
className: "text-muted-foreground",
|
|
1244
1244
|
children: i ? "▾" : "▸"
|
|
1245
|
-
}), /* @__PURE__ */
|
|
1245
|
+
}), /* @__PURE__ */ V("span", {
|
|
1246
1246
|
className: "truncate",
|
|
1247
1247
|
children: e.title || r("material.pdf-reader.untitled", "Untitled")
|
|
1248
1248
|
})]
|
|
1249
|
-
}), o && i && e.items.map((e, r) => /* @__PURE__ */
|
|
1249
|
+
}), o && i && e.items.map((e, r) => /* @__PURE__ */ V(Nr, {
|
|
1250
1250
|
item: e,
|
|
1251
1251
|
depth: t + 1,
|
|
1252
1252
|
onSelect: n
|
|
@@ -1255,60 +1255,60 @@ function Nr({ item: e, depth: t, onSelect: n }) {
|
|
|
1255
1255
|
//#endregion
|
|
1256
1256
|
//#region lib/components/ui/media/pdf-reader/partials/search-field.tsx
|
|
1257
1257
|
function Pr({ autoFocus: e = !0, stacked: t = !1 }) {
|
|
1258
|
-
let { t: r } = j(), { state:
|
|
1259
|
-
|
|
1260
|
-
e &&
|
|
1261
|
-
}, [e,
|
|
1262
|
-
let
|
|
1263
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
1264
|
-
},
|
|
1265
|
-
return /* @__PURE__ */
|
|
1258
|
+
let { t: r } = j(), { state: i, actions: a, searchHits: o } = Q(), s = R(null), { chrome: c } = Z(), l = c.searchFocusTick;
|
|
1259
|
+
F(() => {
|
|
1260
|
+
e && s.current?.focus();
|
|
1261
|
+
}, [e, l]);
|
|
1262
|
+
let u = (e) => {
|
|
1263
|
+
e.key === "Enter" && (e.preventDefault(), o.jump(e.shiftKey ? -1 : 1));
|
|
1264
|
+
}, d = r("material.pdf-reader.search-prev", "Previous match (Shift+F3)"), f = r("material.pdf-reader.search-next", "Next match (F3)"), p = r("material.pdf-reader.search", "Search");
|
|
1265
|
+
return /* @__PURE__ */ H("div", {
|
|
1266
1266
|
className: n("flex min-w-0 flex-1 items-center gap-1", t && "flex-wrap"),
|
|
1267
1267
|
children: [
|
|
1268
|
-
/* @__PURE__ */
|
|
1269
|
-
label:
|
|
1268
|
+
/* @__PURE__ */ V(D, {
|
|
1269
|
+
label: p,
|
|
1270
1270
|
fit: !1,
|
|
1271
|
-
children: /* @__PURE__ */
|
|
1272
|
-
ref:
|
|
1271
|
+
children: /* @__PURE__ */ V(ie, {
|
|
1272
|
+
ref: s,
|
|
1273
1273
|
type: "search",
|
|
1274
|
-
"aria-label":
|
|
1275
|
-
placeholder:
|
|
1274
|
+
"aria-label": p,
|
|
1275
|
+
placeholder: p,
|
|
1276
1276
|
className: n("h-9 min-w-0 flex-1 text-sm", t && "basis-full"),
|
|
1277
|
-
value:
|
|
1277
|
+
value: i.searchQuery,
|
|
1278
1278
|
onChange: (e) => {
|
|
1279
|
-
|
|
1279
|
+
a.setSearch(e.target.value), o.reset();
|
|
1280
1280
|
},
|
|
1281
|
-
onKeyDown:
|
|
1281
|
+
onKeyDown: u
|
|
1282
1282
|
})
|
|
1283
1283
|
}),
|
|
1284
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ V("span", {
|
|
1285
1285
|
role: "status",
|
|
1286
1286
|
className: n("shrink-0 text-muted-foreground text-xs tabular-nums", t ? "me-auto text-start empty:w-0" : "min-w-14 text-center"),
|
|
1287
|
-
children:
|
|
1287
|
+
children: i.searchQuery ? r("material.pdf-reader.next.search-count", "{count, plural, =0 {No match} one {# match} other {# matches}}", { count: o.hitCount }) : null
|
|
1288
1288
|
}),
|
|
1289
|
-
/* @__PURE__ */
|
|
1289
|
+
/* @__PURE__ */ H("div", {
|
|
1290
1290
|
className: n(t ? "ms-auto flex gap-1" : "contents"),
|
|
1291
|
-
children: [/* @__PURE__ */
|
|
1292
|
-
label:
|
|
1293
|
-
children: /* @__PURE__ */
|
|
1291
|
+
children: [/* @__PURE__ */ V(D, {
|
|
1292
|
+
label: d,
|
|
1293
|
+
children: /* @__PURE__ */ V(be, {
|
|
1294
1294
|
variant: "ghost",
|
|
1295
1295
|
color: "default",
|
|
1296
|
-
"aria-label":
|
|
1297
|
-
tooltip:
|
|
1298
|
-
disabled:
|
|
1299
|
-
onClick: () =>
|
|
1300
|
-
children: /* @__PURE__ */
|
|
1296
|
+
"aria-label": d,
|
|
1297
|
+
tooltip: d,
|
|
1298
|
+
disabled: o.hitCount === 0,
|
|
1299
|
+
onClick: () => o.jump(-1),
|
|
1300
|
+
children: /* @__PURE__ */ V(Fe, {})
|
|
1301
1301
|
})
|
|
1302
|
-
}), /* @__PURE__ */
|
|
1303
|
-
label:
|
|
1304
|
-
children: /* @__PURE__ */
|
|
1302
|
+
}), /* @__PURE__ */ V(D, {
|
|
1303
|
+
label: f,
|
|
1304
|
+
children: /* @__PURE__ */ V(be, {
|
|
1305
1305
|
variant: "ghost",
|
|
1306
1306
|
color: "default",
|
|
1307
|
-
"aria-label":
|
|
1308
|
-
tooltip:
|
|
1309
|
-
disabled:
|
|
1310
|
-
onClick: () =>
|
|
1311
|
-
children: /* @__PURE__ */
|
|
1307
|
+
"aria-label": f,
|
|
1308
|
+
tooltip: f,
|
|
1309
|
+
disabled: o.hitCount === 0,
|
|
1310
|
+
onClick: () => o.jump(1),
|
|
1311
|
+
children: /* @__PURE__ */ V(Me, {})
|
|
1312
1312
|
})
|
|
1313
1313
|
})]
|
|
1314
1314
|
})
|
|
@@ -1316,7 +1316,7 @@ function Pr({ autoFocus: e = !0, stacked: t = !1 }) {
|
|
|
1316
1316
|
});
|
|
1317
1317
|
}
|
|
1318
1318
|
function Fr(e, t, n, r, i = "single", a = "ltr") {
|
|
1319
|
-
return
|
|
1319
|
+
return Ot(Array.from({ length: e }, (e, i) => Ut(t[i], n, r)), {
|
|
1320
1320
|
mode: i,
|
|
1321
1321
|
gap: 16,
|
|
1322
1322
|
columnGap: 12,
|
|
@@ -1324,8 +1324,8 @@ function Fr(e, t, n, r, i = "single", a = "ltr") {
|
|
|
1324
1324
|
});
|
|
1325
1325
|
}
|
|
1326
1326
|
function Ir(e, t, n, r, i, a) {
|
|
1327
|
-
let o = Math.min(n || 1,
|
|
1328
|
-
return
|
|
1327
|
+
let o = Math.min(n || 1, Lt), s = Fr(o, r, 1, i, t), c = Fr(o, r, 2, i, t).maxWidth - s.maxWidth, l = s.maxWidth - c;
|
|
1328
|
+
return zt(e, {
|
|
1329
1329
|
width: c,
|
|
1330
1330
|
height: Math.max(...s.rows.map((e) => e.height))
|
|
1331
1331
|
}, {
|
|
@@ -1455,7 +1455,7 @@ async function Jr(e, t, n, r, i) {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
async function Yr(e, t, n) {
|
|
1457
1457
|
let { page: r, viewport: i, scale: a, rotation: o } = e;
|
|
1458
|
-
return await
|
|
1458
|
+
return await Pt(r, t, Nt({
|
|
1459
1459
|
cssWidth: i.width,
|
|
1460
1460
|
cssHeight: i.height,
|
|
1461
1461
|
devicePixelRatio: window.devicePixelRatio,
|
|
@@ -1468,15 +1468,15 @@ async function Yr(e, t, n) {
|
|
|
1468
1468
|
//#endregion
|
|
1469
1469
|
//#region lib/components/ui/media/pdf-reader/engine/use-thumbnail.ts
|
|
1470
1470
|
function Xr(e) {
|
|
1471
|
-
let { doc: t, pageNumber: n, width: r, rotation: i, box: a, host: o } = e, [s, c] =
|
|
1472
|
-
|
|
1471
|
+
let { doc: t, pageNumber: n, width: r, rotation: i, box: a, host: o } = e, [s, c] = z(!1), l = R(null), u = R(e.onError);
|
|
1472
|
+
I(() => {
|
|
1473
1473
|
u.current = e.onError;
|
|
1474
|
-
}),
|
|
1474
|
+
}), F(() => {
|
|
1475
1475
|
let e = a.current;
|
|
1476
1476
|
if (!e) return;
|
|
1477
1477
|
let t = new IntersectionObserver(([e]) => c(!!e?.isIntersecting), { rootMargin: "240px 0px" });
|
|
1478
1478
|
return t.observe(e), () => t.disconnect();
|
|
1479
|
-
}, [a]),
|
|
1479
|
+
}, [a]), F(() => {
|
|
1480
1480
|
let e = o.current;
|
|
1481
1481
|
if (!t || !e || !s) return;
|
|
1482
1482
|
let a = new AbortController(), { signal: c } = a, d = document.createElement("canvas");
|
|
@@ -1495,7 +1495,7 @@ function Xr(e) {
|
|
|
1495
1495
|
i,
|
|
1496
1496
|
s,
|
|
1497
1497
|
o
|
|
1498
|
-
]),
|
|
1498
|
+
]), F(() => () => {
|
|
1499
1499
|
l.current?.cleanup(), l.current = null;
|
|
1500
1500
|
}, [
|
|
1501
1501
|
t,
|
|
@@ -1503,8 +1503,8 @@ function Xr(e) {
|
|
|
1503
1503
|
s
|
|
1504
1504
|
]);
|
|
1505
1505
|
}
|
|
1506
|
-
var Zr =
|
|
1507
|
-
let { t: l } = j(), u =
|
|
1506
|
+
var Zr = mt(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, current: o, tabStop: s, onGo: c }) {
|
|
1507
|
+
let { t: l } = j(), u = R(null), d = R(null);
|
|
1508
1508
|
Xr({
|
|
1509
1509
|
doc: t,
|
|
1510
1510
|
pageNumber: e,
|
|
@@ -1513,8 +1513,8 @@ var Zr = ht(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, curr
|
|
|
1513
1513
|
box: u,
|
|
1514
1514
|
host: d
|
|
1515
1515
|
});
|
|
1516
|
-
let f =
|
|
1517
|
-
return /* @__PURE__ */
|
|
1516
|
+
let f = Ut(r, 120 / qt(r ?? It, i).width, i);
|
|
1517
|
+
return /* @__PURE__ */ H("button", {
|
|
1518
1518
|
ref: u,
|
|
1519
1519
|
"data-lit": a ? "" : void 0,
|
|
1520
1520
|
"data-page-number": e,
|
|
@@ -1524,11 +1524,11 @@ var Zr = ht(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, curr
|
|
|
1524
1524
|
"aria-label": l("material.pdf-reader.go-to-page", "Go to page {page}", { page: e }),
|
|
1525
1525
|
"aria-current": o ? "page" : void 0,
|
|
1526
1526
|
className: n("flex cursor-pointer flex-col items-center gap-1 rounded-lg p-1.5 outline-none transition-colors hover:bg-foreground/5 focus-visible:ring-2 focus-visible:ring-ring", a && "bg-primary/10"),
|
|
1527
|
-
children: [/* @__PURE__ */
|
|
1527
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1528
1528
|
ref: d,
|
|
1529
1529
|
className: n("overflow-hidden rounded-sm bg-white shadow-sm [&>canvas]:block [&>canvas]:size-full", a && "ring-2 ring-primary"),
|
|
1530
1530
|
style: f
|
|
1531
|
-
}), /* @__PURE__ */
|
|
1531
|
+
}), /* @__PURE__ */ V("span", {
|
|
1532
1532
|
"aria-hidden": !0,
|
|
1533
1533
|
className: n("text-xs tabular-nums", a ? "font-semibold text-primary-text" : "text-muted-foreground"),
|
|
1534
1534
|
children: e
|
|
@@ -1541,10 +1541,10 @@ var Zr = ht(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, curr
|
|
|
1541
1541
|
End: (e, t) => t
|
|
1542
1542
|
};
|
|
1543
1543
|
function $r() {
|
|
1544
|
-
let { t: e } = j(), { state: t, actions: n, doc: r, rowStarts: i } = Q(), { numPages: a, currentPage: o, rotation: s } = t, c =
|
|
1545
|
-
return /* @__PURE__ */
|
|
1544
|
+
let { t: e } = j(), { state: t, actions: n, doc: r, rowStarts: i } = Q(), { numPages: a, currentPage: o, rotation: s } = t, c = R(null), [l, u] = z(null), [d, f] = zr(i, o, a), p = Math.min(Math.max(l ?? o, 1), a);
|
|
1545
|
+
return /* @__PURE__ */ V("div", {
|
|
1546
1546
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
1547
|
-
children: /* @__PURE__ */
|
|
1547
|
+
children: /* @__PURE__ */ V("div", {
|
|
1548
1548
|
ref: c,
|
|
1549
1549
|
role: "group",
|
|
1550
1550
|
"aria-label": e("material.pdf-reader.thumbnails", "Page thumbnails"),
|
|
@@ -1565,7 +1565,7 @@ function $r() {
|
|
|
1565
1565
|
className: "flex flex-col items-center gap-2 p-2",
|
|
1566
1566
|
children: Array.from({ length: a }, (e, i) => {
|
|
1567
1567
|
let a = i + 1;
|
|
1568
|
-
return /* @__PURE__ */
|
|
1568
|
+
return /* @__PURE__ */ V(Zr, {
|
|
1569
1569
|
pageNumber: a,
|
|
1570
1570
|
doc: r,
|
|
1571
1571
|
size: t.pageSizes?.[i],
|
|
@@ -1583,19 +1583,19 @@ function $r() {
|
|
|
1583
1583
|
//#region lib/components/ui/media/pdf-reader/partials/panel-content.tsx
|
|
1584
1584
|
function ei() {
|
|
1585
1585
|
let { t: e } = j(), { chrome: t } = Z(), { state: n, onOutlineSelect: r } = Q();
|
|
1586
|
-
return t.panelTab === "thumbs" ? /* @__PURE__ */
|
|
1586
|
+
return t.panelTab === "thumbs" ? /* @__PURE__ */ V($r, {}) : t.panelTab === "outline" ? n.outline.length === 0 ? /* @__PURE__ */ H("div", {
|
|
1587
1587
|
className: "flex flex-col items-center gap-2 px-6 py-10 text-center text-muted-foreground text-sm",
|
|
1588
|
-
children: [/* @__PURE__ */
|
|
1588
|
+
children: [/* @__PURE__ */ V(We, {
|
|
1589
1589
|
"aria-hidden": !0,
|
|
1590
1590
|
className: "size-6 opacity-60"
|
|
1591
|
-
}), /* @__PURE__ */
|
|
1592
|
-
}) : /* @__PURE__ */
|
|
1591
|
+
}), /* @__PURE__ */ V("p", { children: e("material.pdf-reader.next.outline-empty", "This document has no outline") })]
|
|
1592
|
+
}) : /* @__PURE__ */ V(Mr, {
|
|
1593
1593
|
items: n.outline,
|
|
1594
1594
|
onSelect: r
|
|
1595
|
-
}) : t.panelTab === "search" ? /* @__PURE__ */
|
|
1595
|
+
}) : t.panelTab === "search" ? /* @__PURE__ */ V("div", {
|
|
1596
1596
|
className: "p-3",
|
|
1597
|
-
children: /* @__PURE__ */
|
|
1598
|
-
}) : /* @__PURE__ */
|
|
1597
|
+
children: /* @__PURE__ */ V(Pr, { stacked: !0 })
|
|
1598
|
+
}) : /* @__PURE__ */ V("p", {
|
|
1599
1599
|
className: "p-4 text-muted-foreground text-sm",
|
|
1600
1600
|
children: e("material.pdf-reader.next.annotations-empty", "No annotations yet")
|
|
1601
1601
|
});
|
|
@@ -1619,10 +1619,10 @@ var ti = [
|
|
|
1619
1619
|
"initialChrome",
|
|
1620
1620
|
"showUnfinished"
|
|
1621
1621
|
], ii = {
|
|
1622
|
-
thumbs:
|
|
1623
|
-
outline:
|
|
1624
|
-
annotations:
|
|
1625
|
-
search:
|
|
1622
|
+
thumbs: Ue,
|
|
1623
|
+
outline: We,
|
|
1624
|
+
annotations: qe,
|
|
1625
|
+
search: rt
|
|
1626
1626
|
};
|
|
1627
1627
|
function ai() {
|
|
1628
1628
|
let { t: e } = j();
|
|
@@ -1641,7 +1641,7 @@ function oi() {
|
|
|
1641
1641
|
//#region lib/components/ui/media/pdf-reader/partials/panel-tabs.tsx
|
|
1642
1642
|
function si({ iconOnly: e }) {
|
|
1643
1643
|
let { t } = j(), { chrome: n, chromeActions: r } = Z(), i = ai(), a = oi(), o = e ? a : a.filter((e) => e !== "search");
|
|
1644
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ V(we, {
|
|
1645
1645
|
type: "single",
|
|
1646
1646
|
variant: "segmented",
|
|
1647
1647
|
value: n.panelTab,
|
|
@@ -1650,11 +1650,11 @@ function si({ iconOnly: e }) {
|
|
|
1650
1650
|
className: "mx-3 mt-3 mb-1 w-auto shrink-0",
|
|
1651
1651
|
children: o.map((t) => {
|
|
1652
1652
|
let n = ii[t];
|
|
1653
|
-
return /* @__PURE__ */
|
|
1653
|
+
return /* @__PURE__ */ H(Se, {
|
|
1654
1654
|
value: t,
|
|
1655
1655
|
"aria-label": e ? i[t] : void 0,
|
|
1656
1656
|
className: "flex-1",
|
|
1657
|
-
children: [/* @__PURE__ */
|
|
1657
|
+
children: [/* @__PURE__ */ V(n, {}), e ? null : i[t]]
|
|
1658
1658
|
}, t);
|
|
1659
1659
|
})
|
|
1660
1660
|
});
|
|
@@ -1662,31 +1662,31 @@ function si({ iconOnly: e }) {
|
|
|
1662
1662
|
//#endregion
|
|
1663
1663
|
//#region lib/components/ui/media/pdf-reader/partials/phone-sheet.tsx
|
|
1664
1664
|
function ci() {
|
|
1665
|
-
let { t: e } = j(), { chrome: t, chromeActions: r, mode:
|
|
1665
|
+
let { t: e } = j(), { chrome: t, chromeActions: r, mode: i } = Z(), a = e("material.pdf-reader.next.panel", "Document panel"), o = /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(si, { iconOnly: !1 }), /* @__PURE__ */ V("div", {
|
|
1666
1666
|
className: "flex h-[min(46dvh,22rem)] min-h-0 flex-col",
|
|
1667
|
-
children: /* @__PURE__ */
|
|
1667
|
+
children: /* @__PURE__ */ V(ei, {})
|
|
1668
1668
|
})] });
|
|
1669
|
-
return
|
|
1670
|
-
"aria-label":
|
|
1669
|
+
return i === "fullscreen" ? t.panelOpen ? /* @__PURE__ */ H("aside", {
|
|
1670
|
+
"aria-label": a,
|
|
1671
1671
|
className: n("absolute inset-x-0 bottom-0 z-20 flex flex-col rounded-t-2xl border-t pb-2 shadow-2xl", jr),
|
|
1672
|
-
children: [/* @__PURE__ */
|
|
1672
|
+
children: [/* @__PURE__ */ V(be, {
|
|
1673
1673
|
variant: "ghost",
|
|
1674
1674
|
color: "default",
|
|
1675
1675
|
"aria-label": e("material.buttons.close", "Close"),
|
|
1676
1676
|
className: "absolute end-1 top-1 z-10",
|
|
1677
1677
|
onClick: () => r.closePanel(),
|
|
1678
|
-
children: /* @__PURE__ */
|
|
1679
|
-
}),
|
|
1680
|
-
}) : null : /* @__PURE__ */
|
|
1678
|
+
children: /* @__PURE__ */ V(lt, {})
|
|
1679
|
+
}), o]
|
|
1680
|
+
}) : null : /* @__PURE__ */ V(Qn, {
|
|
1681
1681
|
open: t.panelOpen,
|
|
1682
1682
|
onOpenChange: (e) => !e && r.closePanel(),
|
|
1683
|
-
children: /* @__PURE__ */
|
|
1683
|
+
children: /* @__PURE__ */ H(rr, {
|
|
1684
1684
|
side: "bottom",
|
|
1685
1685
|
className: n("gap-0 rounded-t-2xl p-0", jr),
|
|
1686
|
-
children: [/* @__PURE__ */
|
|
1686
|
+
children: [/* @__PURE__ */ V(Xn, {
|
|
1687
1687
|
className: "sr-only",
|
|
1688
|
-
children:
|
|
1689
|
-
}),
|
|
1688
|
+
children: a
|
|
1689
|
+
}), o]
|
|
1690
1690
|
})
|
|
1691
1691
|
});
|
|
1692
1692
|
}
|
|
@@ -1694,22 +1694,22 @@ function ci() {
|
|
|
1694
1694
|
//#region lib/components/ui/media/pdf-reader/partials/side-panel.tsx
|
|
1695
1695
|
function li() {
|
|
1696
1696
|
let { t: e } = j(), { chrome: t } = Z();
|
|
1697
|
-
return t.size === "compact" ? /* @__PURE__ */
|
|
1697
|
+
return t.size === "compact" ? /* @__PURE__ */ V(ci, {}) : t.panelOpen ? /* @__PURE__ */ H("aside", {
|
|
1698
1698
|
"aria-label": e("material.pdf-reader.next.panel", "Document panel"),
|
|
1699
1699
|
className: n("flex h-full w-56 shrink-0 flex-col border-e border-border", jr),
|
|
1700
|
-
children: [t.size === "medium" ? /* @__PURE__ */
|
|
1700
|
+
children: [t.size === "medium" ? /* @__PURE__ */ V(si, { iconOnly: !0 }) : null, /* @__PURE__ */ V("div", {
|
|
1701
1701
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1702
|
-
children: /* @__PURE__ */
|
|
1702
|
+
children: /* @__PURE__ */ V(ei, {})
|
|
1703
1703
|
})]
|
|
1704
1704
|
}) : null;
|
|
1705
1705
|
}
|
|
1706
1706
|
//#endregion
|
|
1707
1707
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-canvas.ts
|
|
1708
1708
|
function ui(e) {
|
|
1709
|
-
let { doc: t, pageNumber: n, scale: r, rotation: i, host: a, cache: o, attempt: s } = e, [c, l] =
|
|
1710
|
-
return
|
|
1709
|
+
let { doc: t, pageNumber: n, scale: r, rotation: i, host: a, cache: o, attempt: s } = e, [c, l] = z(null), u = R(null), d = R(e.onError), f = R(e.onDrawn);
|
|
1710
|
+
return I(() => {
|
|
1711
1711
|
d.current = e.onError, f.current = e.onDrawn;
|
|
1712
|
-
}),
|
|
1712
|
+
}), F(() => {
|
|
1713
1713
|
let e = a.current;
|
|
1714
1714
|
if (!t || !e || !o) return;
|
|
1715
1715
|
let s = {
|
|
@@ -1742,27 +1742,27 @@ function ui(e) {
|
|
|
1742
1742
|
a,
|
|
1743
1743
|
o,
|
|
1744
1744
|
s
|
|
1745
|
-
]),
|
|
1745
|
+
]), F(() => () => {
|
|
1746
1746
|
u.current?.cleanup(), u.current = null;
|
|
1747
1747
|
}, [t, n]), c;
|
|
1748
1748
|
}
|
|
1749
1749
|
//#endregion
|
|
1750
1750
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-failure.ts
|
|
1751
1751
|
function di() {
|
|
1752
|
-
let [e, t] =
|
|
1752
|
+
let [e, t] = z(null), [n, r] = z(0), i = R(null);
|
|
1753
1753
|
return {
|
|
1754
1754
|
failure: e,
|
|
1755
1755
|
attempt: n,
|
|
1756
1756
|
box: i,
|
|
1757
|
-
onError:
|
|
1757
|
+
onError: P((e) => t({
|
|
1758
1758
|
error: e,
|
|
1759
1759
|
busy: !1
|
|
1760
1760
|
}), []),
|
|
1761
|
-
onDrawn:
|
|
1761
|
+
onDrawn: P(() => {
|
|
1762
1762
|
let e = i.current;
|
|
1763
1763
|
e?.contains(document.activeElement) && e.closest("[data-slot=\"scroll-area-viewport\"]")?.focus({ preventScroll: !0 }), t(null);
|
|
1764
1764
|
}, []),
|
|
1765
|
-
retry:
|
|
1765
|
+
retry: P(() => {
|
|
1766
1766
|
t((e) => e && {
|
|
1767
1767
|
...e,
|
|
1768
1768
|
busy: !0
|
|
@@ -1773,7 +1773,7 @@ function di() {
|
|
|
1773
1773
|
//#endregion
|
|
1774
1774
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-link-labels.ts
|
|
1775
1775
|
function fi(e) {
|
|
1776
|
-
let { t } = j(), n =
|
|
1776
|
+
let { t } = j(), n = R(/* @__PURE__ */ new Map()), r = L(() => ({
|
|
1777
1777
|
external: (e) => t("material.pdf-reader.link-external", "Link: {host}", { host: e }),
|
|
1778
1778
|
goToPage: (e) => t("material.pdf-reader.go-to-page", "Go to page {page}", { page: e }),
|
|
1779
1779
|
internal: t("material.pdf-reader.link-internal", "Link in document"),
|
|
@@ -1783,10 +1783,10 @@ function fi(e) {
|
|
|
1783
1783
|
})
|
|
1784
1784
|
}), [t]);
|
|
1785
1785
|
return {
|
|
1786
|
-
onAnnotations:
|
|
1786
|
+
onAnnotations: P((e) => {
|
|
1787
1787
|
for (let t of e) t.id && n.current.set(t.id, t);
|
|
1788
1788
|
}, []),
|
|
1789
|
-
labelLinks:
|
|
1789
|
+
labelLinks: P((t) => Vt(t, (e) => n.current.get(e), (t) => Gt(e?.current, t), r), [e, r])
|
|
1790
1790
|
};
|
|
1791
1791
|
}
|
|
1792
1792
|
//#endregion
|
|
@@ -1861,13 +1861,13 @@ async function Si({ page: e, viewport: t }, n, r, i) {
|
|
|
1861
1861
|
//#endregion
|
|
1862
1862
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-layers.ts
|
|
1863
1863
|
function Ci(e) {
|
|
1864
|
-
let { drawn: t, pageNumber: n, doc: r, linkService: i, highlight: a } = e, { text: o, annotations: s, page: c } = e, [l, u] =
|
|
1865
|
-
|
|
1864
|
+
let { drawn: t, pageNumber: n, doc: r, linkService: i, highlight: a } = e, { text: o, annotations: s, page: c } = e, [l, u] = z(null), [d, f] = z(0), { onAnnotations: p, labelLinks: m } = fi(e.pdfRef);
|
|
1865
|
+
F(() => {
|
|
1866
1866
|
let e = o.current;
|
|
1867
1867
|
if (!t || !e) return;
|
|
1868
1868
|
let n = new AbortController();
|
|
1869
1869
|
return xi(t, e, n.signal).then((e) => e && u(e)).catch(() => {}), () => n.abort();
|
|
1870
|
-
}, [t, o]),
|
|
1870
|
+
}, [t, o]), F(() => {
|
|
1871
1871
|
let e = s.current;
|
|
1872
1872
|
if (!t || !e || !r || !i) return;
|
|
1873
1873
|
let n = new AbortController();
|
|
@@ -1883,7 +1883,7 @@ function Ci(e) {
|
|
|
1883
1883
|
r,
|
|
1884
1884
|
i,
|
|
1885
1885
|
p
|
|
1886
|
-
]),
|
|
1886
|
+
]), F(() => {
|
|
1887
1887
|
d && m(c.current);
|
|
1888
1888
|
}, [
|
|
1889
1889
|
d,
|
|
@@ -1891,8 +1891,8 @@ function Ci(e) {
|
|
|
1891
1891
|
c
|
|
1892
1892
|
]);
|
|
1893
1893
|
let h = a.texts[n - 1], g = a.matches[n - 1], _ = a.current?.page === n ? a.current.hit : -1;
|
|
1894
|
-
|
|
1895
|
-
l &&
|
|
1894
|
+
F(() => {
|
|
1895
|
+
l && Tt(l, {
|
|
1896
1896
|
text: h,
|
|
1897
1897
|
matches: g,
|
|
1898
1898
|
current: _,
|
|
@@ -1910,7 +1910,7 @@ function Ci(e) {
|
|
|
1910
1910
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-drawing.ts
|
|
1911
1911
|
function wi(e) {
|
|
1912
1912
|
let { doc: t, cache: n, pdfRef: r, pageRefs: i, highlight: a, linkService: o } = e, { scale: s, rotation: c, searchQuery: l, nightMode: u } = e;
|
|
1913
|
-
return
|
|
1913
|
+
return L(() => ({
|
|
1914
1914
|
doc: t,
|
|
1915
1915
|
cache: n,
|
|
1916
1916
|
pdfRef: r,
|
|
@@ -1935,7 +1935,7 @@ function wi(e) {
|
|
|
1935
1935
|
]);
|
|
1936
1936
|
}
|
|
1937
1937
|
function Ti(e, t) {
|
|
1938
|
-
let { doc: n, scale: r, rotation: i, pageRefs: a } = t, o =
|
|
1938
|
+
let { doc: n, scale: r, rotation: i, pageRefs: a } = t, o = R(null), s = R(null), c = R(null), l = R(null), u = di(), d = ui({
|
|
1939
1939
|
doc: n,
|
|
1940
1940
|
pageNumber: e,
|
|
1941
1941
|
scale: r,
|
|
@@ -1958,7 +1958,7 @@ function Ti(e, t) {
|
|
|
1958
1958
|
highlight: t.highlight,
|
|
1959
1959
|
searchQuery: t.searchQuery
|
|
1960
1960
|
}), {
|
|
1961
|
-
setPage:
|
|
1961
|
+
setPage: P((t) => {
|
|
1962
1962
|
o.current = t, t ? a.current.set(e, t) : a.current.delete(e);
|
|
1963
1963
|
}, [e, a]),
|
|
1964
1964
|
canvas: s,
|
|
@@ -1973,8 +1973,8 @@ function Ti(e, t) {
|
|
|
1973
1973
|
function Ei(e, t, n) {
|
|
1974
1974
|
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;
|
|
1975
1975
|
return {
|
|
1976
|
-
anchor:
|
|
1977
|
-
page:
|
|
1976
|
+
anchor: wt(n, r, a),
|
|
1977
|
+
page: Mt(n, {
|
|
1978
1978
|
top: r - 20,
|
|
1979
1979
|
height: i,
|
|
1980
1980
|
atEnd: o
|
|
@@ -1982,46 +1982,46 @@ function Ei(e, t, n) {
|
|
|
1982
1982
|
};
|
|
1983
1983
|
}
|
|
1984
1984
|
function Di(e) {
|
|
1985
|
-
let { scroller: t, layout: n, currentPage: r } = e, [i, a] =
|
|
1985
|
+
let { scroller: t, layout: n, currentPage: r } = e, [i, a] = z({
|
|
1986
1986
|
top: 0,
|
|
1987
1987
|
height: 0
|
|
1988
|
-
}), o =
|
|
1988
|
+
}), o = R({
|
|
1989
1989
|
page: r,
|
|
1990
1990
|
fraction: 0
|
|
1991
|
-
}), s =
|
|
1991
|
+
}), s = R(r), c = R(null), l = R({
|
|
1992
1992
|
options: e,
|
|
1993
1993
|
layout: n
|
|
1994
1994
|
});
|
|
1995
|
-
|
|
1995
|
+
I(() => {
|
|
1996
1996
|
l.current = {
|
|
1997
1997
|
options: e,
|
|
1998
1998
|
layout: n
|
|
1999
1999
|
};
|
|
2000
2000
|
});
|
|
2001
|
-
let u =
|
|
2001
|
+
let u = P((e, t) => {
|
|
2002
2002
|
e.scrollTop = t, c.current = e.scrollTop, a({
|
|
2003
2003
|
top: e.scrollTop,
|
|
2004
2004
|
height: e.clientHeight
|
|
2005
2005
|
});
|
|
2006
2006
|
}, []);
|
|
2007
|
-
return
|
|
2007
|
+
return I(() => {
|
|
2008
2008
|
let e = t.current;
|
|
2009
|
-
e && u(e,
|
|
2009
|
+
e && u(e, At(n, o.current));
|
|
2010
2010
|
}, [
|
|
2011
2011
|
n,
|
|
2012
2012
|
t,
|
|
2013
2013
|
u
|
|
2014
|
-
]),
|
|
2014
|
+
]), I(() => {
|
|
2015
2015
|
let e = t.current;
|
|
2016
2016
|
!e || r === s.current || (s.current = r, o.current = {
|
|
2017
2017
|
page: r,
|
|
2018
2018
|
fraction: 0
|
|
2019
|
-
}, u(e,
|
|
2019
|
+
}, u(e, At(l.current.layout, o.current)));
|
|
2020
2020
|
}, [
|
|
2021
2021
|
r,
|
|
2022
2022
|
t,
|
|
2023
2023
|
u
|
|
2024
|
-
]),
|
|
2024
|
+
]), F(() => {
|
|
2025
2025
|
let e = t.current;
|
|
2026
2026
|
if (!e) return;
|
|
2027
2027
|
let n = 0, r = getComputedStyle(e).direction === "rtl", i = () => {
|
|
@@ -2046,7 +2046,7 @@ function Di(e) {
|
|
|
2046
2046
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-window.ts
|
|
2047
2047
|
var Oi = 1;
|
|
2048
2048
|
function ki(e, t, n = "_blank", r = "single") {
|
|
2049
|
-
let { state: i, scale: a, doc: o, actions: s } = e, { goToPage: c } = s, { reportPage: l } = e, u =
|
|
2049
|
+
let { state: i, scale: a, doc: o, actions: s } = e, { goToPage: c } = s, { reportPage: l } = e, u = de(t), d = L(() => Fr(i.numPages, i.pageSizes ?? [], a, i.rotation, r, u), [
|
|
2050
2050
|
i.numPages,
|
|
2051
2051
|
i.pageSizes,
|
|
2052
2052
|
a,
|
|
@@ -2062,11 +2062,11 @@ function ki(e, t, n = "_blank", r = "single") {
|
|
|
2062
2062
|
});
|
|
2063
2063
|
return {
|
|
2064
2064
|
layout: d,
|
|
2065
|
-
shown:
|
|
2065
|
+
shown: kt(d, {
|
|
2066
2066
|
top: f.top - 20,
|
|
2067
2067
|
height: f.height || (i.containerHeight ?? 800)
|
|
2068
2068
|
}, Oi),
|
|
2069
|
-
linkService:
|
|
2069
|
+
linkService: L(() => o ? Dt({
|
|
2070
2070
|
doc: o,
|
|
2071
2071
|
goToPage: c,
|
|
2072
2072
|
externalLinkTarget: n
|
|
@@ -2080,30 +2080,30 @@ function ki(e, t, n = "_blank", r = "single") {
|
|
|
2080
2080
|
//#endregion
|
|
2081
2081
|
//#region lib/components/ui/media/pdf-reader/partials/page-failure.tsx
|
|
2082
2082
|
function Ai({ pageNumber: e, error: t, busy: r, onRetry: i, ref: a }) {
|
|
2083
|
-
let { t: o } = j(), s =
|
|
2084
|
-
return /* @__PURE__ */
|
|
2083
|
+
let { t: o } = j(), s = Et(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");
|
|
2084
|
+
return /* @__PURE__ */ H("div", {
|
|
2085
2085
|
ref: a,
|
|
2086
2086
|
"data-page-failure": "",
|
|
2087
2087
|
"aria-busy": r || void 0,
|
|
2088
2088
|
className: n("absolute inset-0 flex flex-col items-center gap-3 bg-muted p-4 text-center text-muted-foreground", "justify-start pt-[clamp(2rem,12%,7rem)]"),
|
|
2089
|
-
children: [/* @__PURE__ */
|
|
2089
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2090
2090
|
role: "status",
|
|
2091
2091
|
className: "flex flex-col items-center gap-3",
|
|
2092
|
-
children: [/* @__PURE__ */
|
|
2092
|
+
children: [/* @__PURE__ */ V(ze, {
|
|
2093
2093
|
"aria-hidden": !0,
|
|
2094
2094
|
className: "size-6 shrink-0"
|
|
2095
|
-
}), /* @__PURE__ */
|
|
2095
|
+
}), /* @__PURE__ */ V("p", {
|
|
2096
2096
|
className: "max-w-64 text-balance text-sm",
|
|
2097
2097
|
children: s
|
|
2098
2098
|
})]
|
|
2099
|
-
}), /* @__PURE__ */
|
|
2099
|
+
}), /* @__PURE__ */ H(M, {
|
|
2100
2100
|
variant: "outlined",
|
|
2101
2101
|
color: "default",
|
|
2102
2102
|
size: "sm",
|
|
2103
2103
|
"aria-disabled": r || void 0,
|
|
2104
2104
|
onClick: r ? void 0 : i,
|
|
2105
2105
|
"aria-label": o("material.pdf-reader.next.retry-page", "Retry page {page}", { page: e }),
|
|
2106
|
-
children: [/* @__PURE__ */
|
|
2106
|
+
children: [/* @__PURE__ */ V(nt, {
|
|
2107
2107
|
"aria-hidden": !0,
|
|
2108
2108
|
className: n(r && "animate-spin motion-reduce:animate-none")
|
|
2109
2109
|
}), o("material.pdf-reader.retry", "Retry")]
|
|
@@ -2112,7 +2112,7 @@ function Ai({ pageNumber: e, error: t, busy: r, onRetry: i, ref: a }) {
|
|
|
2112
2112
|
}
|
|
2113
2113
|
//#endregion
|
|
2114
2114
|
//#region lib/components/ui/media/pdf-reader/partials/page-view.tsx
|
|
2115
|
-
var ji =
|
|
2115
|
+
var ji = mt(function({ pageNumber: e, top: t, offset: r, width: i, height: a, env: o }) {
|
|
2116
2116
|
let { setPage: s, canvas: c, text: l, annotations: u, drawn: d, failed: f } = Ti(e, o), p = {
|
|
2117
2117
|
top: t,
|
|
2118
2118
|
left: `calc(50% + ${r}px)`,
|
|
@@ -2122,26 +2122,26 @@ var ji = ht(function({ pageNumber: e, top: t, offset: r, width: i, height: a, en
|
|
|
2122
2122
|
"--scale-round-x": "1px",
|
|
2123
2123
|
"--scale-round-y": "1px"
|
|
2124
2124
|
};
|
|
2125
|
-
return /* @__PURE__ */
|
|
2125
|
+
return /* @__PURE__ */ H("div", {
|
|
2126
2126
|
ref: s,
|
|
2127
2127
|
"data-page-number": e,
|
|
2128
2128
|
"data-drawn": d ? "" : void 0,
|
|
2129
2129
|
className: n("absolute overflow-hidden rounded-sm bg-white", "shadow-[0_1px_2px_rgb(0_0_0/0.08),0_4px_16px_-4px_rgb(0_0_0/0.18)]", o.nightMode && "pdf-night-page"),
|
|
2130
2130
|
style: p,
|
|
2131
2131
|
children: [
|
|
2132
|
-
/* @__PURE__ */
|
|
2132
|
+
/* @__PURE__ */ V("div", {
|
|
2133
2133
|
ref: c,
|
|
2134
2134
|
className: "absolute inset-0 [&>canvas]:block [&>canvas]:size-full"
|
|
2135
2135
|
}),
|
|
2136
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ V("div", {
|
|
2137
2137
|
ref: l,
|
|
2138
2138
|
className: "textLayer"
|
|
2139
2139
|
}),
|
|
2140
|
-
/* @__PURE__ */
|
|
2140
|
+
/* @__PURE__ */ V("div", {
|
|
2141
2141
|
ref: u,
|
|
2142
2142
|
className: "annotationLayer"
|
|
2143
2143
|
}),
|
|
2144
|
-
f.failure && /* @__PURE__ */
|
|
2144
|
+
f.failure && /* @__PURE__ */ V(Ai, {
|
|
2145
2145
|
ref: f.box,
|
|
2146
2146
|
pageNumber: e,
|
|
2147
2147
|
error: f.failure.error,
|
|
@@ -2154,7 +2154,7 @@ var ji = ht(function({ pageNumber: e, top: t, offset: r, width: i, height: a, en
|
|
|
2154
2154
|
//#endregion
|
|
2155
2155
|
//#region lib/components/ui/media/pdf-reader/partials/viewport.tsx
|
|
2156
2156
|
function Mi() {
|
|
2157
|
-
let { t: e } = j(), { props: t, ...r } = Z(), i = Q(), a =
|
|
2157
|
+
let { t: e } = j(), { props: t, ...r } = Z(), i = Q(), a = R(null), { layout: o } = r, { layout: s, shown: c, linkService: l } = ki(i, a, t.externalLinkTarget, o.mode), u = wi({
|
|
2158
2158
|
doc: i.doc,
|
|
2159
2159
|
cache: i.canvasCache,
|
|
2160
2160
|
pdfRef: i.pdfRef,
|
|
@@ -2166,7 +2166,7 @@ function Mi() {
|
|
|
2166
2166
|
searchQuery: i.state.searchQuery,
|
|
2167
2167
|
nightMode: i.state.nightMode
|
|
2168
2168
|
}), d = [];
|
|
2169
|
-
for (let e = c.first; e <= c.last; e++) d.push(/* @__PURE__ */
|
|
2169
|
+
for (let e = c.first; e <= c.last; e++) d.push(/* @__PURE__ */ V(ji, {
|
|
2170
2170
|
pageNumber: e + 1,
|
|
2171
2171
|
top: 20 + (s.tops[e] ?? 0),
|
|
2172
2172
|
offset: (s.lefts[e] ?? 0) - s.maxWidth / 2,
|
|
@@ -2174,14 +2174,14 @@ function Mi() {
|
|
|
2174
2174
|
height: s.heights[e] ?? 0,
|
|
2175
2175
|
env: u
|
|
2176
2176
|
}, e + 1));
|
|
2177
|
-
return /* @__PURE__ */
|
|
2177
|
+
return /* @__PURE__ */ V("section", {
|
|
2178
2178
|
ref: a,
|
|
2179
2179
|
tabIndex: 0,
|
|
2180
2180
|
"aria-label": e("material.pdf-reader.pages", "Pages"),
|
|
2181
2181
|
"data-slot": "scroll-area-viewport",
|
|
2182
2182
|
"data-layout": o.mode,
|
|
2183
2183
|
className: n("size-full overflow-auto outline-none [overflow-anchor:none]", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", "scroll-pb-24"),
|
|
2184
|
-
children: /* @__PURE__ */
|
|
2184
|
+
children: /* @__PURE__ */ V("div", {
|
|
2185
2185
|
className: "relative min-w-full",
|
|
2186
2186
|
style: {
|
|
2187
2187
|
height: 20 + s.totalHeight + 112,
|
|
@@ -2195,14 +2195,14 @@ function Mi() {
|
|
|
2195
2195
|
//#region lib/components/ui/media/pdf-reader/partials/body.tsx
|
|
2196
2196
|
function Ni() {
|
|
2197
2197
|
let { state: e, containerRef: t, handlers: n } = Q(), r = e.numPages > 0 && !e.error && !e.isPasswordProtected;
|
|
2198
|
-
return /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ H("div", {
|
|
2199
2199
|
className: "flex min-h-0 min-w-0 flex-1",
|
|
2200
|
-
children: [r ? /* @__PURE__ */
|
|
2200
|
+
children: [r ? /* @__PURE__ */ V(li, {}) : null, /* @__PURE__ */ H("div", {
|
|
2201
2201
|
ref: t,
|
|
2202
2202
|
tabIndex: -1,
|
|
2203
2203
|
"aria-busy": e.isLoading || void 0,
|
|
2204
2204
|
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))]",
|
|
2205
|
-
children: [r ? /* @__PURE__ */
|
|
2205
|
+
children: [r ? /* @__PURE__ */ V(Mi, {}) : null, /* @__PURE__ */ V(Ar, { onRetry: () => {
|
|
2206
2206
|
t.current?.focus(), n.onRetry();
|
|
2207
2207
|
} })]
|
|
2208
2208
|
})]
|
|
@@ -2222,14 +2222,14 @@ function $() {
|
|
|
2222
2222
|
//#region lib/components/ui/media/pdf-reader/partials/fullscreen-exit.tsx
|
|
2223
2223
|
function Pi() {
|
|
2224
2224
|
let { t: e } = j(), t = $(), { leave: n } = Z(), r = e("material.pdf-reader.exit-fullscreen", "Exit fullscreen");
|
|
2225
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ V("div", {
|
|
2226
2226
|
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))]",
|
|
2227
|
-
children: /* @__PURE__ */
|
|
2227
|
+
children: /* @__PURE__ */ V(O, {
|
|
2228
2228
|
label: r,
|
|
2229
2229
|
...t,
|
|
2230
2230
|
className: "pointer-events-auto",
|
|
2231
|
-
children: /* @__PURE__ */
|
|
2232
|
-
icon: /* @__PURE__ */
|
|
2231
|
+
children: /* @__PURE__ */ V(A, {
|
|
2232
|
+
icon: /* @__PURE__ */ V(Je, {}),
|
|
2233
2233
|
label: r,
|
|
2234
2234
|
onClick: n
|
|
2235
2235
|
})
|
|
@@ -2262,37 +2262,37 @@ function Fi(e, t, n = !0) {
|
|
|
2262
2262
|
//#region lib/components/ui/media/pdf-reader/use-fullscreen-enabled.ts
|
|
2263
2263
|
var Ii = () => () => {};
|
|
2264
2264
|
function Li() {
|
|
2265
|
-
return
|
|
2265
|
+
return vt(Ii, () => document.fullscreenEnabled === !0, () => !1);
|
|
2266
2266
|
}
|
|
2267
2267
|
//#endregion
|
|
2268
2268
|
//#region lib/components/ui/media/pdf-reader/partials/annotate-header.tsx
|
|
2269
2269
|
function Ri() {
|
|
2270
2270
|
let { t: e } = j(), t = $(), { chromeActions: n, props: r } = Z(), i = e("material.pdf-reader.next.annotate-done", "Done"), a = e("material.pdf-reader.next.annotate-title", "Annotation");
|
|
2271
|
-
return /* @__PURE__ */
|
|
2271
|
+
return /* @__PURE__ */ H(O, {
|
|
2272
2272
|
label: a,
|
|
2273
2273
|
variant: "docked",
|
|
2274
2274
|
...t,
|
|
2275
2275
|
className: "shrink-0 border-b border-border",
|
|
2276
2276
|
children: [
|
|
2277
|
-
/* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ H("div", {
|
|
2278
2278
|
className: "flex min-w-0 flex-1 items-baseline gap-2 px-1.5",
|
|
2279
|
-
children: [/* @__PURE__ */
|
|
2279
|
+
children: [/* @__PURE__ */ V("span", {
|
|
2280
2280
|
className: "truncate font-semibold text-foreground",
|
|
2281
2281
|
children: a
|
|
2282
|
-
}), /* @__PURE__ */
|
|
2282
|
+
}), /* @__PURE__ */ V("span", {
|
|
2283
2283
|
className: "shrink-0 whitespace-nowrap text-muted-foreground text-sm",
|
|
2284
2284
|
children: e("material.pdf-reader.next.annotate-notes", "{count, plural, one {# note} other {# notes}}", { count: r.annotationCount ?? 0 })
|
|
2285
2285
|
})]
|
|
2286
2286
|
}),
|
|
2287
|
-
/* @__PURE__ */
|
|
2288
|
-
icon: /* @__PURE__ */
|
|
2287
|
+
/* @__PURE__ */ V(A, {
|
|
2288
|
+
icon: /* @__PURE__ */ V(st, {}),
|
|
2289
2289
|
label: e("material.pdf-reader.next.annotate-undo", "Undo"),
|
|
2290
2290
|
disabled: !0
|
|
2291
2291
|
}),
|
|
2292
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ V(D, {
|
|
2293
2293
|
label: i,
|
|
2294
2294
|
fit: !1,
|
|
2295
|
-
children: /* @__PURE__ */
|
|
2295
|
+
children: /* @__PURE__ */ V(M, {
|
|
2296
2296
|
size: "sm",
|
|
2297
2297
|
onClick: () => n.stopAnnotating(),
|
|
2298
2298
|
className: "min-h-9 min-w-0 px-4",
|
|
@@ -2305,25 +2305,25 @@ function Ri() {
|
|
|
2305
2305
|
//#endregion
|
|
2306
2306
|
//#region lib/components/ui/media/pdf-reader/partials/header-title.tsx
|
|
2307
2307
|
function zi() {
|
|
2308
|
-
let { t: e, language: t } = j(), { chrome: n, props: r } = Z(), { state: i, bytes: a } = Q(), o = r.file ?
|
|
2308
|
+
let { t: e, language: t } = j(), { chrome: n, props: r } = Z(), { state: i, bytes: a } = Q(), o = r.file ? Zt(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}", {
|
|
2309
2309
|
pages: i.numPages,
|
|
2310
|
-
size:
|
|
2310
|
+
size: Ct(a ?? 0, { locale: t ?? "en" })
|
|
2311
2311
|
}) : "";
|
|
2312
|
-
return /* @__PURE__ */
|
|
2312
|
+
return /* @__PURE__ */ H("div", {
|
|
2313
2313
|
className: "flex min-w-0 flex-1 items-center gap-2.5 px-1.5",
|
|
2314
2314
|
children: [
|
|
2315
|
-
/* @__PURE__ */
|
|
2315
|
+
/* @__PURE__ */ V(Re, {
|
|
2316
2316
|
"aria-hidden": !0,
|
|
2317
2317
|
className: "size-5 shrink-0 text-primary-text"
|
|
2318
2318
|
}),
|
|
2319
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ V("span", {
|
|
2320
2320
|
dir: "auto",
|
|
2321
2321
|
className: "truncate font-semibold text-foreground",
|
|
2322
2322
|
children: o
|
|
2323
2323
|
}),
|
|
2324
|
-
n.size !== "compact" && a !== null && s ? /* @__PURE__ */
|
|
2324
|
+
n.size !== "compact" && a !== null && s ? /* @__PURE__ */ V("span", {
|
|
2325
2325
|
className: "shrink-0 whitespace-nowrap text-muted-foreground text-sm",
|
|
2326
|
-
children: /* @__PURE__ */
|
|
2326
|
+
children: /* @__PURE__ */ V("bdi", { children: s })
|
|
2327
2327
|
}) : null
|
|
2328
2328
|
]
|
|
2329
2329
|
});
|
|
@@ -2333,23 +2333,23 @@ function zi() {
|
|
|
2333
2333
|
function Bi({ action: e }) {
|
|
2334
2334
|
let { t } = j(), { leave: n, toggleFullscreen: r } = Z();
|
|
2335
2335
|
switch (e.kind) {
|
|
2336
|
-
case "back": return /* @__PURE__ */
|
|
2337
|
-
icon: /* @__PURE__ */
|
|
2336
|
+
case "back": return /* @__PURE__ */ V(A, {
|
|
2337
|
+
icon: /* @__PURE__ */ V(Ae, {}),
|
|
2338
2338
|
label: t("material.pdf-reader.next.back", "Back"),
|
|
2339
2339
|
onClick: n
|
|
2340
2340
|
});
|
|
2341
|
-
case "close": return /* @__PURE__ */
|
|
2342
|
-
icon: /* @__PURE__ */
|
|
2341
|
+
case "close": return /* @__PURE__ */ V(A, {
|
|
2342
|
+
icon: /* @__PURE__ */ V(lt, {}),
|
|
2343
2343
|
label: t("material.buttons.close", "Close"),
|
|
2344
2344
|
onClick: n
|
|
2345
2345
|
});
|
|
2346
|
-
case "exit-fullscreen": return /* @__PURE__ */
|
|
2347
|
-
icon: /* @__PURE__ */
|
|
2346
|
+
case "exit-fullscreen": return /* @__PURE__ */ V(A, {
|
|
2347
|
+
icon: /* @__PURE__ */ V(Je, {}),
|
|
2348
2348
|
label: t("material.pdf-reader.exit-fullscreen", "Exit fullscreen"),
|
|
2349
2349
|
onClick: n
|
|
2350
2350
|
});
|
|
2351
|
-
case "fullscreen": return /* @__PURE__ */
|
|
2352
|
-
icon: /* @__PURE__ */
|
|
2351
|
+
case "fullscreen": return /* @__PURE__ */ V(A, {
|
|
2352
|
+
icon: /* @__PURE__ */ V(Ke, {}),
|
|
2353
2353
|
label: t("material.pdf-reader.fullscreen", "Fullscreen"),
|
|
2354
2354
|
onClick: r
|
|
2355
2355
|
});
|
|
@@ -2359,33 +2359,33 @@ function Bi({ action: e }) {
|
|
|
2359
2359
|
//#region lib/components/ui/media/pdf-reader/partials/compact-items.tsx
|
|
2360
2360
|
function Vi() {
|
|
2361
2361
|
let { chromeActions: e } = Z(), t = ai();
|
|
2362
|
-
return /* @__PURE__ */
|
|
2362
|
+
return /* @__PURE__ */ H(B, { children: [oi().filter((e) => e !== "search").map((n) => {
|
|
2363
2363
|
let r = ii[n];
|
|
2364
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ H(x, {
|
|
2365
2365
|
onSelect: () => e.openPanelTab(n),
|
|
2366
|
-
children: [/* @__PURE__ */
|
|
2366
|
+
children: [/* @__PURE__ */ V(r, {}), t[n]]
|
|
2367
2367
|
}, n);
|
|
2368
|
-
}), /* @__PURE__ */
|
|
2368
|
+
}), /* @__PURE__ */ V(y, {})] });
|
|
2369
2369
|
}
|
|
2370
2370
|
function Hi() {
|
|
2371
2371
|
let { t: e } = j(), { actions: t } = Q();
|
|
2372
|
-
return /* @__PURE__ */
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2372
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2373
|
+
/* @__PURE__ */ V(y, {}),
|
|
2374
|
+
/* @__PURE__ */ H(x, {
|
|
2375
2375
|
onSelect: t.zoomIn,
|
|
2376
|
-
children: [/* @__PURE__ */
|
|
2376
|
+
children: [/* @__PURE__ */ V(dt, {}), e("material.pdf-reader.zoom-in", "Zoom in")]
|
|
2377
2377
|
}),
|
|
2378
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ H(x, {
|
|
2379
2379
|
onSelect: t.zoomOut,
|
|
2380
|
-
children: [/* @__PURE__ */
|
|
2380
|
+
children: [/* @__PURE__ */ V(ft, {}), e("material.pdf-reader.zoom-out", "Zoom out")]
|
|
2381
2381
|
}),
|
|
2382
|
-
/* @__PURE__ */
|
|
2382
|
+
/* @__PURE__ */ H(x, {
|
|
2383
2383
|
onSelect: () => t.setFitMode("width"),
|
|
2384
|
-
children: [/* @__PURE__ */
|
|
2384
|
+
children: [/* @__PURE__ */ V(Ze, {}), e("material.pdf-reader.fit-width-full", "Fit Width")]
|
|
2385
2385
|
}),
|
|
2386
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ H(x, {
|
|
2387
2387
|
onSelect: () => t.setFitMode("page"),
|
|
2388
|
-
children: [/* @__PURE__ */
|
|
2388
|
+
children: [/* @__PURE__ */ V(Ke, {}), e("material.pdf-reader.fit-page-full", "Fit Page")]
|
|
2389
2389
|
})
|
|
2390
2390
|
] });
|
|
2391
2391
|
}
|
|
@@ -2397,27 +2397,27 @@ var Ui = [
|
|
|
2397
2397
|
"spread-cover"
|
|
2398
2398
|
];
|
|
2399
2399
|
function Wi() {
|
|
2400
|
-
let { t: e } = j(), { chrome: t, chromeActions: n, layout: r } = Z(), i =
|
|
2400
|
+
let { t: e } = j(), { chrome: t, chromeActions: n, layout: r } = Z(), i = gt(), a = r.narrow ? "single" : t.layout, o = {
|
|
2401
2401
|
single: e("material.pdf-reader.next.layout-single", "Single page"),
|
|
2402
2402
|
spread: e("material.pdf-reader.next.layout-two", "Two pages"),
|
|
2403
2403
|
"spread-cover": e("material.pdf-reader.next.layout-two-cover", "Two pages with cover")
|
|
2404
2404
|
};
|
|
2405
|
-
return /* @__PURE__ */
|
|
2406
|
-
/* @__PURE__ */
|
|
2407
|
-
/* @__PURE__ */
|
|
2405
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2406
|
+
/* @__PURE__ */ V(g, { children: e("material.pdf-reader.next.layout", "Page layout") }),
|
|
2407
|
+
/* @__PURE__ */ V(m, {
|
|
2408
2408
|
value: a,
|
|
2409
2409
|
"aria-label": e("material.pdf-reader.next.layout", "Page layout"),
|
|
2410
2410
|
onValueChange: (e) => {
|
|
2411
2411
|
e !== a && n.setLayout(e);
|
|
2412
2412
|
},
|
|
2413
|
-
children: Ui.map((e) => /* @__PURE__ */
|
|
2413
|
+
children: Ui.map((e) => /* @__PURE__ */ V(h, {
|
|
2414
2414
|
value: e,
|
|
2415
2415
|
disabled: r.narrow && e !== "single",
|
|
2416
2416
|
"aria-describedby": r.narrow ? i : void 0,
|
|
2417
2417
|
children: o[e]
|
|
2418
2418
|
}, e))
|
|
2419
2419
|
}),
|
|
2420
|
-
r.narrow ? /* @__PURE__ */
|
|
2420
|
+
r.narrow ? /* @__PURE__ */ V(g, {
|
|
2421
2421
|
id: i,
|
|
2422
2422
|
className: "pt-0 font-normal text-muted-foreground text-xs",
|
|
2423
2423
|
children: e("material.pdf-reader.next.layout-narrow", "Two pages need a wider window")
|
|
@@ -2427,55 +2427,55 @@ function Wi() {
|
|
|
2427
2427
|
//#endregion
|
|
2428
2428
|
//#region lib/components/ui/media/pdf-reader/partials/more-menu.tsx
|
|
2429
2429
|
function Gi() {
|
|
2430
|
-
let { t: e } = j(), t = $(), { chrome: n, mode: r, openSearch: i, props: a } = Z(), { state: o, actions: s, fileActions:
|
|
2431
|
-
return /* @__PURE__ */
|
|
2430
|
+
let { t: e } = j(), t = $(), { chrome: n, mode: r, openSearch: i, props: a } = Z(), { state: o, actions: s, fileActions: l } = Q(), u = c(), d = n.size === "compact", f = r === "fullscreen";
|
|
2431
|
+
return /* @__PURE__ */ H(b, {
|
|
2432
2432
|
modal: !1,
|
|
2433
|
-
children: [/* @__PURE__ */
|
|
2433
|
+
children: [/* @__PURE__ */ V(p, {
|
|
2434
2434
|
asChild: !0,
|
|
2435
2435
|
className: t.selectedLook === "morph" ? "rounded-[var(--c-ss)] focus:bg-(--m-bg) hover:bg-(--m-bg)" : void 0,
|
|
2436
|
-
children: /* @__PURE__ */
|
|
2437
|
-
icon: /* @__PURE__ */
|
|
2436
|
+
children: /* @__PURE__ */ V(A, {
|
|
2437
|
+
icon: /* @__PURE__ */ V(Ye, {}),
|
|
2438
2438
|
label: e("material.toolbar.more", "More")
|
|
2439
2439
|
})
|
|
2440
|
-
}), /* @__PURE__ */
|
|
2440
|
+
}), /* @__PURE__ */ H(v, {
|
|
2441
2441
|
align: "end",
|
|
2442
|
-
container:
|
|
2442
|
+
container: u,
|
|
2443
2443
|
className: "min-w-52",
|
|
2444
2444
|
children: [
|
|
2445
|
-
f ? /* @__PURE__ */
|
|
2445
|
+
f ? /* @__PURE__ */ H(x, {
|
|
2446
2446
|
onSelect: i,
|
|
2447
|
-
children: [/* @__PURE__ */
|
|
2447
|
+
children: [/* @__PURE__ */ V(rt, {}), e("material.pdf-reader.search", "Search")]
|
|
2448
2448
|
}) : null,
|
|
2449
|
-
d ? /* @__PURE__ */
|
|
2450
|
-
/* @__PURE__ */
|
|
2449
|
+
d ? /* @__PURE__ */ V(Vi, {}) : null,
|
|
2450
|
+
/* @__PURE__ */ H(x, {
|
|
2451
2451
|
onSelect: s.rotate,
|
|
2452
|
-
children: [/* @__PURE__ */
|
|
2452
|
+
children: [/* @__PURE__ */ V(nt, {}), e("material.pdf-reader.rotate", "Rotate")]
|
|
2453
2453
|
}),
|
|
2454
|
-
/* @__PURE__ */
|
|
2455
|
-
onSelect:
|
|
2456
|
-
children: [/* @__PURE__ */
|
|
2454
|
+
/* @__PURE__ */ H(x, {
|
|
2455
|
+
onSelect: l.print,
|
|
2456
|
+
children: [/* @__PURE__ */ V(tt, {}), e("material.pdf-reader.print", "Print")]
|
|
2457
2457
|
}),
|
|
2458
|
-
d || f ? /* @__PURE__ */
|
|
2459
|
-
onSelect:
|
|
2460
|
-
children: [/* @__PURE__ */
|
|
2458
|
+
d || f ? /* @__PURE__ */ H(x, {
|
|
2459
|
+
onSelect: l.download,
|
|
2460
|
+
children: [/* @__PURE__ */ V(Ie, {}), e("material.pdf-reader.download", "Download")]
|
|
2461
2461
|
}) : null,
|
|
2462
|
-
/* @__PURE__ */
|
|
2462
|
+
/* @__PURE__ */ V(_, {
|
|
2463
2463
|
checked: o.nightMode,
|
|
2464
2464
|
onCheckedChange: s.toggleNightMode,
|
|
2465
2465
|
children: e("material.pdf-reader.night", "Night mode")
|
|
2466
2466
|
}),
|
|
2467
|
-
d ? /* @__PURE__ */
|
|
2468
|
-
/* @__PURE__ */
|
|
2469
|
-
/* @__PURE__ */
|
|
2470
|
-
a.showUnfinished ? /* @__PURE__ */
|
|
2471
|
-
/* @__PURE__ */
|
|
2472
|
-
/* @__PURE__ */
|
|
2467
|
+
d ? /* @__PURE__ */ V(Hi, {}) : null,
|
|
2468
|
+
/* @__PURE__ */ V(y, {}),
|
|
2469
|
+
/* @__PURE__ */ V(Wi, {}),
|
|
2470
|
+
a.showUnfinished ? /* @__PURE__ */ H(B, { children: [
|
|
2471
|
+
/* @__PURE__ */ V(y, {}),
|
|
2472
|
+
/* @__PURE__ */ H(x, {
|
|
2473
2473
|
disabled: !0,
|
|
2474
|
-
children: [/* @__PURE__ */
|
|
2474
|
+
children: [/* @__PURE__ */ V(ct, {}), e("material.pdf-reader.next.read-aloud", "Read aloud")]
|
|
2475
2475
|
}),
|
|
2476
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ H(x, {
|
|
2477
2477
|
disabled: !0,
|
|
2478
|
-
children: [/* @__PURE__ */
|
|
2478
|
+
children: [/* @__PURE__ */ V(je, {}), e("material.pdf-reader.next.reflow", "Reflowed text")]
|
|
2479
2479
|
})
|
|
2480
2480
|
] }) : null
|
|
2481
2481
|
]
|
|
@@ -2486,65 +2486,65 @@ function Gi() {
|
|
|
2486
2486
|
//#region lib/components/ui/media/pdf-reader/partials/search-header.tsx
|
|
2487
2487
|
function Ki() {
|
|
2488
2488
|
let { t: e } = j(), t = $(), { chromeActions: n } = Z();
|
|
2489
|
-
return /* @__PURE__ */
|
|
2489
|
+
return /* @__PURE__ */ H(O, {
|
|
2490
2490
|
label: e("material.pdf-reader.search", "Search"),
|
|
2491
2491
|
variant: "docked",
|
|
2492
2492
|
...t,
|
|
2493
2493
|
className: "shrink-0 border-b border-border",
|
|
2494
|
-
children: [/* @__PURE__ */
|
|
2495
|
-
icon: /* @__PURE__ */
|
|
2494
|
+
children: [/* @__PURE__ */ V(A, {
|
|
2495
|
+
icon: /* @__PURE__ */ V(Ae, {}),
|
|
2496
2496
|
label: e("material.pdf-reader.next.search-close", "Close search"),
|
|
2497
2497
|
onClick: () => n.closeSearchField()
|
|
2498
|
-
}), /* @__PURE__ */
|
|
2498
|
+
}), /* @__PURE__ */ V(Pr, {})]
|
|
2499
2499
|
});
|
|
2500
2500
|
}
|
|
2501
2501
|
//#endregion
|
|
2502
2502
|
//#region lib/components/ui/media/pdf-reader/partials/header.tsx
|
|
2503
2503
|
function qi() {
|
|
2504
|
-
let { chrome: e } = Z(), t =
|
|
2505
|
-
return
|
|
2504
|
+
let { chrome: e } = Z(), t = _r.selectHeaderKind(e);
|
|
2505
|
+
return V(t === "annotate" ? Ri : t === "search" ? Ki : Ji, {});
|
|
2506
2506
|
}
|
|
2507
2507
|
function Ji() {
|
|
2508
2508
|
let { t: e } = j(), t = $(), { chrome: n, mode: r, props: i, openSearch: a } = Z(), { fileActions: o } = Q(), s = n.size === "compact", c = Li(), l = Fi(r, n.size, i.allowFullscreen !== !1 && c);
|
|
2509
|
-
return /* @__PURE__ */
|
|
2509
|
+
return /* @__PURE__ */ H(O, {
|
|
2510
2510
|
label: e("material.pdf-reader.next.header", "Document actions"),
|
|
2511
2511
|
variant: "docked",
|
|
2512
2512
|
...t,
|
|
2513
2513
|
className: "shrink-0 border-b border-border",
|
|
2514
2514
|
children: [
|
|
2515
|
-
l?.place === "start" ? /* @__PURE__ */
|
|
2516
|
-
/* @__PURE__ */
|
|
2517
|
-
/* @__PURE__ */
|
|
2518
|
-
icon: /* @__PURE__ */
|
|
2515
|
+
l?.place === "start" ? /* @__PURE__ */ V(Bi, { action: l }) : null,
|
|
2516
|
+
/* @__PURE__ */ V(zi, {}),
|
|
2517
|
+
/* @__PURE__ */ V(A, {
|
|
2518
|
+
icon: /* @__PURE__ */ V(rt, {}),
|
|
2519
2519
|
label: e("material.pdf-reader.search", "Search"),
|
|
2520
2520
|
onClick: a,
|
|
2521
2521
|
"data-focus-target": "search"
|
|
2522
2522
|
}),
|
|
2523
|
-
s ? null : /* @__PURE__ */
|
|
2524
|
-
icon: /* @__PURE__ */
|
|
2523
|
+
s ? null : /* @__PURE__ */ V(A, {
|
|
2524
|
+
icon: /* @__PURE__ */ V(Ie, {}),
|
|
2525
2525
|
label: e("material.pdf-reader.download", "Download"),
|
|
2526
2526
|
onClick: o.download
|
|
2527
2527
|
}),
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
l?.place === "end" ? /* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ V(Gi, {}),
|
|
2529
|
+
l?.place === "end" ? /* @__PURE__ */ V(Bi, { action: l }) : null
|
|
2530
2530
|
]
|
|
2531
2531
|
});
|
|
2532
2532
|
}
|
|
2533
2533
|
//#endregion
|
|
2534
2534
|
//#region lib/components/ui/media/pdf-reader/use-pill-visibility.ts
|
|
2535
2535
|
function Yi(e, t, n) {
|
|
2536
|
-
let r =
|
|
2537
|
-
|
|
2536
|
+
let r = R(null);
|
|
2537
|
+
I(() => {
|
|
2538
2538
|
r.current = e.current?.querySelector("[data-slot=\"scroll-area-viewport\"]") ?? null;
|
|
2539
2539
|
});
|
|
2540
|
-
let i =
|
|
2541
|
-
return
|
|
2540
|
+
let i = ke(r), [a, o] = z(!1);
|
|
2541
|
+
return F(() => {
|
|
2542
2542
|
i || o(!1);
|
|
2543
|
-
}, [i]),
|
|
2543
|
+
}, [i]), F(() => {
|
|
2544
2544
|
let e = t.current;
|
|
2545
2545
|
if (!e || !i) return;
|
|
2546
2546
|
let n = (e) => {
|
|
2547
|
-
e.key === "Tab" &&
|
|
2547
|
+
e.key === "Tab" && yt(() => o(!0));
|
|
2548
2548
|
};
|
|
2549
2549
|
return e.addEventListener("keydown", n, !0), () => e.removeEventListener("keydown", n, !0);
|
|
2550
2550
|
}, [t, i]), i && !a && !n;
|
|
@@ -2558,13 +2558,13 @@ var Xi = {
|
|
|
2558
2558
|
pink: "bg-pink-400",
|
|
2559
2559
|
red: "bg-red-500"
|
|
2560
2560
|
}, Zi = "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))", Qi = {
|
|
2561
|
-
pointer: /* @__PURE__ */
|
|
2562
|
-
highlight: /* @__PURE__ */
|
|
2563
|
-
underline: /* @__PURE__ */
|
|
2564
|
-
pen: /* @__PURE__ */
|
|
2565
|
-
note: /* @__PURE__ */
|
|
2566
|
-
text: /* @__PURE__ */
|
|
2567
|
-
eraser: /* @__PURE__ */
|
|
2561
|
+
pointer: /* @__PURE__ */ V(Xe, {}),
|
|
2562
|
+
highlight: /* @__PURE__ */ V(Ve, {}),
|
|
2563
|
+
underline: /* @__PURE__ */ V(ot, {}),
|
|
2564
|
+
pen: /* @__PURE__ */ V($e, {}),
|
|
2565
|
+
note: /* @__PURE__ */ V(it, {}),
|
|
2566
|
+
text: /* @__PURE__ */ V(at, {}),
|
|
2567
|
+
eraser: /* @__PURE__ */ V(Le, {})
|
|
2568
2568
|
}, $i = [
|
|
2569
2569
|
"highlight",
|
|
2570
2570
|
"pen",
|
|
@@ -2600,49 +2600,49 @@ function ta() {
|
|
|
2600
2600
|
};
|
|
2601
2601
|
}
|
|
2602
2602
|
function na() {
|
|
2603
|
-
let { t: e } = j(), { chrome: t, chromeActions: r } = Z(), i =
|
|
2603
|
+
let { t: e } = j(), { chrome: t, chromeActions: r } = Z(), i = c(), a = ta(), o = t.size === "compact" ? $i : ea, s = e("material.pdf-reader.next.color", "Colour: {color}", { color: a.color[t.color] }), l = (e) => /* @__PURE__ */ V(Un, {
|
|
2604
2604
|
value: e,
|
|
2605
2605
|
icon: Qi[e],
|
|
2606
2606
|
label: a.tool[e]
|
|
2607
2607
|
}, e);
|
|
2608
|
-
return /* @__PURE__ */
|
|
2609
|
-
/* @__PURE__ */
|
|
2608
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2609
|
+
/* @__PURE__ */ H(Hn, {
|
|
2610
2610
|
type: "single",
|
|
2611
2611
|
label: e("material.pdf-reader.next.tools", "Annotation tools"),
|
|
2612
2612
|
value: t.tool,
|
|
2613
2613
|
onValueChange: (e) => r.setTool(e),
|
|
2614
2614
|
children: [
|
|
2615
|
-
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
o.map(
|
|
2615
|
+
l("pointer"),
|
|
2616
|
+
/* @__PURE__ */ V(k, {}),
|
|
2617
|
+
o.map(l)
|
|
2618
2618
|
]
|
|
2619
2619
|
}),
|
|
2620
|
-
/* @__PURE__ */
|
|
2621
|
-
/* @__PURE__ */
|
|
2620
|
+
/* @__PURE__ */ V(k, {}),
|
|
2621
|
+
/* @__PURE__ */ H(b, {
|
|
2622
2622
|
modal: !1,
|
|
2623
|
-
children: [/* @__PURE__ */
|
|
2623
|
+
children: [/* @__PURE__ */ V(D, {
|
|
2624
2624
|
label: s,
|
|
2625
|
-
children: /* @__PURE__ */
|
|
2625
|
+
children: /* @__PURE__ */ V(p, {
|
|
2626
2626
|
asChild: !0,
|
|
2627
|
-
children: /* @__PURE__ */
|
|
2627
|
+
children: /* @__PURE__ */ V("button", {
|
|
2628
2628
|
type: "button",
|
|
2629
2629
|
"aria-label": s,
|
|
2630
2630
|
className: Zi,
|
|
2631
|
-
children: /* @__PURE__ */
|
|
2631
|
+
children: /* @__PURE__ */ V("span", {
|
|
2632
2632
|
"aria-hidden": !0,
|
|
2633
2633
|
className: n("size-[18px] rounded-full ring-2 ring-foreground/30", Xi[t.color])
|
|
2634
2634
|
})
|
|
2635
2635
|
})
|
|
2636
2636
|
})
|
|
2637
|
-
}), /* @__PURE__ */
|
|
2637
|
+
}), /* @__PURE__ */ V(v, {
|
|
2638
2638
|
container: i,
|
|
2639
2639
|
className: "min-w-36",
|
|
2640
|
-
children: /* @__PURE__ */
|
|
2640
|
+
children: /* @__PURE__ */ V(m, {
|
|
2641
2641
|
value: t.color,
|
|
2642
2642
|
onValueChange: (e) => r.setColor(e),
|
|
2643
|
-
children: ni.map((e) => /* @__PURE__ */
|
|
2643
|
+
children: ni.map((e) => /* @__PURE__ */ H(h, {
|
|
2644
2644
|
value: e,
|
|
2645
|
-
children: [/* @__PURE__ */
|
|
2645
|
+
children: [/* @__PURE__ */ V("span", {
|
|
2646
2646
|
"aria-hidden": !0,
|
|
2647
2647
|
className: n("size-3.5 rounded-full", Xi[e])
|
|
2648
2648
|
}), a.color[e]]
|
|
@@ -2655,18 +2655,18 @@ function na() {
|
|
|
2655
2655
|
//#endregion
|
|
2656
2656
|
//#region lib/components/ui/media/pdf-reader/partials/page-field.tsx
|
|
2657
2657
|
function ra() {
|
|
2658
|
-
let { t: e } = j(), { state: t, actions: n } = Q(), [r, i] =
|
|
2658
|
+
let { t: e } = j(), { state: t, actions: n } = Q(), [r, i] = z(null), a = r ?? String(t.currentPage), o = () => {
|
|
2659
2659
|
let e = Number.parseInt(r ?? "", 10);
|
|
2660
2660
|
Number.isFinite(e) && n.goToPage(e), i(null);
|
|
2661
2661
|
};
|
|
2662
|
-
return /* @__PURE__ */
|
|
2662
|
+
return /* @__PURE__ */ H(_e, {
|
|
2663
2663
|
label: e("material.pdf-reader.next.page-group", "Page"),
|
|
2664
2664
|
priority: "pinned",
|
|
2665
2665
|
dir: "ltr",
|
|
2666
2666
|
className: "gap-1.5 px-1.5 text-sm",
|
|
2667
|
-
children: [/* @__PURE__ */
|
|
2667
|
+
children: [/* @__PURE__ */ V(D, {
|
|
2668
2668
|
label: e("material.pdf-reader.next.page-go", "Go to page"),
|
|
2669
|
-
children: /* @__PURE__ */
|
|
2669
|
+
children: /* @__PURE__ */ V("input", {
|
|
2670
2670
|
type: "text",
|
|
2671
2671
|
inputMode: "numeric",
|
|
2672
2672
|
pattern: "[0-9]*",
|
|
@@ -2681,7 +2681,7 @@ function ra() {
|
|
|
2681
2681
|
onBlur: () => i(null),
|
|
2682
2682
|
className: "h-8 min-w-9 rounded-full bg-foreground/[0.07] px-2 text-center font-semibold text-foreground tabular-nums outline-0 [field-sizing:content] focus-visible:outline-2 focus-visible:outline-primary-text"
|
|
2683
2683
|
})
|
|
2684
|
-
}), /* @__PURE__ */
|
|
2684
|
+
}), /* @__PURE__ */ V("span", {
|
|
2685
2685
|
"aria-hidden": !0,
|
|
2686
2686
|
className: "text-muted-foreground tabular-nums",
|
|
2687
2687
|
children: e("material.pdf-reader.next.page-total", "/ {total}", { total: t.numPages })
|
|
@@ -2699,44 +2699,44 @@ var ia = [
|
|
|
2699
2699
|
2
|
|
2700
2700
|
];
|
|
2701
2701
|
function aa() {
|
|
2702
|
-
let { t: e, language: t } = j(), { state: n, actions: r, scale: i, limits: a } = Q(), o =
|
|
2703
|
-
return /* @__PURE__ */
|
|
2704
|
-
/* @__PURE__ */
|
|
2705
|
-
icon: /* @__PURE__ */
|
|
2702
|
+
let { t: e, language: t } = j(), { state: n, actions: r, scale: i, limits: a } = Q(), o = c(), s = (e) => Or(e, t ?? "en"), l = n.fitMode === "custom" ? String(n.scale) : n.fitMode, u = (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) });
|
|
2703
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2704
|
+
/* @__PURE__ */ V(A, {
|
|
2705
|
+
icon: /* @__PURE__ */ V(ft, {}),
|
|
2706
2706
|
label: e("material.pdf-reader.zoom-out", "Zoom out"),
|
|
2707
2707
|
disabled: i <= a.minScale,
|
|
2708
2708
|
onClick: r.zoomOut
|
|
2709
2709
|
}),
|
|
2710
|
-
/* @__PURE__ */
|
|
2710
|
+
/* @__PURE__ */ H(b, {
|
|
2711
2711
|
modal: !1,
|
|
2712
|
-
children: [/* @__PURE__ */
|
|
2712
|
+
children: [/* @__PURE__ */ V(D, {
|
|
2713
2713
|
label: d,
|
|
2714
|
-
children: /* @__PURE__ */
|
|
2714
|
+
children: /* @__PURE__ */ V(p, {
|
|
2715
2715
|
asChild: !0,
|
|
2716
|
-
children: /* @__PURE__ */
|
|
2716
|
+
children: /* @__PURE__ */ V("button", {
|
|
2717
2717
|
type: "button",
|
|
2718
2718
|
"aria-label": d,
|
|
2719
2719
|
className: Zi,
|
|
2720
2720
|
children: s(i)
|
|
2721
2721
|
})
|
|
2722
2722
|
})
|
|
2723
|
-
}), /* @__PURE__ */
|
|
2723
|
+
}), /* @__PURE__ */ V(v, {
|
|
2724
2724
|
container: o,
|
|
2725
2725
|
className: "min-w-36",
|
|
2726
|
-
children: /* @__PURE__ */
|
|
2727
|
-
value:
|
|
2728
|
-
onValueChange:
|
|
2726
|
+
children: /* @__PURE__ */ H(m, {
|
|
2727
|
+
value: l,
|
|
2728
|
+
onValueChange: u,
|
|
2729
2729
|
children: [
|
|
2730
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ V(h, {
|
|
2731
2731
|
value: "width",
|
|
2732
2732
|
children: e("material.pdf-reader.fit-width-full", "Fit Width")
|
|
2733
2733
|
}),
|
|
2734
|
-
/* @__PURE__ */
|
|
2734
|
+
/* @__PURE__ */ V(h, {
|
|
2735
2735
|
value: "page",
|
|
2736
2736
|
children: e("material.pdf-reader.fit-page-full", "Fit Page")
|
|
2737
2737
|
}),
|
|
2738
|
-
/* @__PURE__ */
|
|
2739
|
-
ia.map((e) => /* @__PURE__ */
|
|
2738
|
+
/* @__PURE__ */ V(y, {}),
|
|
2739
|
+
ia.map((e) => /* @__PURE__ */ V(h, {
|
|
2740
2740
|
value: String(e),
|
|
2741
2741
|
children: s(e)
|
|
2742
2742
|
}, e))
|
|
@@ -2744,8 +2744,8 @@ function aa() {
|
|
|
2744
2744
|
})
|
|
2745
2745
|
})]
|
|
2746
2746
|
}),
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
icon: /* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ V(A, {
|
|
2748
|
+
icon: /* @__PURE__ */ V(dt, {}),
|
|
2749
2749
|
label: e("material.pdf-reader.zoom-in", "Zoom in"),
|
|
2750
2750
|
disabled: i >= a.maxScale,
|
|
2751
2751
|
onClick: r.zoomIn
|
|
@@ -2756,18 +2756,18 @@ function aa() {
|
|
|
2756
2756
|
//#region lib/components/ui/media/pdf-reader/partials/pill-nav.tsx
|
|
2757
2757
|
function oa() {
|
|
2758
2758
|
let { t: e } = j(), { chrome: t, chromeActions: n, props: r, mode: i } = Z(), { state: a, actions: o, rowStarts: s } = Q(), { size: c } = t;
|
|
2759
|
-
return /* @__PURE__ */
|
|
2760
|
-
c === "medium" ? /* @__PURE__ */
|
|
2761
|
-
icon: /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2760
|
+
c === "medium" ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(ge, {
|
|
2761
|
+
icon: /* @__PURE__ */ V(Qe, {
|
|
2762
2762
|
"aria-hidden": !0,
|
|
2763
2763
|
className: "rtl:-scale-x-100"
|
|
2764
2764
|
}),
|
|
2765
2765
|
label: e("material.pdf-reader.next.panel-toggle", "Panel"),
|
|
2766
2766
|
pressed: t.panelOpen,
|
|
2767
2767
|
onPressedChange: () => n.togglePanel()
|
|
2768
|
-
}), /* @__PURE__ */
|
|
2769
|
-
/* @__PURE__ */
|
|
2770
|
-
icon: /* @__PURE__ */
|
|
2768
|
+
}), /* @__PURE__ */ V(k, {})] }) : null,
|
|
2769
|
+
/* @__PURE__ */ V(A, {
|
|
2770
|
+
icon: /* @__PURE__ */ V(Ne, {
|
|
2771
2771
|
"aria-hidden": !0,
|
|
2772
2772
|
className: "rtl:rotate-180"
|
|
2773
2773
|
}),
|
|
@@ -2775,9 +2775,9 @@ function oa() {
|
|
|
2775
2775
|
disabled: Rr(s, a.currentPage, -1) === null,
|
|
2776
2776
|
onClick: o.prevPage
|
|
2777
2777
|
}),
|
|
2778
|
-
/* @__PURE__ */
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
icon: /* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ V(ra, {}),
|
|
2779
|
+
/* @__PURE__ */ V(A, {
|
|
2780
|
+
icon: /* @__PURE__ */ V(Pe, {
|
|
2781
2781
|
"aria-hidden": !0,
|
|
2782
2782
|
className: "rtl:rotate-180"
|
|
2783
2783
|
}),
|
|
@@ -2785,23 +2785,23 @@ function oa() {
|
|
|
2785
2785
|
disabled: Rr(s, a.currentPage, 1) === null,
|
|
2786
2786
|
onClick: o.nextPage
|
|
2787
2787
|
}),
|
|
2788
|
-
c === "compact" ? null : /* @__PURE__ */
|
|
2789
|
-
r.annotate ? /* @__PURE__ */
|
|
2790
|
-
icon: /* @__PURE__ */
|
|
2788
|
+
c === "compact" ? null : /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(k, {}), /* @__PURE__ */ V(aa, {})] }),
|
|
2789
|
+
r.annotate ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(k, {}), /* @__PURE__ */ V(A, {
|
|
2790
|
+
icon: /* @__PURE__ */ V(et, {}),
|
|
2791
2791
|
label: e("material.pdf-reader.next.annotate", "Annotate"),
|
|
2792
2792
|
onClick: () => n.startAnnotating(),
|
|
2793
2793
|
"data-focus-target": "annotate"
|
|
2794
2794
|
})] }) : null,
|
|
2795
|
-
i === "fullscreen" ? /* @__PURE__ */
|
|
2795
|
+
i === "fullscreen" ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(k, {}), /* @__PURE__ */ V(Gi, {})] }) : null
|
|
2796
2796
|
] });
|
|
2797
2797
|
}
|
|
2798
2798
|
//#endregion
|
|
2799
2799
|
//#region lib/components/ui/media/pdf-reader/partials/pill.tsx
|
|
2800
2800
|
function sa() {
|
|
2801
2801
|
let { t: e } = j(), t = $(), { chrome: n, frameRef: r } = Z(), { state: i, containerRef: a } = Q(), o = Yi(a, r, n.annotating);
|
|
2802
|
-
return i.numPages === 0 ? null : /* @__PURE__ */
|
|
2802
|
+
return i.numPages === 0 ? null : /* @__PURE__ */ V("div", {
|
|
2803
2803
|
className: "pointer-events-none absolute inset-x-0 bottom-4 z-10 flex justify-center px-4",
|
|
2804
|
-
children: /* @__PURE__ */
|
|
2804
|
+
children: /* @__PURE__ */ V(O, {
|
|
2805
2805
|
label: n.annotating ? e("material.pdf-reader.next.tools", "Annotation tools") : e("material.pdf-reader.next.pill", "Reader controls"),
|
|
2806
2806
|
...t,
|
|
2807
2807
|
density: n.annotating && n.size === "compact" && t.density ? "compact" : t.density,
|
|
@@ -2809,30 +2809,30 @@ function sa() {
|
|
|
2809
2809
|
hidden: o,
|
|
2810
2810
|
className: "pointer-events-auto",
|
|
2811
2811
|
"data-focus-target": "pill",
|
|
2812
|
-
children: n.annotating ? /* @__PURE__ */
|
|
2812
|
+
children: n.annotating ? /* @__PURE__ */ V(na, {}) : /* @__PURE__ */ V(oa, {})
|
|
2813
2813
|
})
|
|
2814
2814
|
});
|
|
2815
2815
|
}
|
|
2816
2816
|
//#endregion
|
|
2817
2817
|
//#region lib/components/ui/media/pdf-reader/partials/rail.tsx
|
|
2818
2818
|
function ca() {
|
|
2819
|
-
let { t: e } = j(), { chrome: t, chromeActions: n } = Z(), r = ai(), i = oi(), a =
|
|
2820
|
-
return /* @__PURE__ */
|
|
2819
|
+
let { t: e } = j(), { chrome: t, chromeActions: n } = Z(), r = ai(), i = oi(), a = _r.selectRailValue(t), o = $();
|
|
2820
|
+
return /* @__PURE__ */ V(O, {
|
|
2821
2821
|
label: e("material.pdf-reader.next.rail", "Document views"),
|
|
2822
2822
|
variant: "docked",
|
|
2823
2823
|
orientation: "vertical",
|
|
2824
2824
|
...o,
|
|
2825
2825
|
className: "h-auto w-14 shrink-0 self-stretch border-e border-border",
|
|
2826
|
-
children: /* @__PURE__ */
|
|
2826
|
+
children: /* @__PURE__ */ V(Hn, {
|
|
2827
2827
|
type: "single",
|
|
2828
2828
|
label: e("material.pdf-reader.next.panel-views", "Panel views"),
|
|
2829
2829
|
value: a,
|
|
2830
2830
|
onValueChange: (e) => n.openPanelTab(e),
|
|
2831
2831
|
children: i.map((e) => {
|
|
2832
2832
|
let t = ii[e];
|
|
2833
|
-
return /* @__PURE__ */
|
|
2833
|
+
return /* @__PURE__ */ V(Un, {
|
|
2834
2834
|
value: e,
|
|
2835
|
-
icon: /* @__PURE__ */
|
|
2835
|
+
icon: /* @__PURE__ */ V(t, {}),
|
|
2836
2836
|
label: r[e],
|
|
2837
2837
|
onClick: () => {
|
|
2838
2838
|
e === a && n.closePanel();
|
|
@@ -2847,8 +2847,8 @@ function ca() {
|
|
|
2847
2847
|
function la() {
|
|
2848
2848
|
let { t: e } = j(), { chrome: t, chromeActions: r, frameRef: i, mode: a, props: o } = Z();
|
|
2849
2849
|
Sr(i, r.setSize), Cr(i, t);
|
|
2850
|
-
let s = a === "fullscreen" &&
|
|
2851
|
-
return /* @__PURE__ */
|
|
2850
|
+
let s = a === "fullscreen" && _r.selectHeaderKind(t) === "default", c = Dr();
|
|
2851
|
+
return /* @__PURE__ */ H("section", {
|
|
2852
2852
|
ref: i,
|
|
2853
2853
|
"data-slot": "pdf-reader",
|
|
2854
2854
|
"data-mode": a,
|
|
@@ -2857,17 +2857,17 @@ function la() {
|
|
|
2857
2857
|
onKeyDown: c,
|
|
2858
2858
|
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),
|
|
2859
2859
|
children: [
|
|
2860
|
-
s ? null : /* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2860
|
+
s ? null : /* @__PURE__ */ V(qi, {}),
|
|
2861
|
+
/* @__PURE__ */ H("div", {
|
|
2862
2862
|
className: "relative flex min-h-0 flex-1",
|
|
2863
2863
|
children: [
|
|
2864
|
-
s ? /* @__PURE__ */
|
|
2865
|
-
t.size === "expanded" ? /* @__PURE__ */
|
|
2866
|
-
/* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
2864
|
+
s ? /* @__PURE__ */ V(Pi, {}) : null,
|
|
2865
|
+
t.size === "expanded" ? /* @__PURE__ */ V(ca, {}) : null,
|
|
2866
|
+
/* @__PURE__ */ V(Ni, {}),
|
|
2867
|
+
/* @__PURE__ */ V(sa, {})
|
|
2868
2868
|
]
|
|
2869
2869
|
}),
|
|
2870
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ V(kr, {})
|
|
2871
2871
|
]
|
|
2872
2872
|
});
|
|
2873
2873
|
}
|
|
@@ -2886,21 +2886,21 @@ function da({ file: e, fileName: t, pdfRef: n, onDownload: r, onPrint: i }) {
|
|
|
2886
2886
|
let { t: a } = j(), o = () => n.current?.getData?.();
|
|
2887
2887
|
return {
|
|
2888
2888
|
download: r ?? (() => {
|
|
2889
|
-
e &&
|
|
2889
|
+
e && Qt(e, {
|
|
2890
2890
|
fileName: t,
|
|
2891
2891
|
getData: o,
|
|
2892
2892
|
defaultName: a("material.pdf-reader.default-file-name", "document")
|
|
2893
2893
|
});
|
|
2894
2894
|
}),
|
|
2895
2895
|
print: i ?? (() => {
|
|
2896
|
-
e &&
|
|
2896
|
+
e && $t(e, { getData: o });
|
|
2897
2897
|
})
|
|
2898
2898
|
};
|
|
2899
2899
|
}
|
|
2900
2900
|
//#endregion
|
|
2901
2901
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-outline-select.ts
|
|
2902
2902
|
function fa(e, t) {
|
|
2903
|
-
return
|
|
2903
|
+
return P(async (n) => {
|
|
2904
2904
|
let r = e.current;
|
|
2905
2905
|
if (!(!r || n.dest == null)) try {
|
|
2906
2906
|
let e = typeof n.dest == "string" ? await r.getDestination(n.dest) : n.dest, i = Array.isArray(e) ? e[0] : e;
|
|
@@ -3102,7 +3102,7 @@ function xa(e, t) {
|
|
|
3102
3102
|
//#endregion
|
|
3103
3103
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-computed-scale.ts
|
|
3104
3104
|
function Sa(e) {
|
|
3105
|
-
return
|
|
3105
|
+
return P(() => e.fitMode === "custom" ? e.scale : Wt(e.fitMode, e.pageSizes ?? [], e.rotation, {
|
|
3106
3106
|
width: e.containerWidth,
|
|
3107
3107
|
height: e.containerHeight ?? 600
|
|
3108
3108
|
}), [
|
|
@@ -3117,7 +3117,7 @@ function Sa(e) {
|
|
|
3117
3117
|
//#endregion
|
|
3118
3118
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-page-area.ts
|
|
3119
3119
|
function Ca(e, t, n) {
|
|
3120
|
-
|
|
3120
|
+
F(() => {
|
|
3121
3121
|
let r = e.current;
|
|
3122
3122
|
if (!r || !t) return;
|
|
3123
3123
|
let i = new ResizeObserver((e) => {
|
|
@@ -3136,7 +3136,7 @@ function Ca(e, t, n) {
|
|
|
3136
3136
|
t,
|
|
3137
3137
|
n
|
|
3138
3138
|
]);
|
|
3139
|
-
let [r] =
|
|
3139
|
+
let [r] = z(() => Rt((e) => n({
|
|
3140
3140
|
type: "SET_PAGE_SIZES",
|
|
3141
3141
|
payload: e
|
|
3142
3142
|
})));
|
|
@@ -3145,14 +3145,14 @@ function Ca(e, t, n) {
|
|
|
3145
3145
|
//#endregion
|
|
3146
3146
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-page-report.ts
|
|
3147
3147
|
function wa(e, t, n) {
|
|
3148
|
-
let r =
|
|
3148
|
+
let r = R(e.currentPage), i = P((e) => {
|
|
3149
3149
|
let { state: i, options: a } = n.current, o = ga(e, i.numPages);
|
|
3150
3150
|
o !== i.currentPage && (t({
|
|
3151
3151
|
type: "SET_PAGE",
|
|
3152
3152
|
payload: o
|
|
3153
3153
|
}), r.current = o, a.onPageChange?.(o));
|
|
3154
3154
|
}, [t, n]);
|
|
3155
|
-
return
|
|
3155
|
+
return F(() => {
|
|
3156
3156
|
e.numPages === 0 || e.currentPage === r.current || (r.current = e.currentPage, n.current.options.onPageChange?.(e.currentPage));
|
|
3157
3157
|
}, [
|
|
3158
3158
|
e.currentPage,
|
|
@@ -3163,24 +3163,24 @@ function wa(e, t, n) {
|
|
|
3163
3163
|
//#endregion
|
|
3164
3164
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-reader.ts
|
|
3165
3165
|
function Ta(e) {
|
|
3166
|
-
let [t, n] =
|
|
3167
|
-
|
|
3166
|
+
let [t, n] = _t(ya, e, _a), r = R(null), [i, a] = z(0), o = Ca(r, t.numPages > 0, n);
|
|
3167
|
+
F(() => {
|
|
3168
3168
|
o.reset(), n({
|
|
3169
3169
|
type: "RESET_DOCUMENT",
|
|
3170
3170
|
payload: { page: c.current.options.initialPage ?? 1 }
|
|
3171
3171
|
});
|
|
3172
|
-
}, [
|
|
3173
|
-
let s = Sa(t), c =
|
|
3172
|
+
}, [en(e.file), o]);
|
|
3173
|
+
let s = Sa(t), c = R({
|
|
3174
3174
|
state: t,
|
|
3175
3175
|
options: e
|
|
3176
3176
|
});
|
|
3177
|
-
|
|
3177
|
+
I(() => {
|
|
3178
3178
|
c.current = {
|
|
3179
3179
|
state: t,
|
|
3180
3180
|
options: e
|
|
3181
3181
|
};
|
|
3182
3182
|
});
|
|
3183
|
-
let l = wa(t, n, c), u =
|
|
3183
|
+
let l = wa(t, n, c), u = P((e) => {
|
|
3184
3184
|
let r = t.fitMode === "custom" ? t.scale : s();
|
|
3185
3185
|
n({
|
|
3186
3186
|
type: "SET_SCALE",
|
|
@@ -3223,13 +3223,13 @@ var Ea = {
|
|
|
3223
3223
|
matches: []
|
|
3224
3224
|
};
|
|
3225
3225
|
function Da(e, t, n, r = 150) {
|
|
3226
|
-
let [i, a] =
|
|
3227
|
-
return
|
|
3226
|
+
let [i, a] = z(Ea);
|
|
3227
|
+
return F(() => {
|
|
3228
3228
|
a(Ea);
|
|
3229
3229
|
let i = e.current;
|
|
3230
3230
|
if (!i || n === 0 || !t.trim()) return;
|
|
3231
3231
|
let o = !1, s = setTimeout(() => {
|
|
3232
|
-
|
|
3232
|
+
Jt(i, t, (e) => a((t) => Xt(t, e)), () => o).catch(() => {});
|
|
3233
3233
|
}, r);
|
|
3234
3234
|
return () => {
|
|
3235
3235
|
o = !0, clearTimeout(s);
|
|
@@ -3244,28 +3244,28 @@ function Da(e, t, n, r = 150) {
|
|
|
3244
3244
|
//#endregion
|
|
3245
3245
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-search-hits.ts
|
|
3246
3246
|
function Oa(e) {
|
|
3247
|
-
let { pdfRef: t, query: n, numPages: r, goToPage: i, pageRefs: a, holdScrollSpy: o } = e, s = Da(t, n, r), [c, l] =
|
|
3248
|
-
|
|
3247
|
+
let { pdfRef: t, query: n, numPages: r, goToPage: i, pageRefs: a, holdScrollSpy: o } = e, s = Da(t, n, r), [c, l] = z(-1), u = R(() => {});
|
|
3248
|
+
F(() => {
|
|
3249
3249
|
l(-1), u.current();
|
|
3250
3250
|
}, [
|
|
3251
3251
|
t,
|
|
3252
3252
|
n,
|
|
3253
3253
|
r
|
|
3254
|
-
]),
|
|
3255
|
-
let d =
|
|
3254
|
+
]), F(() => () => u.current(), []);
|
|
3255
|
+
let d = L(() => Array.from(s.matches, (e) => e?.length ?? 0), [s.matches]), f = d.reduce((e, t) => e + t, 0), p = c < 0 ? null : Bt(d, c), m = R({
|
|
3256
3256
|
counts: d,
|
|
3257
3257
|
hitCount: f,
|
|
3258
3258
|
hitIndex: c
|
|
3259
3259
|
});
|
|
3260
|
-
|
|
3260
|
+
I(() => {
|
|
3261
3261
|
m.current = {
|
|
3262
3262
|
counts: d,
|
|
3263
3263
|
hitCount: f,
|
|
3264
3264
|
hitIndex: c
|
|
3265
3265
|
};
|
|
3266
3266
|
});
|
|
3267
|
-
let h =
|
|
3268
|
-
let { counts: t, hitCount: n, hitIndex: r } = m.current, s =
|
|
3267
|
+
let h = P((e) => {
|
|
3268
|
+
let { counts: t, hitCount: n, hitIndex: r } = m.current, s = Yt(r, e, n);
|
|
3269
3269
|
if (s < 0) return {
|
|
3270
3270
|
index: 0,
|
|
3271
3271
|
count: n
|
|
@@ -3274,8 +3274,8 @@ function Oa(e) {
|
|
|
3274
3274
|
...m.current,
|
|
3275
3275
|
hitIndex: s
|
|
3276
3276
|
}, l(s);
|
|
3277
|
-
let c =
|
|
3278
|
-
return c && (i(c.page), u.current(), u.current =
|
|
3277
|
+
let c = Bt(t, s);
|
|
3278
|
+
return c && (i(c.page), u.current(), u.current = Kt(() => a.current?.get(c.page), c.hit, o)), {
|
|
3279
3279
|
index: s,
|
|
3280
3280
|
count: n
|
|
3281
3281
|
};
|
|
@@ -3283,13 +3283,13 @@ function Oa(e) {
|
|
|
3283
3283
|
i,
|
|
3284
3284
|
a,
|
|
3285
3285
|
o
|
|
3286
|
-
]), g =
|
|
3286
|
+
]), g = P(() => l(-1), []), _ = p?.page ?? 0, v = p?.hit ?? -1;
|
|
3287
3287
|
return {
|
|
3288
3288
|
hitIndex: c,
|
|
3289
3289
|
hitCount: f,
|
|
3290
3290
|
jump: h,
|
|
3291
3291
|
reset: g,
|
|
3292
|
-
highlight:
|
|
3292
|
+
highlight: L(() => ({
|
|
3293
3293
|
texts: s.texts,
|
|
3294
3294
|
matches: s.matches,
|
|
3295
3295
|
current: _ ? {
|
|
@@ -3306,9 +3306,9 @@ function Oa(e) {
|
|
|
3306
3306
|
//#endregion
|
|
3307
3307
|
//#region lib/components/ui/media/pdf-reader/engine/open-engine-document.ts
|
|
3308
3308
|
async function ka(e, t, n) {
|
|
3309
|
-
let [r, i] = await Promise.all([bi(),
|
|
3309
|
+
let [r, i] = await Promise.all([bi(), tn(e)]);
|
|
3310
3310
|
if (t.aborted) return null;
|
|
3311
|
-
let a = await
|
|
3311
|
+
let a = await jt(r, i, {
|
|
3312
3312
|
signal: t,
|
|
3313
3313
|
onPassword: n
|
|
3314
3314
|
});
|
|
@@ -3317,39 +3317,39 @@ async function ka(e, t, n) {
|
|
|
3317
3317
|
//#endregion
|
|
3318
3318
|
//#region lib/components/ui/media/pdf-reader/engine/use-engine-document.ts
|
|
3319
3319
|
function Aa(e, t, n) {
|
|
3320
|
-
let r =
|
|
3320
|
+
let r = R({
|
|
3321
3321
|
file: e,
|
|
3322
3322
|
events: n
|
|
3323
3323
|
});
|
|
3324
|
-
|
|
3324
|
+
I(() => {
|
|
3325
3325
|
r.current = {
|
|
3326
3326
|
file: e,
|
|
3327
3327
|
events: n
|
|
3328
3328
|
};
|
|
3329
|
-
}),
|
|
3329
|
+
}), F(() => {
|
|
3330
3330
|
let e = r.current.file;
|
|
3331
3331
|
if (!e) return;
|
|
3332
3332
|
let t = new AbortController(), n;
|
|
3333
3333
|
return (async () => {
|
|
3334
3334
|
n = await ka(e, t.signal, (e, t) => r.current.events.onPassword(e, t === "wrong")) ?? void 0, n && r.current.events.onOpen(n.doc);
|
|
3335
3335
|
})().catch((e) => {
|
|
3336
|
-
t.signal.aborted ||
|
|
3336
|
+
t.signal.aborted || Et(e).kind !== "aborted" && r.current.events.onFail(qr(e));
|
|
3337
3337
|
}), () => {
|
|
3338
3338
|
t.abort(), n?.destroy().catch(() => {}), r.current.events.onClose();
|
|
3339
3339
|
};
|
|
3340
|
-
}, [
|
|
3340
|
+
}, [en(e), t]);
|
|
3341
3341
|
}
|
|
3342
3342
|
//#endregion
|
|
3343
3343
|
//#region lib/components/ui/media/pdf-reader/engine/use-reader-password.ts
|
|
3344
3344
|
function ja() {
|
|
3345
|
-
let [e, t] =
|
|
3345
|
+
let [e, t] = z(""), n = R(null);
|
|
3346
3346
|
return {
|
|
3347
3347
|
input: e,
|
|
3348
3348
|
setInput: t,
|
|
3349
|
-
ask:
|
|
3349
|
+
ask: P((e) => {
|
|
3350
3350
|
n.current = e;
|
|
3351
3351
|
}, []),
|
|
3352
|
-
forget:
|
|
3352
|
+
forget: P(() => {
|
|
3353
3353
|
n.current = null, t("");
|
|
3354
3354
|
}, []),
|
|
3355
3355
|
submit: () => {
|
|
@@ -3360,8 +3360,8 @@ function ja() {
|
|
|
3360
3360
|
//#endregion
|
|
3361
3361
|
//#region lib/components/ui/media/pdf-reader/engine/use-reader-engine.ts
|
|
3362
3362
|
function Ma(e) {
|
|
3363
|
-
let [t, n] =
|
|
3364
|
-
return
|
|
3363
|
+
let [t, n] = z(null);
|
|
3364
|
+
return F(() => {
|
|
3365
3365
|
if (!e) return;
|
|
3366
3366
|
let t = Kr();
|
|
3367
3367
|
return n(t), () => {
|
|
@@ -3370,10 +3370,10 @@ function Ma(e) {
|
|
|
3370
3370
|
}, [e]), t;
|
|
3371
3371
|
}
|
|
3372
3372
|
function Na(e, t) {
|
|
3373
|
-
let { actions: n, handlers: r } = t, [i, a] =
|
|
3373
|
+
let { actions: n, handlers: r } = t, [i, a] = z(null), o = R(null), [s, c] = z(null), l = ja(), u = Ma(i);
|
|
3374
3374
|
return Aa(e, t.reloadKey, {
|
|
3375
3375
|
onOpen: (e) => {
|
|
3376
|
-
o.current = e, a(e), r.onDocumentLoadSuccess(e), e.getOutline().then((e) => n.setOutline(
|
|
3376
|
+
o.current = e, a(e), r.onDocumentLoadSuccess(e), e.getOutline().then((e) => n.setOutline(Ht(e))).catch(() => {}), e.getDownloadInfo().then((e) => c(e.length)).catch(() => c(null));
|
|
3377
3377
|
},
|
|
3378
3378
|
onFail: r.onDocumentLoadError,
|
|
3379
3379
|
onPassword: (e, t) => {
|
|
@@ -3394,11 +3394,11 @@ function Na(e, t) {
|
|
|
3394
3394
|
//#region lib/components/ui/media/pdf-reader/use-announcements.ts
|
|
3395
3395
|
var Pa = 1e3;
|
|
3396
3396
|
function Fa() {
|
|
3397
|
-
let e =
|
|
3397
|
+
let e = R({
|
|
3398
3398
|
page: -Infinity,
|
|
3399
3399
|
zoom: -Infinity
|
|
3400
3400
|
});
|
|
3401
|
-
return
|
|
3401
|
+
return L(() => ({
|
|
3402
3402
|
asked(t, n) {
|
|
3403
3403
|
return (...r) => {
|
|
3404
3404
|
e.current[t] = performance.now(), n(...r);
|
|
@@ -3444,7 +3444,7 @@ function za(e, t = "single") {
|
|
|
3444
3444
|
onPageChange: e.onPageChange,
|
|
3445
3445
|
onLoadSuccess: e.onLoadSuccess,
|
|
3446
3446
|
onLoadError: e.onLoadError
|
|
3447
|
-
}), { state: s, actions: c } = o, l = Na(n, o), { pdfRef: u } = l, d = Fa(), { asked: f } = d, p =
|
|
3447
|
+
}), { state: s, actions: c } = o, l = Na(n, o), { pdfRef: u } = l, d = Fa(), { asked: f } = d, p = L(() => f("page", c.goToPage), [f, c.goToPage]), m = R(/* @__PURE__ */ new Map()), h = R(0), g = Oa({
|
|
3448
3448
|
pdfRef: u,
|
|
3449
3449
|
query: s.searchQuery,
|
|
3450
3450
|
numPages: s.numPages,
|
|
@@ -3459,7 +3459,7 @@ function za(e, t = "single") {
|
|
|
3459
3459
|
pdfRef: u,
|
|
3460
3460
|
onDownload: i,
|
|
3461
3461
|
onPrint: a
|
|
3462
|
-
}), v = fa(u, p), y = Ra(o, t), b =
|
|
3462
|
+
}), v = fa(u, p), y = Ra(o, t), b = L(() => Ft(s.numPages, t), [s.numPages, t]), x = Ia({
|
|
3463
3463
|
reader: o,
|
|
3464
3464
|
announcements: d,
|
|
3465
3465
|
askedPage: p,
|
|
@@ -3485,13 +3485,13 @@ function za(e, t = "single") {
|
|
|
3485
3485
|
//#endregion
|
|
3486
3486
|
//#region lib/components/ui/media/pdf-reader/pdf-reader-provider.tsx
|
|
3487
3487
|
function Ba({ props: e, children: t }) {
|
|
3488
|
-
let [n, r] =
|
|
3488
|
+
let [n, r] = Ee(gr, e.defaultLayout ? {
|
|
3489
3489
|
...e.initialChrome,
|
|
3490
3490
|
layout: e.defaultLayout
|
|
3491
|
-
} : e.initialChrome), i = e.layout ?? n.layout, a =
|
|
3491
|
+
} : e.initialChrome), i = e.layout ?? n.layout, a = L(() => ({
|
|
3492
3492
|
...n,
|
|
3493
3493
|
layout: i
|
|
3494
|
-
}), [n, i]), { layout: o, onLayoutChange: s } = e,
|
|
3494
|
+
}), [n, i]), { layout: o, onLayoutChange: s } = e, l = L(() => ({
|
|
3495
3495
|
...r,
|
|
3496
3496
|
setLayout: (e) => {
|
|
3497
3497
|
e !== i && (s?.(e), o === void 0 && r.setLayout(e));
|
|
@@ -3501,16 +3501,16 @@ function Ba({ props: e, children: t }) {
|
|
|
3501
3501
|
i,
|
|
3502
3502
|
o,
|
|
3503
3503
|
s
|
|
3504
|
-
]),
|
|
3504
|
+
]), u = L(() => ua(i, e.coverPage, a.size), [
|
|
3505
3505
|
i,
|
|
3506
3506
|
e.coverPage,
|
|
3507
3507
|
a.size
|
|
3508
|
-
]), d = za(e,
|
|
3509
|
-
return /* @__PURE__ */
|
|
3510
|
-
value:
|
|
3508
|
+
]), d = za(e, u.mode), f = R(null), p = c(), m = p !== null && p === f.current ? "fullscreen" : e.mode ?? "embedded", { onOpenChange: h, onBack: g, onExitFullscreen: _ } = e, v = a.size;
|
|
3509
|
+
return /* @__PURE__ */ V(vr, {
|
|
3510
|
+
value: L(() => ({
|
|
3511
3511
|
chrome: a,
|
|
3512
|
-
chromeActions:
|
|
3513
|
-
layout:
|
|
3512
|
+
chromeActions: l,
|
|
3513
|
+
layout: u,
|
|
3514
3514
|
mode: m,
|
|
3515
3515
|
frameRef: f,
|
|
3516
3516
|
props: e,
|
|
@@ -3518,15 +3518,15 @@ function Ba({ props: e, children: t }) {
|
|
|
3518
3518
|
document.fullscreenElement ? document.exitFullscreen?.() : f.current?.requestFullscreen?.();
|
|
3519
3519
|
},
|
|
3520
3520
|
openSearch: () => {
|
|
3521
|
-
v === "compact" ?
|
|
3521
|
+
v === "compact" ? l.openSearchField() : l.openPanelTab("search"), l.focusSearch();
|
|
3522
3522
|
},
|
|
3523
3523
|
leave: () => {
|
|
3524
3524
|
m === "dialog" ? h?.(!1) : m === "page" ? g?.() : (document.fullscreenElement && document.exitFullscreen?.(), _?.());
|
|
3525
3525
|
}
|
|
3526
3526
|
}), [
|
|
3527
3527
|
a,
|
|
3528
|
-
c,
|
|
3529
3528
|
l,
|
|
3529
|
+
u,
|
|
3530
3530
|
m,
|
|
3531
3531
|
e,
|
|
3532
3532
|
v,
|
|
@@ -3534,7 +3534,7 @@ function Ba({ props: e, children: t }) {
|
|
|
3534
3534
|
g,
|
|
3535
3535
|
_
|
|
3536
3536
|
]),
|
|
3537
|
-
children: /* @__PURE__ */
|
|
3537
|
+
children: /* @__PURE__ */ V(yr, {
|
|
3538
3538
|
value: d,
|
|
3539
3539
|
children: t
|
|
3540
3540
|
})
|
|
@@ -3543,23 +3543,23 @@ function Ba({ props: e, children: t }) {
|
|
|
3543
3543
|
//#endregion
|
|
3544
3544
|
//#region lib/components/ui/media/pdf-reader/pdf-reader.tsx
|
|
3545
3545
|
function Va(e) {
|
|
3546
|
-
let t = e.file ? /* @__PURE__ */
|
|
3546
|
+
let t = e.file ? /* @__PURE__ */ V(Ba, {
|
|
3547
3547
|
props: e,
|
|
3548
|
-
children: /* @__PURE__ */
|
|
3549
|
-
}) : /* @__PURE__ */
|
|
3550
|
-
return e.mode === "dialog" ? /* @__PURE__ */
|
|
3548
|
+
children: /* @__PURE__ */ V(la, {})
|
|
3549
|
+
}) : /* @__PURE__ */ V(ur, { className: e.className });
|
|
3550
|
+
return e.mode === "dialog" ? /* @__PURE__ */ V(hr, {
|
|
3551
3551
|
open: e.open ?? !0,
|
|
3552
3552
|
onOpenChange: e.onOpenChange,
|
|
3553
3553
|
title: e.fileName,
|
|
3554
3554
|
children: t
|
|
3555
3555
|
}) : t;
|
|
3556
3556
|
}
|
|
3557
|
-
var Ha =
|
|
3557
|
+
var Ha = Oe(Va), Ua = /* @__PURE__ */ e({ PdfReader: () => Ka }), Wa = new Set(ri);
|
|
3558
3558
|
function Ga(e) {
|
|
3559
3559
|
return Object.fromEntries(Object.entries(e).filter(([e]) => !Wa.has(e)));
|
|
3560
3560
|
}
|
|
3561
3561
|
function Ka(e) {
|
|
3562
|
-
return /* @__PURE__ */
|
|
3562
|
+
return /* @__PURE__ */ V(Ha, { ...Ga(e) });
|
|
3563
3563
|
}
|
|
3564
3564
|
//#endregion
|
|
3565
|
-
export {
|
|
3565
|
+
export { Un as _, ar as a, rr as c, Yn as d, Jn as f, Hn as g, Gn as h, ir as i, $n as l, Wn as m, Ua as n, Qn as o, Xn as p, lr as r, er as s, Ka as t, Zn as u, an as v };
|