@pdf-viewer/react 0.0.0-experimental.7 → 0.0.0-experimental.8
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/dist/{LayoutWrapper-e310e12f.js → LayoutWrapper-6224491f.js} +2 -10
- package/dist/{SearchCloseButton-52d8ac31.js → SearchCloseButton-08d57275.js} +8 -16
- package/dist/ToolbarLayout.module-49d71551.js +3556 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/style.js +11 -11
- package/dist/components/RPConfig.js +4 -28
- package/dist/components/RPController.js +57 -104
- package/dist/components/RPDropFileZone.js +20 -43
- package/dist/components/RPPages.js +9 -21
- package/dist/components/RPProvider.js +16 -43
- package/dist/components/RPTheme.js +10 -17
- package/dist/components/icons/CheckIcon.js +18 -12
- package/dist/components/icons/ChevronDownIcon.js +19 -15
- package/dist/components/icons/ChevronUpIcon.js +18 -12
- package/dist/components/icons/ClearIcon.js +21 -24
- package/dist/components/icons/ClockwiseIcon.js +18 -12
- package/dist/components/icons/CloseIcon.js +18 -12
- package/dist/components/icons/DarkPdfIcon.js +8 -5
- package/dist/components/icons/DualPageIcon.js +18 -12
- package/dist/components/icons/FileDownloadDefaultIcon.js +19 -16
- package/dist/components/icons/FileUploadDefaultIcon.js +19 -16
- package/dist/components/icons/FullScreenIcon.js +18 -12
- package/dist/components/icons/GoToDownIcon.js +18 -12
- package/dist/components/icons/HandModeDefaultIcon.js +18 -12
- package/dist/components/icons/HorizontalScrollingIcon.js +20 -14
- package/dist/components/icons/InfoIcon.js +18 -12
- package/dist/components/icons/LightPdfIcon.js +8 -5
- package/dist/components/icons/LoaderIcon.js +9 -9
- package/dist/components/icons/MoonIcon.js +18 -12
- package/dist/components/icons/PageScrollingIcon.js +20 -14
- package/dist/components/icons/PrintDefaultIcon.js +19 -16
- package/dist/components/icons/SearchIcon.js +18 -12
- package/dist/components/icons/SinglePageIcon.js +18 -12
- package/dist/components/icons/SunIcon.js +21 -24
- package/dist/components/icons/TextSelectionDefaultIcon.js +19 -16
- package/dist/components/icons/ThreeDotIcon.js +18 -12
- package/dist/components/icons/Thumbnail.js +50 -30
- package/dist/components/icons/VerticalScrollingIcon.js +20 -14
- package/dist/components/icons/WrappedScrollingIcon.js +20 -14
- package/dist/components/icons/ZoomInIcon.js +18 -12
- package/dist/components/icons/ZoomOutIcon.js +18 -12
- package/dist/components/layout/Container.js +12 -14
- package/dist/components/layout/LayoutContainer.js +9 -21
- package/dist/components/layout/LayoutWrapper.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +8 -20
- package/dist/components/layout/RPLayout.js +36 -58
- package/dist/components/layout/WrapperLayout.js +7 -32
- package/dist/components/layout/sidebar/RPSidebar.js +8 -20
- package/dist/components/layout/sidebar/RPSplitter.js +22 -23
- package/dist/components/layout/sidebar/Thumbnail.js +9 -21
- package/dist/components/layout/sidebar/Thumbnails.js +8 -20
- package/dist/components/layout/toolbar/DarkModeTool.js +6 -42
- package/dist/components/layout/toolbar/DocumentDialog.js +9 -21
- package/dist/components/layout/toolbar/DocumentProperties.js +15 -43
- package/dist/components/layout/toolbar/FileDownloadTool.js +8 -20
- package/dist/components/layout/toolbar/FileUploadTool.js +11 -80
- package/dist/components/layout/toolbar/FullScreenTool.js +35 -73
- package/dist/components/layout/toolbar/MenuItem.js +10 -28
- package/dist/components/layout/toolbar/MenuSeparator.js +5 -16
- package/dist/components/layout/toolbar/MostPageTool.js +8 -20
- package/dist/components/layout/toolbar/OtherTool.js +8 -20
- package/dist/components/layout/toolbar/Paginate.js +8 -20
- package/dist/components/layout/toolbar/PrintTool.js +8 -20
- package/dist/components/layout/toolbar/PropertyItem.js +4 -13
- package/dist/components/layout/toolbar/RPMenuItem.js +16 -30
- package/dist/components/layout/toolbar/RPMoreOptions.js +114 -111
- package/dist/components/layout/toolbar/RPToolbar.js +8 -20
- package/dist/components/layout/toolbar/RPToolbarEnd.js +8 -20
- package/dist/components/layout/toolbar/RotateTool.js +26 -69
- package/dist/components/layout/toolbar/ScrollModeTool.js +33 -83
- package/dist/components/layout/toolbar/SearchCloseButton.js +3 -3
- package/dist/components/layout/toolbar/SearchResultNavigator.js +8 -20
- package/dist/components/layout/toolbar/SearchTool.js +8 -20
- package/dist/components/layout/toolbar/SelectionModeTool.js +21 -63
- package/dist/components/layout/toolbar/ThumbnailTool.js +11 -48
- package/dist/components/layout/toolbar/ToolbarCustom.js +44 -81
- package/dist/components/layout/toolbar/ToolbarDefault.js +44 -80
- package/dist/components/layout/toolbar/ToolbarLayout.js +11 -31
- package/dist/components/layout/toolbar/ViewModeTool.js +26 -72
- package/dist/components/layout/toolbar/ZoomTool.js +8 -20
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +18 -39
- package/dist/components/layout/toolbar/tools/DualPageTool.js +11 -44
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +11 -44
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +6 -36
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +9 -25
- package/dist/components/layout/toolbar/tools/InputPageTool.js +27 -41
- package/dist/components/layout/toolbar/tools/NextPageTool.js +20 -50
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +19 -40
- package/dist/components/layout/toolbar/tools/PrintTool.js +11 -44
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +6 -31
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +11 -31
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +8 -22
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +11 -44
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +5 -19
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +19 -40
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +14 -31
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +9 -21
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +56 -82
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +14 -31
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +20 -64
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +13 -40
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +11 -36
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +14 -42
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +14 -42
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +11 -38
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +21 -73
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +14 -42
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +20 -57
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +29 -70
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +22 -58
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +21 -61
- package/dist/components/page/AnnotationLayer.js +9 -21
- package/dist/components/page/CanvasLayer.js +9 -21
- package/dist/components/page/CustomElement.js +8 -38
- package/dist/components/page/DualPage.js +8 -20
- package/dist/components/page/RPPage.js +9 -21
- package/dist/components/page/SinglePage.js +8 -20
- package/dist/components/page/TextHighlightLayer.js +18 -30
- package/dist/components/page/TextLayer.js +15 -27
- package/dist/components/ui/Button.js +11 -13
- package/dist/components/ui/Checkbox.js +15 -23
- package/dist/components/ui/DropDown.js +18 -40
- package/dist/components/ui/Input.js +14 -18
- package/dist/components/ui/LoadingIndicator.js +8 -20
- package/dist/components/ui/PasswordModal.js +24 -33
- package/dist/components/ui/RPTooltip.js +11 -29
- package/dist/contexts/ConfigContext.js +2 -8
- package/dist/contexts/DarkModeContext.js +2 -11
- package/dist/contexts/DimensionPagesContext.js +28 -89
- package/dist/contexts/DocumentPasswordContext.js +1 -4
- package/dist/contexts/DownloadContext.js +9 -9
- package/dist/contexts/DropFileZoneContext.js +34 -45
- package/dist/contexts/ElementPageContext.js +80 -111
- package/dist/contexts/EventCallbackContext.js +11 -8
- package/dist/contexts/FileInputContext.js +22 -39
- package/dist/contexts/FullScreenContext.js +3 -18
- package/dist/contexts/GlobalCurrentPage.js +3 -15
- package/dist/contexts/HighlightContext.js +7 -32
- package/dist/contexts/IconContext.js +1 -4
- package/dist/contexts/IconToolContext.js +2 -12
- package/dist/contexts/InitialStateContext.js +1 -4
- package/dist/contexts/LayerContext.js +1 -11
- package/dist/contexts/LicenseContext.js +8 -17
- package/dist/contexts/LoaderContext.js +10 -10
- package/dist/contexts/LocalizationContext.js +9 -6
- package/dist/contexts/OtherToolContext.js +2 -7
- package/dist/contexts/PageViewportContext.js +1 -6
- package/dist/contexts/PagesRotateContext.js +13 -45
- package/dist/contexts/PaginationContext.js +10 -22
- package/dist/contexts/PrintContext.js +10 -22
- package/dist/contexts/RPDocumentContext.js +17 -34
- package/dist/contexts/RenderQueueProvider.js +10 -22
- package/dist/contexts/RenderedPagesCache.js +8 -23
- package/dist/contexts/RotationContext.js +16 -33
- package/dist/contexts/ScrollModeContext.js +3 -13
- package/dist/contexts/SearchContext.js +10 -22
- package/dist/contexts/SelectionModeContext.js +1 -7
- package/dist/contexts/SmoothScrollContext.js +3 -12
- package/dist/contexts/ThumbnailsContext.js +10 -22
- package/dist/contexts/ToolComponentContext.js +2 -10
- package/dist/contexts/ToolbarComponentContext.js +2 -8
- package/dist/contexts/ViewModeContext.js +3 -15
- package/dist/contexts/ViewportContext.js +2 -7
- package/dist/contexts/VirtualGridContext.js +2 -10
- package/dist/contexts/VirtualScrollContext.js +19 -18
- package/dist/contexts/ZoomContext.js +84 -196
- package/dist/{index-1d695410.js → index-808ea7bf.js} +1 -1
- package/dist/index-a48ec088.js +1672 -0
- package/dist/{index-7ca3764b.js → index-c9a2990a.js} +3 -3
- package/dist/main.js +91 -103
- package/dist/types/utils/approximateFragtion.d.ts +9 -0
- package/dist/types/utils/link_service.d.ts +8 -0
- package/dist/utils/Queue.js +18 -60
- package/dist/utils/annotations.js +75 -109
- package/dist/utils/approximateFragtion.js +22 -0
- package/dist/utils/calculatePage.js +11 -23
- package/dist/utils/convertPdfDate.js +3 -1
- package/dist/utils/elementPagePosition.js +1 -8
- package/dist/utils/getElementPositionInPage.js +44 -16
- package/dist/utils/getScrollDistance.js +2 -5
- package/dist/utils/getThumbnailViewport.js +2 -10
- package/dist/utils/getZoomLevel.js +4 -1
- package/dist/utils/highlight.js +153 -225
- package/dist/utils/hooks/useCopyText.js +19 -20
- package/dist/utils/hooks/useDarkModeProps.js +1 -4
- package/dist/utils/hooks/useElementSize.js +10 -25
- package/dist/utils/hooks/useFileDownload.js +9 -21
- package/dist/utils/hooks/useFullScreen.js +1 -6
- package/dist/utils/hooks/useGrabScroll.js +16 -17
- package/dist/utils/hooks/useHighlight.js +22 -25
- package/dist/utils/hooks/useInfiniteScroll.js +8 -8
- package/dist/utils/hooks/useLicense.js +55 -1174
- package/dist/utils/hooks/useLoadPdf.js +42 -81
- package/dist/utils/hooks/useLoadWorker.js +8 -8
- package/dist/utils/hooks/useMousePressed.js +2 -8
- package/dist/utils/hooks/usePageRotateContext.js +18 -33
- package/dist/utils/hooks/usePaginate.js +9 -21
- package/dist/utils/hooks/usePinch.js +39 -49
- package/dist/utils/hooks/usePresentPage.js +18 -30
- package/dist/utils/hooks/usePrint.js +9 -21
- package/dist/utils/hooks/useRequestAnimationFrame.js +9 -9
- package/dist/utils/hooks/useRotate.js +4 -17
- package/dist/utils/hooks/useScrollToPage.js +9 -21
- package/dist/utils/hooks/useSearch.js +9 -21
- package/dist/utils/hooks/useThumbnail.js +9 -21
- package/dist/utils/hooks/useVirtualReactWindow.js +9 -21
- package/dist/utils/hooks/useWatermark.js +42 -55
- package/dist/utils/link_service.js +36 -20
- package/dist/utils/renderPage.js +5 -12
- package/dist/utils/smoothScrollTo.js +1 -4
- package/dist/utils/withRef.js +1 -4
- package/package.json +5 -9
- package/dist/ToolbarLayout.module-d74981d1.js +0 -4270
- package/dist/classof-56f81803.js +0 -76
- package/dist/es.iterator.constructor-05468e3d.js +0 -126
- package/dist/es.iterator.filter-1ddb1471.js +0 -37
- package/dist/es.iterator.for-each-ed4cb4aa.js +0 -34
- package/dist/es.iterator.map-635f6e20.js +0 -157
- package/dist/es.iterator.reduce-969434f1.js +0 -31
- package/dist/esnext.json.parse-3bf99e2e.js +0 -152
- package/dist/esnext.map.delete-all-fa83df07.js +0 -401
- package/dist/function-uncurry-this-accessor-efc140e6.js +0 -17
- package/dist/index-922e8d58.js +0 -2545
- package/dist/is-pure-db2321f6.js +0 -886
- package/dist/iterate-1672c441.js +0 -110
- package/dist/iterator-helper-without-closing-on-early-error-a6637535.js +0 -69
- package/dist/web.url-search-params.delete-c65de04d.js +0 -51
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import "../is-pure-db2321f6.js";
|
|
2
|
-
import "../es.iterator.constructor-05468e3d.js";
|
|
3
|
-
import "../es.iterator.for-each-ed4cb4aa.js";
|
|
4
|
-
import "../esnext.json.parse-3bf99e2e.js";
|
|
5
|
-
import "../esnext.map.delete-all-fa83df07.js";
|
|
6
1
|
import { sanitizeExternalUrl as _ } from "./sanitizeExternalUrl.js";
|
|
7
2
|
import { AnnotationType as l } from "./types.js";
|
|
8
3
|
import { dateFormatter as L } from "./dateFormatter.js";
|
|
9
|
-
import "../iterate-1672c441.js";
|
|
10
|
-
import "../classof-56f81803.js";
|
|
11
|
-
import "../iterator-helper-without-closing-on-early-error-a6637535.js";
|
|
12
4
|
import "../th_TH-d627cd51.js";
|
|
13
|
-
const T = ["click", "dblclick", "input", "change"],
|
|
5
|
+
const T = ["click", "dblclick", "input", "change"], m = /* @__PURE__ */ new Map(), v = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
|
|
14
6
|
function I(e, t) {
|
|
15
7
|
const n = v(e, t);
|
|
16
|
-
return
|
|
8
|
+
return m.has(n) ? m.get(n) ?? null : null;
|
|
17
9
|
}
|
|
18
10
|
const x = (e, t, n) => {
|
|
19
|
-
|
|
11
|
+
m.set(v(e, t), n);
|
|
20
12
|
}, A = (e, t) => {
|
|
21
13
|
switch (t[1].name) {
|
|
22
14
|
case "XYZ":
|
|
@@ -54,29 +46,29 @@ const x = (e, t, n) => {
|
|
|
54
46
|
async function E(e, t) {
|
|
55
47
|
let n;
|
|
56
48
|
if (typeof t == "string" ? n = await e.getDestination(t) : n = t, n && typeof n[0] == "object" && n[0] !== null) {
|
|
57
|
-
const a = n[0],
|
|
58
|
-
if (
|
|
49
|
+
const a = n[0], s = I(e, a);
|
|
50
|
+
if (s === null) {
|
|
59
51
|
const r = await e.getPageIndex(a);
|
|
60
52
|
return x(e, a, r), await E(e, n);
|
|
61
53
|
} else
|
|
62
|
-
return A(
|
|
54
|
+
return A(s, n);
|
|
63
55
|
} else
|
|
64
56
|
return A(n[0], n);
|
|
65
57
|
}
|
|
66
|
-
const
|
|
58
|
+
const M = (e) => {
|
|
67
59
|
const n = e.target.parentNode;
|
|
68
60
|
if (!n)
|
|
69
61
|
return;
|
|
70
|
-
const a = new MutationObserver((
|
|
71
|
-
|
|
72
|
-
n.querySelectorAll(
|
|
73
|
-
|
|
62
|
+
const a = new MutationObserver((s) => {
|
|
63
|
+
s.forEach(() => {
|
|
64
|
+
n.querySelectorAll(
|
|
65
|
+
'[data-l10n-id="pdfjs-annotation-date-time-string"]'
|
|
66
|
+
).forEach((o) => {
|
|
67
|
+
const c = o.getAttribute("data-l10n-args");
|
|
74
68
|
if (c) {
|
|
75
69
|
try {
|
|
76
|
-
const {
|
|
77
|
-
|
|
78
|
-
} = JSON.parse(c);
|
|
79
|
-
i && (s.textContent = L(i));
|
|
70
|
+
const { dateObj: i } = JSON.parse(c);
|
|
71
|
+
i && (o.textContent = L(i));
|
|
80
72
|
} catch {
|
|
81
73
|
}
|
|
82
74
|
a.disconnect();
|
|
@@ -93,39 +85,29 @@ const K = (e) => {
|
|
|
93
85
|
// Watch for changes to attributes
|
|
94
86
|
}), () => a.disconnect();
|
|
95
87
|
};
|
|
96
|
-
function
|
|
88
|
+
function H(e, t) {
|
|
97
89
|
for (const n of T)
|
|
98
90
|
e.addEventListener(n, t);
|
|
99
91
|
}
|
|
100
|
-
function
|
|
92
|
+
function P(e, t) {
|
|
101
93
|
for (const n of T)
|
|
102
94
|
e.removeEventListener(n, t);
|
|
103
95
|
}
|
|
104
|
-
function
|
|
105
|
-
const {
|
|
106
|
-
|
|
107
|
-
url: n,
|
|
108
|
-
unsafeUrl: a
|
|
109
|
-
} = e;
|
|
110
|
-
new MutationObserver((r, s) => {
|
|
96
|
+
function U(e) {
|
|
97
|
+
const { id: t, url: n, unsafeUrl: a } = e;
|
|
98
|
+
new MutationObserver((r, o) => {
|
|
111
99
|
const c = document.querySelector(`[data-annotation-id="${t}"]`);
|
|
112
100
|
if (c) {
|
|
113
101
|
const i = c.querySelector("a"), p = _((n || a) ?? "", "");
|
|
114
|
-
i && (i == null || i.setAttribute("target", "_blank"), i == null || i.setAttribute("href", p), i == null || i.setAttribute("rel", "noopener noreferrer")),
|
|
102
|
+
i && (i == null || i.setAttribute("target", "_blank"), i == null || i.setAttribute("href", p), i == null || i.setAttribute("rel", "noopener noreferrer")), o.disconnect();
|
|
115
103
|
}
|
|
116
|
-
}).observe(document.body, {
|
|
117
|
-
childList: !0,
|
|
118
|
-
subtree: !0
|
|
119
|
-
});
|
|
104
|
+
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
120
105
|
}
|
|
121
|
-
function
|
|
122
|
-
const {
|
|
123
|
-
rotation: a,
|
|
124
|
-
scale: o
|
|
125
|
-
} = t, r = a % 180 === 0;
|
|
106
|
+
function V(e, t, n) {
|
|
107
|
+
const { rotation: a, scale: s } = t, r = a % 180 === 0;
|
|
126
108
|
if (e.fieldType === "Btn" && e.pushButton) {
|
|
127
|
-
const
|
|
128
|
-
i.setAttribute("width", ((r ?
|
|
109
|
+
const o = e.rect[2] - e.rect[0], c = e.rect[3] - e.rect[1], i = document.createElement("canvas");
|
|
110
|
+
i.setAttribute("width", ((r ? o : c) * s).toString()), i.setAttribute("height", ((r ? c : o) * s).toString()), n.set(e.id, i);
|
|
129
111
|
}
|
|
130
112
|
}
|
|
131
113
|
function B(e) {
|
|
@@ -136,41 +118,32 @@ function B(e) {
|
|
|
136
118
|
const n = t.getAttribute("aria-haspopup") === "dialog", a = t.classList.contains("popupAnnotation");
|
|
137
119
|
if (!n && !a)
|
|
138
120
|
return;
|
|
139
|
-
let
|
|
140
|
-
if (
|
|
141
|
-
const
|
|
142
|
-
|
|
121
|
+
let s = t.id || t.getAttribute("aria-controls");
|
|
122
|
+
if (s || (s = (r = t.firstChild) == null ? void 0 : r.id), s && t.parentElement) {
|
|
123
|
+
const o = t.parentElement.querySelector(`[aria-controls="${s}"]`);
|
|
124
|
+
o && new MutationObserver((i, p) => {
|
|
143
125
|
const b = document.querySelectorAll(".popupDate");
|
|
144
|
-
b.length > 0 && (b.forEach((
|
|
145
|
-
if (
|
|
126
|
+
b.length > 0 && (b.forEach((g) => {
|
|
127
|
+
if (g.innerHTML)
|
|
146
128
|
return !1;
|
|
147
|
-
const N =
|
|
129
|
+
const N = g.getAttribute("data-l10n-args");
|
|
148
130
|
if (N) {
|
|
149
|
-
const {
|
|
150
|
-
|
|
151
|
-
time: y
|
|
152
|
-
} = JSON.parse(N);
|
|
153
|
-
h && y && (m.textContent = `${h}, ${y}`);
|
|
131
|
+
const { date: h, time: y } = JSON.parse(N);
|
|
132
|
+
h && y && (g.textContent = `${h}, ${y}`);
|
|
154
133
|
}
|
|
155
134
|
}), p.disconnect());
|
|
156
|
-
}).observe(
|
|
157
|
-
childList: !0,
|
|
158
|
-
subtree: !0
|
|
159
|
-
});
|
|
135
|
+
}).observe(o, { childList: !0, subtree: !0 });
|
|
160
136
|
}
|
|
161
137
|
}
|
|
162
138
|
function d(e, t, n) {
|
|
163
139
|
const a = [];
|
|
164
140
|
if (n)
|
|
165
|
-
for (const
|
|
166
|
-
|
|
141
|
+
for (const s of n)
|
|
142
|
+
s[e] === t && a.push(s);
|
|
167
143
|
return a;
|
|
168
144
|
}
|
|
169
145
|
function u(e, t) {
|
|
170
|
-
return {
|
|
171
|
-
type: e,
|
|
172
|
-
data: t
|
|
173
|
-
};
|
|
146
|
+
return { type: e, data: t };
|
|
174
147
|
}
|
|
175
148
|
async function w(e, t) {
|
|
176
149
|
if (e.dest)
|
|
@@ -201,8 +174,8 @@ function O(e) {
|
|
|
201
174
|
let n = t.textContent;
|
|
202
175
|
const a = JSON.parse(t.dataset.l10nArgs ?? "{}");
|
|
203
176
|
if (n)
|
|
204
|
-
for (const
|
|
205
|
-
n = n.replace(`{{${
|
|
177
|
+
for (const s in a)
|
|
178
|
+
n = n.replace(`{{${s}}}`, a[s]);
|
|
206
179
|
t.textContent = n;
|
|
207
180
|
}
|
|
208
181
|
}
|
|
@@ -220,16 +193,16 @@ function f(e, t) {
|
|
|
220
193
|
case "select-one":
|
|
221
194
|
case "select-multiple":
|
|
222
195
|
const n = [];
|
|
223
|
-
for (const
|
|
196
|
+
for (const s of e.options)
|
|
224
197
|
n.push({
|
|
225
|
-
value:
|
|
226
|
-
label:
|
|
198
|
+
value: s.value,
|
|
199
|
+
label: s.label
|
|
227
200
|
});
|
|
228
201
|
const a = [];
|
|
229
|
-
for (const
|
|
202
|
+
for (const s of e.selectedOptions)
|
|
230
203
|
a.push({
|
|
231
|
-
value:
|
|
232
|
-
label:
|
|
204
|
+
value: s.value,
|
|
205
|
+
label: s.label
|
|
233
206
|
});
|
|
234
207
|
return u(l.FORM_SELECT, {
|
|
235
208
|
fieldName: e.name,
|
|
@@ -253,16 +226,16 @@ function f(e, t) {
|
|
|
253
226
|
});
|
|
254
227
|
}
|
|
255
228
|
}
|
|
256
|
-
async function
|
|
257
|
-
var
|
|
229
|
+
async function $(e, t, n) {
|
|
230
|
+
var s;
|
|
258
231
|
let a = e.target.parentNode;
|
|
259
232
|
if (a.tagName === "DIV" && (a = a.firstChild), B(a), typeof a.className != "object")
|
|
260
233
|
if (a.className === "linkAnnotation" && e.type === "click") {
|
|
261
|
-
const r = (
|
|
234
|
+
const r = (s = a.dataset) == null ? void 0 : s.annotationId;
|
|
262
235
|
if (r) {
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
return await w(
|
|
236
|
+
const o = d("id", r, n);
|
|
237
|
+
if (o.length)
|
|
238
|
+
return await w(o[0], t);
|
|
266
239
|
}
|
|
267
240
|
} else if (
|
|
268
241
|
/* annotation.className.includes('popupAnnotation') || */
|
|
@@ -285,46 +258,39 @@ async function z(e, t, n) {
|
|
|
285
258
|
if (a.className.includes("buttonWidgetAnnotation radioButton") && e.type === "change") {
|
|
286
259
|
const r = a.dataset.annotationId;
|
|
287
260
|
if (r) {
|
|
288
|
-
const
|
|
289
|
-
for (const i of d(
|
|
261
|
+
const o = d("id", r, n)[0], c = [];
|
|
262
|
+
for (const i of d(
|
|
263
|
+
"fieldName",
|
|
264
|
+
o.fieldName,
|
|
265
|
+
n
|
|
266
|
+
))
|
|
290
267
|
i.buttonValue && c.push(i.buttonValue);
|
|
291
268
|
return f(a.getElementsByTagName("input")[0], {
|
|
292
|
-
value:
|
|
293
|
-
defaultValue:
|
|
269
|
+
value: o.buttonValue,
|
|
270
|
+
defaultValue: o.fieldValue,
|
|
294
271
|
options: c
|
|
295
272
|
});
|
|
296
273
|
}
|
|
297
274
|
} else if (a.className.includes("buttonWidgetAnnotation pushButton") && e.type === "click") {
|
|
298
275
|
const r = a.dataset.annotationId;
|
|
299
276
|
if (r) {
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
type: "button"
|
|
309
|
-
}, {
|
|
310
|
-
actions: s.actions,
|
|
311
|
-
reset: !0
|
|
312
|
-
}) : f({
|
|
313
|
-
name: s.fieldName,
|
|
314
|
-
type: "button"
|
|
315
|
-
}, {
|
|
316
|
-
actions: s.actions,
|
|
317
|
-
reset: !1
|
|
318
|
-
});
|
|
277
|
+
const o = d("id", r, n)[0], { action: c } = o;
|
|
278
|
+
return c && ["Print", "SaveAs"].includes(c) ? { type: l.BUTTON, data: o } : o.resetForm ? f(
|
|
279
|
+
{ name: o.fieldName, type: "button" },
|
|
280
|
+
{ actions: o.actions, reset: !0 }
|
|
281
|
+
) : f(
|
|
282
|
+
{ name: o.fieldName, type: "button" },
|
|
283
|
+
{ actions: o.actions, reset: !1 }
|
|
284
|
+
);
|
|
319
285
|
}
|
|
320
286
|
}
|
|
321
287
|
}
|
|
322
288
|
}
|
|
323
289
|
export {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
290
|
+
$ as annotationEventsHandler,
|
|
291
|
+
M as annotationsEvents,
|
|
292
|
+
H as bindLayerEvents,
|
|
293
|
+
U as handleAnnotationLink,
|
|
294
|
+
V as handleAnnotationWidget,
|
|
295
|
+
P as unbindLayerEvents
|
|
330
296
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function u(t) {
|
|
2
|
+
if (Math.floor(t) === t)
|
|
3
|
+
return [t, 1];
|
|
4
|
+
const e = 1 / t, s = 8;
|
|
5
|
+
if (e > s)
|
|
6
|
+
return [1, s];
|
|
7
|
+
if (Math.floor(e) === e)
|
|
8
|
+
return [1, e];
|
|
9
|
+
const r = t > 1 ? e : t;
|
|
10
|
+
let i = 0, n = 1, o = 1, l = 1;
|
|
11
|
+
for (; ; ) {
|
|
12
|
+
const c = i + o, f = n + l;
|
|
13
|
+
if (f > s)
|
|
14
|
+
break;
|
|
15
|
+
r <= c / f ? (o = c, l = f) : (i = c, n = f);
|
|
16
|
+
}
|
|
17
|
+
let a;
|
|
18
|
+
return r - i / n < o / l - r ? a = r === t ? [i, n] : [n, i] : a = r === t ? [o, l] : [l, o], a;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
u as approximateFraction
|
|
22
|
+
};
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "../classof-56f81803.js";
|
|
6
|
-
import "../iterator-helper-without-closing-on-early-error-a6637535.js";
|
|
7
|
-
const w = (r, t, o) => r * o + t + 1, m = (r, t) => {
|
|
8
|
-
const o = r - 1, n = Math.floor(o / t), s = (o - n * t) % t;
|
|
9
|
-
return {
|
|
10
|
-
rowIndex: n,
|
|
11
|
-
columnIndex: s
|
|
12
|
-
};
|
|
13
|
-
}, I = (r, t) => {
|
|
1
|
+
const d = (e, t, o) => e * o + t + 1, a = (e, t) => {
|
|
2
|
+
const o = e - 1, n = Math.floor(o / t), s = (o - n * t) % t;
|
|
3
|
+
return { rowIndex: n, columnIndex: s };
|
|
4
|
+
}, h = (e, t) => {
|
|
14
5
|
const o = [], n = [];
|
|
15
|
-
return
|
|
16
|
-
const
|
|
17
|
-
o[
|
|
18
|
-
}), {
|
|
19
|
-
rowsHeight: o,
|
|
20
|
-
columnsWidth: n
|
|
21
|
-
};
|
|
6
|
+
return e.heights.forEach((s, c) => {
|
|
7
|
+
const r = a(c + 1, t), i = e.widths[c];
|
|
8
|
+
o[r.rowIndex] = Math.max(o[r.rowIndex] || 0, s), n[r.columnIndex] = Math.max(n[r.columnIndex] || 0, i);
|
|
9
|
+
}), { rowsHeight: o, columnsWidth: n };
|
|
22
10
|
};
|
|
23
11
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
h as getGridDimension,
|
|
13
|
+
d as getPageFromPosition,
|
|
14
|
+
a as getPositionFromPage
|
|
27
15
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
const p = new RegExp(
|
|
1
|
+
const p = new RegExp(
|
|
2
|
+
"^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"
|
|
3
|
+
), t = (s, e, o, c) => {
|
|
2
4
|
const n = parseInt(s, 10);
|
|
3
5
|
return n >= e && n <= o ? n : c;
|
|
4
6
|
}, f = (s) => {
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
const o = ({
|
|
2
|
-
width: a,
|
|
3
|
-
height: c,
|
|
4
|
-
top: t,
|
|
5
|
-
left: r,
|
|
6
|
-
bottom: e,
|
|
7
|
-
right: l
|
|
8
|
-
}) => ({
|
|
1
|
+
const o = ({ width: a, height: c, top: t, left: r, bottom: e, right: l }) => ({
|
|
9
2
|
left: `calc(${r} * var(--scale-factor))`,
|
|
10
3
|
top: `calc(${t} * var(--scale-factor))`,
|
|
11
4
|
width: `calc(${a} * var(--scale-factor))`,
|
|
@@ -1,19 +1,47 @@
|
|
|
1
|
-
import "../es.iterator.constructor-05468e3d.js";
|
|
2
|
-
import "../es.iterator.for-each-ed4cb4aa.js";
|
|
3
|
-
import "../is-pure-db2321f6.js";
|
|
4
|
-
import "../iterate-1672c441.js";
|
|
5
|
-
import "../classof-56f81803.js";
|
|
6
|
-
import "../iterator-helper-without-closing-on-early-error-a6637535.js";
|
|
7
1
|
function g(e, o) {
|
|
8
2
|
!e || typeof e != "object" || Object.entries(e).forEach(([d, i]) => {
|
|
9
3
|
if (i == null)
|
|
10
4
|
return;
|
|
11
|
-
const s = d.replace(/([A-Z])/g, "-$1").toLowerCase(), n = [
|
|
5
|
+
const s = d.replace(/([A-Z])/g, "-$1").toLowerCase(), n = [
|
|
6
|
+
"width",
|
|
7
|
+
"height",
|
|
8
|
+
"top",
|
|
9
|
+
"right",
|
|
10
|
+
"bottom",
|
|
11
|
+
"left",
|
|
12
|
+
"margin",
|
|
13
|
+
"margin-top",
|
|
14
|
+
"margin-right",
|
|
15
|
+
"margin-bottom",
|
|
16
|
+
"margin-left",
|
|
17
|
+
"padding",
|
|
18
|
+
"padding-top",
|
|
19
|
+
"padding-right",
|
|
20
|
+
"padding-bottom",
|
|
21
|
+
"padding-left",
|
|
22
|
+
"border-width",
|
|
23
|
+
"border-top-width",
|
|
24
|
+
"border-right-width",
|
|
25
|
+
"border-bottom-width",
|
|
26
|
+
"border-left-width",
|
|
27
|
+
"font-size",
|
|
28
|
+
"line-height",
|
|
29
|
+
"letter-spacing",
|
|
30
|
+
"word-spacing",
|
|
31
|
+
"min-width",
|
|
32
|
+
"min-height",
|
|
33
|
+
"max-width",
|
|
34
|
+
"max-height",
|
|
35
|
+
"flex-basis",
|
|
36
|
+
"grid-gap",
|
|
37
|
+
"grid-row-gap",
|
|
38
|
+
"grid-column-gap"
|
|
39
|
+
];
|
|
12
40
|
let t;
|
|
13
41
|
typeof i == "number" && i !== 0 ? t = n.includes(s) ? `${i}px` : String(i) : t = String(i), o.style.setProperty(s, t);
|
|
14
42
|
});
|
|
15
43
|
}
|
|
16
|
-
const
|
|
44
|
+
const f = (e, o, d, i, s) => {
|
|
17
45
|
let n = "center";
|
|
18
46
|
switch (i) {
|
|
19
47
|
case 90:
|
|
@@ -34,23 +62,23 @@ const E = (e, o, d, i, s) => {
|
|
|
34
62
|
if (d instanceof HTMLElement)
|
|
35
63
|
r = d.cloneNode(!0), l.appendChild(r);
|
|
36
64
|
else {
|
|
37
|
-
const
|
|
38
|
-
r = document.createElement("div"),
|
|
65
|
+
const p = d.props;
|
|
66
|
+
r = document.createElement("div"), p.style && g(p.style, r), p.className && (r.className = p.className), l.appendChild(r);
|
|
39
67
|
}
|
|
40
68
|
o.appendChild(t);
|
|
41
|
-
const c = t.getBoundingClientRect(),
|
|
69
|
+
const c = t.getBoundingClientRect(), h = r.getBoundingClientRect();
|
|
42
70
|
o.removeChild(t);
|
|
43
71
|
const a = {
|
|
44
72
|
top: o.clientHeight / 2,
|
|
45
73
|
left: o.clientWidth / 2
|
|
46
74
|
};
|
|
47
75
|
return {
|
|
48
|
-
left:
|
|
49
|
-
top:
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
76
|
+
left: h.left - c.left - a.left,
|
|
77
|
+
top: h.top - c.top - a.top,
|
|
78
|
+
width: h.width,
|
|
79
|
+
height: h.height
|
|
52
80
|
};
|
|
53
81
|
};
|
|
54
82
|
export {
|
|
55
|
-
|
|
83
|
+
f as getElementPagePosition
|
|
56
84
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import "../es.iterator.reduce-969434f1.js";
|
|
3
|
-
import "../is-pure-db2321f6.js";
|
|
4
|
-
const p = (r, t) => r.slice(0, t).reduce((e, o) => e + o, 0);
|
|
1
|
+
const n = (e, r) => e.slice(0, r).reduce((t, c) => t + c, 0);
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
n as getScrollDistance
|
|
7
4
|
};
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
const n = (t, o = 0) => {
|
|
2
|
-
const e = 100 / t.getViewport({
|
|
3
|
-
|
|
4
|
-
}).width, i = t.getViewport({
|
|
5
|
-
scale: e,
|
|
6
|
-
rotation: o
|
|
7
|
-
});
|
|
8
|
-
return {
|
|
9
|
-
scale: e,
|
|
10
|
-
thumbnailViewport: i
|
|
11
|
-
};
|
|
2
|
+
const e = 100 / t.getViewport({ scale: 1 }).width, i = t.getViewport({ scale: e, rotation: o });
|
|
3
|
+
return { scale: e, thumbnailViewport: i };
|
|
12
4
|
};
|
|
13
5
|
export {
|
|
14
6
|
n as getThumbnailViewport
|
|
@@ -7,7 +7,10 @@ const D = (o, t, a, e, A, c) => {
|
|
|
7
7
|
const m = c === i.DUAL_PAGE ? 2 * e : e;
|
|
8
8
|
switch (o) {
|
|
9
9
|
case r.PAGE_FIT:
|
|
10
|
-
const s = Math.min(
|
|
10
|
+
const s = Math.min(
|
|
11
|
+
(t - n) / m,
|
|
12
|
+
(a - f) / A
|
|
13
|
+
);
|
|
11
14
|
return Math.floor(s * 100);
|
|
12
15
|
case r.PAGE_WIDTH:
|
|
13
16
|
return Math.floor((t - n) / m * 100);
|