@pristy/pristy-libvue 2.21.0 → 2.21.2

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.
Files changed (73) hide show
  1. package/dist/{ActivityHistory-BKXIlIOQ.js → ActivityHistory-CYTsXlFs.js} +2 -2
  2. package/dist/{ActivityHistory-BKXIlIOQ.js.map → ActivityHistory-CYTsXlFs.js.map} +1 -1
  3. package/dist/{BookmarksComponent-CdsRbOva.js → BookmarksComponent-BQRGDBtk.js} +2 -2
  4. package/dist/{BookmarksComponent-CdsRbOva.js.map → BookmarksComponent-BQRGDBtk.js.map} +1 -1
  5. package/dist/{ChartWrapper-zI_ibAa7.js → ChartWrapper-NLlDKzgW.js} +2 -2
  6. package/dist/{ChartWrapper-zI_ibAa7.js.map → ChartWrapper-NLlDKzgW.js.map} +1 -1
  7. package/dist/{DisplayFileInDashboardComponent-wpVndKS1.js → DisplayFileInDashboardComponent-Ba8OoyfR.js} +19 -18
  8. package/dist/{DisplayFileInDashboardComponent-wpVndKS1.js.map → DisplayFileInDashboardComponent-Ba8OoyfR.js.map} +1 -1
  9. package/dist/{ExternalApps-Dei3Hn5c.js → ExternalApps-cKv9ZUlp.js} +2 -2
  10. package/dist/{ExternalApps-Dei3Hn5c.js.map → ExternalApps-cKv9ZUlp.js.map} +1 -1
  11. package/dist/{FavoriteList-D3Ngq7DO.js → FavoriteList-NsYCMz7n.js} +2 -2
  12. package/dist/{FavoriteList-D3Ngq7DO.js.map → FavoriteList-NsYCMz7n.js.map} +1 -1
  13. package/dist/{MarkdownComponent-BasmAVLi.js → MarkdownComponent-q21Q073I.js} +2 -2
  14. package/dist/{MarkdownComponent-BasmAVLi.js.map → MarkdownComponent-q21Q073I.js.map} +1 -1
  15. package/dist/PDFComponent-CUgH5A5P.js +987 -0
  16. package/dist/PDFComponent-CUgH5A5P.js.map +1 -0
  17. package/dist/PdfConfigService-DZN8iTaP.js +17 -0
  18. package/dist/PdfConfigService-DZN8iTaP.js.map +1 -0
  19. package/dist/PdfToolsComponent-CynQg24K.js +1970 -0
  20. package/dist/PdfToolsComponent-CynQg24K.js.map +1 -0
  21. package/dist/{SearchInput-QaOq9dC2.js → SearchInput-CbErAaEm.js} +2 -2
  22. package/dist/{SearchInput-QaOq9dC2.js.map → SearchInput-CbErAaEm.js.map} +1 -1
  23. package/dist/{UnknownBlockType-8WbbZPjA.js → UnknownBlockType-BhseESPx.js} +2 -2
  24. package/dist/{UnknownBlockType-8WbbZPjA.js.map → UnknownBlockType-BhseESPx.js.map} +1 -1
  25. package/dist/{index-DCSuxZbe.js → index-DyssYdtW.js} +10885 -13608
  26. package/dist/index-DyssYdtW.js.map +1 -0
  27. package/dist/pristy-libvue.css +1 -1
  28. package/dist/pristy-libvue.es.js +1 -1
  29. package/dist/pristy-libvue.umd.js +23 -23
  30. package/dist/pristy-libvue.umd.js.map +1 -1
  31. package/dist/src/components/CodeMirrorBase.vue.d.ts +1 -1
  32. package/dist/src/components/CodeMirrorEditor.vue.d.ts.map +1 -1
  33. package/dist/src/components/DiffViewerDialog.vue.d.ts +2 -2
  34. package/dist/src/components/breadcrumb/ComplexBreadcrumb.vue.d.ts.map +1 -1
  35. package/dist/src/components/classification/ClassificationPlanList.vue.d.ts.map +1 -1
  36. package/dist/src/components/classification/NatureSelector.vue.d.ts +4 -2
  37. package/dist/src/components/classification/NatureSelector.vue.d.ts.map +1 -1
  38. package/dist/src/components/classification/UploadPlanPopup.vue.d.ts.map +1 -1
  39. package/dist/src/components/config/ConfigRawEditor.vue.d.ts +1 -1
  40. package/dist/src/components/config/ListVersionConfig.vue.d.ts +2 -2
  41. package/dist/src/components/dashboard/DashboardAdminPage.vue.d.ts +2 -2
  42. package/dist/src/components/dashboard/editor/BlockConfigEditor.vue.d.ts +2 -2
  43. package/dist/src/components/dashboard/editor/DashboardEditor.vue.d.ts +2 -2
  44. package/dist/src/components/dashboard/editor/JsonEditorDialog.vue.d.ts +1 -1
  45. package/dist/src/components/dashboard/editor/MarkdownEditorDialog.vue.d.ts +1 -1
  46. package/dist/src/components/dashboard/editor/block-configs/ExternalAppsConfig.vue.d.ts.map +1 -1
  47. package/dist/src/components/dashboard/editor/grid/GridBlock.vue.d.ts.map +1 -1
  48. package/dist/src/components/layouts/AppLayout.vue.d.ts +60 -1
  49. package/dist/src/components/layouts/AppLayout.vue.d.ts.map +1 -1
  50. package/dist/src/components/layouts/AppMobileLayout.vue.d.ts +60 -2
  51. package/dist/src/components/layouts/AppMobileLayout.vue.d.ts.map +1 -1
  52. package/dist/src/components/layouts/AppSubmenu.vue.d.ts.map +1 -1
  53. package/dist/src/components/navigation/ColumnTogglePanel.vue.d.ts.map +1 -1
  54. package/dist/src/components/navigation/ContentCompactTableView.vue.d.ts.map +1 -1
  55. package/dist/src/components/navigation/ContentListView.vue.d.ts.map +1 -1
  56. package/dist/src/components/navigation/ContentTableView.vue.d.ts.map +1 -1
  57. package/dist/src/components/navigation/PreviewPanel.vue.d.ts +2 -2
  58. package/dist/src/components/navigation/SelectionBar.vue.d.ts.map +1 -1
  59. package/dist/src/components/search/AdvancedViewPanel.vue.d.ts.map +1 -1
  60. package/dist/src/components/search/ViewResultsPanel.vue.d.ts.map +1 -1
  61. package/dist/src/components/viewer/lazyPdfComponents.d.ts +442 -0
  62. package/dist/src/components/viewer/lazyPdfComponents.d.ts.map +1 -0
  63. package/dist/src/components/views/PredefinedViewsPanel.vue.d.ts.map +1 -1
  64. package/dist/src/components/views/ViewList.vue.d.ts.map +1 -1
  65. package/dist/src/i18n/index.d.ts +14 -0
  66. package/dist/src/i18n/index.d.ts.map +1 -1
  67. package/dist/src/index.d.ts +1 -2
  68. package/dist/src/index.d.ts.map +1 -1
  69. package/dist/src/services/AlfrescoFileService.d.ts.map +1 -1
  70. package/dist/src/services/IconeService.d.ts.map +1 -1
  71. package/dist/src/stores/filingPlan.d.ts.map +1 -1
  72. package/package.json +1 -1
  73. package/dist/index-DCSuxZbe.js.map +0 -1
@@ -0,0 +1,1970 @@
1
+ import { ref as v, openBlock as g, createBlock as tl, unref as r, withCtx as $, createElementVNode as s, toDisplayString as f, createVNode as i, createElementBlock as h, createCommentVNode as U, computed as Te, onMounted as wo, watch as xe, onUnmounted as To, resolveDirective as xo, createTextVNode as le, Fragment as Je, renderList as Ze, withModifiers as ue, normalizeClass as q, normalizeStyle as st, withDirectives as De, vModelText as nt, withKeys as rt, nextTick as it } from "vue";
2
+ import { PDFName as Pe, PDFHexString as ct, PDFDocument as O, degrees as Eo, rgb as xl, RotationTypes as Po, StandardFonts as El } from "pdf-lib";
3
+ import { usePDF as dt, VuePDF as Qe } from "@tato30/vue-pdf";
4
+ import { a as ut } from "./PdfConfigService-DZN8iTaP.js";
5
+ /* empty css */
6
+ import { VueDraggableNext as Co } from "vue-draggable-next";
7
+ import { useI18n as gt } from "vue-i18n";
8
+ import Ue from "primevue/progressspinner";
9
+ import ko from "primevue/message";
10
+ import b from "primevue/button";
11
+ import Io from "primevue/checkbox";
12
+ import He from "primevue/inputtext";
13
+ import vt from "primevue/inputnumber";
14
+ import So from "primevue/slider";
15
+ import ft from "primevue/fileupload";
16
+ import pt from "primevue/divider";
17
+ import $o from "primevue/select";
18
+ import ol from "primevue/dialog";
19
+ import Ao from "primevue/tabs";
20
+ import _o from "primevue/tablist";
21
+ import el from "primevue/tab";
22
+ import Mo from "primevue/tabpanels";
23
+ import ll from "primevue/tabpanel";
24
+ import { _ as yt, T as ht, a as Ee, b as Pl, c as Fo, d as No } from "./index-DyssYdtW.js";
25
+ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for: "filename" }, Uo = { class: "form-field" }, Ho = { for: "location" }, Bo = { class: "input-group" }, Oo = {
26
+ key: 0,
27
+ class: "explorer-container"
28
+ }, Vo = {
29
+ __name: "SaveAsPopup",
30
+ props: {
31
+ visible: Boolean,
32
+ defaultFilename: {
33
+ type: String,
34
+ default: null
35
+ },
36
+ parentFolderNode: {
37
+ type: Object,
38
+ default: null
39
+ }
40
+ },
41
+ emits: ["close", "save"],
42
+ setup(P, { emit: k }) {
43
+ const { t: c } = gt(), w = P, G = k, A = v(""), Y = v(null), R = v(!1), y = v(null), F = v(""), T = () => {
44
+ A.value = w.defaultFilename || c("pdfTools.saveAs.defaultFilename"), Y.value = w.parentFolderNode, y.value = w.parentFolderNode?.id, F.value = w.parentFolderNode?.name, R.value = !1;
45
+ }, I = async (m) => {
46
+ if (!(!m || !m.isFolder)) {
47
+ if (m.name === "documentLibrary")
48
+ if (y.value = m.id, m.parentId)
49
+ try {
50
+ const N = await Ee.getNode(m.parentId);
51
+ F.value = N.properties["cm:title"] || N.name;
52
+ } catch (N) {
53
+ console.error("Could not fetch parent node name", N), F.value = m.name;
54
+ }
55
+ else
56
+ F.value = m.name;
57
+ else
58
+ y.value = m.id, F.value = m.name;
59
+ R.value = !1;
60
+ }
61
+ }, V = () => {
62
+ y.value && G("save", {
63
+ filename: A.value,
64
+ folderId: y.value
65
+ });
66
+ };
67
+ return (m, N) => (g(), tl(r(ol), {
68
+ visible: P.visible,
69
+ modal: "",
70
+ header: m.$t("pdfTools.saveAs.title"),
71
+ class: "dialog-save-as",
72
+ "onUpdate:visible": N[3] || (N[3] = (H) => m.$emit("close")),
73
+ onShow: T
74
+ }, {
75
+ footer: $(() => [
76
+ i(r(b), {
77
+ label: m.$t("pdfTools.common.cancel"),
78
+ icon: "ri-close-line",
79
+ text: "",
80
+ onClick: N[2] || (N[2] = (H) => m.$emit("close"))
81
+ }, null, 8, ["label"]),
82
+ i(r(b), {
83
+ label: m.$t("pdfTools.common.save"),
84
+ icon: "ri-check-line",
85
+ onClick: V,
86
+ disabled: !A.value || !y.value
87
+ }, null, 8, ["label", "disabled"])
88
+ ]),
89
+ default: $(() => [
90
+ s("div", Ro, [
91
+ s("div", Lo, [
92
+ s("label", Do, f(m.$t("pdfTools.saveAs.filenameLabel")), 1),
93
+ i(r(He), {
94
+ id: "filename",
95
+ modelValue: A.value,
96
+ "onUpdate:modelValue": N[0] || (N[0] = (H) => A.value = H)
97
+ }, null, 8, ["modelValue"])
98
+ ]),
99
+ s("div", Uo, [
100
+ s("label", Ho, f(m.$t("pdfTools.saveAs.folderLabel")), 1),
101
+ s("div", Bo, [
102
+ i(r(He), {
103
+ id: "location",
104
+ readonly: "",
105
+ value: F.value
106
+ }, null, 8, ["value"]),
107
+ i(r(b), {
108
+ icon: R.value ? "ri-arrow-up-s-line" : "ri-arrow-down-s-line",
109
+ label: m.$t("pdfTools.saveAs.browse"),
110
+ onClick: N[1] || (N[1] = (H) => R.value = !R.value)
111
+ }, null, 8, ["icon", "label"])
112
+ ])
113
+ ]),
114
+ R.value ? (g(), h("div", Oo, [
115
+ i(ht, {
116
+ "current-node": Y.value,
117
+ "show-user-home": "",
118
+ "show-files": !1,
119
+ onSelectNode: I
120
+ }, null, 8, ["current-node"])
121
+ ])) : U("", !0)
122
+ ])
123
+ ]),
124
+ _: 1
125
+ }, 8, ["visible", "header"]));
126
+ }
127
+ }, zo = /* @__PURE__ */ yt(Vo, [["__scopeId", "data-v-13a7638f"]]), Wo = [1, 0.92, 0.23], Go = 4, Xo = ({ doc: P, page: k, rect: c, text: w, title: G }) => {
128
+ const A = String(w ?? "");
129
+ if (!A.trim())
130
+ return;
131
+ const Y = P.context.obj({
132
+ Type: "Annot",
133
+ Subtype: "Text",
134
+ // Icon used by the viewer for this note
135
+ Name: "Comment",
136
+ Rect: [c.x, c.y, c.x + c.size, c.y + c.size],
137
+ // fromText encodes as UTF-16BE: a plain string would break accents
138
+ Contents: ct.fromText(A),
139
+ T: ct.fromText(String(G ?? "")),
140
+ C: Wo,
141
+ F: Go
142
+ });
143
+ k.node.addAnnot(P.context.register(Y));
144
+ }, Yo = (P) => {
145
+ const k = P.node.Annots();
146
+ if (!k)
147
+ return [];
148
+ const c = [];
149
+ for (let w = 0; w < k.size(); w++) {
150
+ const G = k.lookup(w);
151
+ if (G?.get(Pe.of("Subtype")) !== Pe.of("Text"))
152
+ continue;
153
+ const A = G.get(Pe.of("Rect"))?.asRectangle();
154
+ if (!A)
155
+ continue;
156
+ const Y = G.get(Pe.of("Contents"));
157
+ c.push({
158
+ x: A.x,
159
+ y: A.y,
160
+ size: Math.max(A.width, A.height),
161
+ text: typeof Y?.decodeText == "function" ? Y.decodeText() : ""
162
+ });
163
+ }
164
+ return c;
165
+ }, jo = (P) => {
166
+ const k = P.node.Annots();
167
+ if (k)
168
+ for (let c = k.size() - 1; c >= 0; c--)
169
+ k.lookup(c)?.get(Pe.of("Subtype")) === Pe.of("Text") && k.remove(c);
170
+ }, Ko = 72, qo = 200, Jo = 16e6, Zo = async ({
171
+ pdfPage: P,
172
+ redactions: k = [],
173
+ dpi: c = qo,
174
+ quality: w = 0.85,
175
+ mimeType: G = "image/jpeg",
176
+ maxPixels: A = Jo,
177
+ createCanvas: Y = () => document.createElement("canvas")
178
+ }) => {
179
+ let R = c / Ko;
180
+ const y = P.getViewport({ scale: R }), F = y.width * y.height;
181
+ F > A && (R = Math.floor(R * Math.sqrt(A / F) * 1e4) / 1e4);
182
+ const T = P.getViewport({ scale: R }), I = Y();
183
+ I.width = Math.floor(T.width), I.height = Math.floor(T.height);
184
+ const V = I.getContext("2d");
185
+ if (await P.render({ canvasContext: V, viewport: T }).promise, k.length > 0) {
186
+ V.fillStyle = "#000000";
187
+ for (const m of k)
188
+ V.fillRect(
189
+ m.x * I.width,
190
+ m.y * I.height,
191
+ m.w * I.width,
192
+ m.h * I.height
193
+ );
194
+ }
195
+ return I.toDataURL(G, w);
196
+ }, al = 1.2, Qo = 8, ea = ({ overlayWidth: P, pageWidthPt: k }) => !k || !P ? 1 : P / k, Cl = (P) => String(P ?? "").split(/\r?\n/), la = ({ lines: P, fontSize: k, measureLine: c }) => {
197
+ const w = P.map((G) => c(G));
198
+ return {
199
+ w: Math.max(Qo, ...w),
200
+ h: P.length * k * al
201
+ };
202
+ }, ta = ({ topY: P, lineIndex: k, fontSize: c, ascentPt: w }) => P - k * c * al - w, oa = { class: "pdf-tools-page" }, aa = { class: "pdf-tools-header" }, sa = { key: 0 }, na = {
203
+ key: 0,
204
+ class: "loading-container"
205
+ }, ra = {
206
+ key: 1,
207
+ class: "error-container"
208
+ }, ia = {
209
+ key: 2,
210
+ class: "pdf-editor-layout"
211
+ }, ca = { class: "pdf-tools-sidebar" }, da = { class: "card" }, ua = { class: "sidebar-form" }, va = { class: "form-field" }, fa = { class: "form-field form-field--spaced" }, pa = { class: "form-field form-field--spaced" }, ma = { class: "insert-buttons" }, ga = { class: "form-field form-field--spaced" }, ya = { class: "watermark-grid" }, ha = { class: "pdf-preview-container" }, ba = ["onClick", "onDblclick"], wa = { class: "page-selection" }, Ta = { class: "page-actions" }, xa = { class: "thumbnail-content" }, Ea = { class: "page-number" }, Pa = { class: "dialog-header" }, Ca = { class: "page-editor-toolbar" }, ka = { class: "zoom-indicator" }, Ia = { class: "editor-layout" }, Sa = { class: "tool-group" }, $a = {
212
+ key: 0,
213
+ class: "text-settings"
214
+ }, Aa = { class: "form-field" }, _a = { class: "form-label" }, Ma = { class: "form-field" }, Fa = {
215
+ class: "form-label",
216
+ for: "text-size-slider"
217
+ }, Na = { class: "form-field" }, Ra = {
218
+ class: "form-label",
219
+ id: "text-color-label"
220
+ }, La = {
221
+ class: "color-swatches",
222
+ role: "group",
223
+ "aria-labelledby": "text-color-label"
224
+ }, Da = ["aria-label", "aria-pressed", "onClick"], Ua = { class: "color-custom" }, Ha = ["aria-label", "placeholder", "onKeydown"], Ba = { class: "editor-footer" }, Oa = { class: "dialog-header" }, Va = { class: "signature-pad" }, za = { class: "dialog-footer-buttons" }, Wa = { class: "search-input-group" }, Ga = {
225
+ key: 0,
226
+ class: "inline-status"
227
+ }, Xa = {
228
+ key: 1,
229
+ class: "text-muted"
230
+ }, Ya = {
231
+ key: 2,
232
+ class: "favorites-layout"
233
+ }, ja = { class: "favorites-list" }, Ka = ["onClick"], qa = { class: "item-content" }, Ja = { class: "text-ellipsis" }, Za = { class: "favorites-preview" }, Qa = {
234
+ key: 0,
235
+ class: "preview-placeholder"
236
+ }, es = { class: "text-muted" }, ls = {
237
+ key: 1,
238
+ class: "preview-placeholder"
239
+ }, ts = { class: "text-muted" }, os = {
240
+ key: 2,
241
+ class: "preview-wrapper"
242
+ }, as = {
243
+ key: 0,
244
+ class: "preview-controls"
245
+ }, ss = { class: "page-info" }, ns = { class: "preview-content" }, rs = {
246
+ key: 0,
247
+ class: "inline-status"
248
+ }, is = {
249
+ key: 1,
250
+ class: "text-muted"
251
+ }, cs = {
252
+ key: 2,
253
+ class: "favorites-layout"
254
+ }, ds = { class: "favorites-list" }, us = ["onClick"], vs = { class: "item-content" }, fs = { class: "text-ellipsis" }, ps = { class: "favorites-preview" }, ms = {
255
+ key: 0,
256
+ class: "preview-placeholder"
257
+ }, gs = { class: "text-muted" }, ys = {
258
+ key: 1,
259
+ class: "preview-placeholder"
260
+ }, hs = { class: "text-muted" }, bs = {
261
+ key: 2,
262
+ class: "preview-wrapper"
263
+ }, ws = {
264
+ key: 0,
265
+ class: "preview-controls"
266
+ }, Ts = { class: "page-info" }, xs = { class: "preview-content" }, Es = { class: "sidebar-form" }, Ps = { class: "form-field" }, Cs = { for: "alfrescoNodeId" }, ks = { class: "form-hint" }, Is = { class: "insert-footer" }, Ss = { class: "insert-footer-info" }, $s = {
267
+ key: 0,
268
+ class: "selected-info"
269
+ }, As = { class: "selected-label" }, _s = { class: "selected-name" }, Ms = {
270
+ key: 1,
271
+ class: "error-msg"
272
+ }, Fs = { class: "insert-footer-actions" }, mt = 24, Ns = {
273
+ __name: "PdfToolsComponent",
274
+ props: {
275
+ toast: { type: Object, required: !0 },
276
+ id: { type: String, required: !0 },
277
+ // The host application decides where closing leads, so the button is only
278
+ // offered when it opts in and handles the event
279
+ closable: { type: Boolean, default: !1 }
280
+ },
281
+ emits: ["close"],
282
+ setup(P, { emit: k }) {
283
+ const { t: c } = gt(), w = P, G = k, A = v(!1), Y = () => {
284
+ A.value && !window.confirm(c("pdfTools.closeUnsaved")) || G("close");
285
+ }, R = v(null), y = v(null), F = v([]), T = v(!0), I = v(null), V = v(null), m = v([]), N = v(!1), H = v(null), Q = v(1), d = {
286
+ SELECT: "select",
287
+ REDACT: "redact",
288
+ HIGHLIGHT: "highlight",
289
+ COMMENT: "comment",
290
+ IMAGE: "image",
291
+ SIGNATURE: "signature",
292
+ TEXT: "text"
293
+ }, C = v(d.SELECT), p = v([]), Ce = v(null), ke = v(null), kl = v(null), D = v(null), Il = v(null), S = v({
294
+ visible: !1,
295
+ tool: null,
296
+ x: 0,
297
+ y: 0,
298
+ value: "",
299
+ index: -1
300
+ }), ve = v(!1), fe = v(null);
301
+ let sl = !1, Be = null, pe = !1, te = null;
302
+ const Ie = v(""), nl = v(-45), Se = v(5), bt = [
303
+ { label: "Helvetica", value: "Helvetica" },
304
+ { label: "Times New Roman", value: "TimesRoman" },
305
+ { label: "Courier", value: "Courier" }
306
+ ], wt = [
307
+ { name: "black", value: "#000000" },
308
+ { name: "white", value: "#ffffff" },
309
+ { name: "red", value: "#e53935" },
310
+ { name: "orange", value: "#fb8c00" },
311
+ { name: "yellow", value: "#fdd835" },
312
+ { name: "green", value: "#43a047" },
313
+ { name: "blue", value: "#1e88e5" },
314
+ { name: "purple", value: "#8e24aa" }
315
+ ], ae = v("Helvetica"), oe = v(18), J = v("#000000"), Tt = v(null), Oe = v(!1), Sl = v(null), $l = v(""), Ve = v(""), ze = v(null), We = v(null), $e = v(!1), se = v(""), ne = v(""), B = v(null), xt = Te(() => se.value && Fl(se.value) ? !0 : !!(B.value && B.value.id)), Ae = v(""), me = v([]), rl = v(!1), Al = v(!1), _e = v([]), Ge = v(!1), Xe = v(!1), ge = v(null), { pdf: Me } = dt(ut(ge)), X = v(1), j = v(0), ye = v(null), { pdf: Ye } = dt(ut(ye));
316
+ wo(() => {
317
+ const e = w.id;
318
+ e ? Pt(e) : (I.value = c("pdfTools.loadError"), T.value = !1);
319
+ });
320
+ const _l = (e) => m.value.some((l) => l.pageIndex === e.pageIndex), Et = (e) => {
321
+ V.value = e;
322
+ const l = m.value.findIndex(
323
+ (o) => o.pageIndex === e.pageIndex
324
+ );
325
+ l > -1 ? m.value.splice(l, 1) : m.value.push(e);
326
+ }, Pt = async (e) => {
327
+ T.value = !0, I.value = null;
328
+ try {
329
+ const l = await Ee.getNode(e);
330
+ ze.value = l, Tt.value = l.parentId, Ve.value = l && (l.name || l.properties && l.properties["cm:name"]) || "";
331
+ const o = Pl.getContentUrl(e);
332
+ ye.value = o;
333
+ const t = await fetch(o);
334
+ if (!t.ok)
335
+ throw new Error(`HTTP error! status: ${t.status}`);
336
+ const n = await t.arrayBuffer();
337
+ y.value = new Uint8Array(n), await Ml(y.value), F.value.length > 0 && (V.value = F.value[0]);
338
+ } catch (l) {
339
+ console.error("Error loading PDF from Alfresco:", l), I.value = c("pdfTools.loadError");
340
+ } finally {
341
+ T.value = !1;
342
+ }
343
+ }, Ml = async (e) => {
344
+ R.value = await O.load(e);
345
+ const l = R.value.getPageCount();
346
+ F.value = Array.from({ length: l }, (o, t) => ({
347
+ pageIndex: t,
348
+ pageNumber: t + 1
349
+ }));
350
+ }, re = async (e, { updatePages: l = !0 } = {}) => {
351
+ const o = await e.save();
352
+ y.value = o, A.value = !0;
353
+ const t = new Blob([o], { type: "application/pdf" });
354
+ ye.value && ye.value.startsWith("blob:") && URL.revokeObjectURL(ye.value), ye.value = URL.createObjectURL(t), l && await Ml(o);
355
+ }, Ct = async () => {
356
+ if (y.value) {
357
+ T.value = !0;
358
+ try {
359
+ const e = await O.create(), l = F.value.map((n) => n.pageIndex), o = await O.load(y.value);
360
+ (await e.copyPages(o, l)).forEach((n) => e.addPage(n)), await re(e);
361
+ } catch (e) {
362
+ console.error("Error reordering pages:", e), I.value = c("pdfTools.reorderError");
363
+ } finally {
364
+ T.value = !1;
365
+ }
366
+ }
367
+ }, kt = async (e) => {
368
+ if (y.value) {
369
+ T.value = !0;
370
+ try {
371
+ const l = await O.load(y.value), o = l.getPage(e.pageIndex), t = o.getRotation().angle;
372
+ o.setRotation({
373
+ type: Po.Degrees,
374
+ angle: (t + 90) % 360
375
+ }), await re(l, { updatePages: !1 });
376
+ } catch (l) {
377
+ console.error("Error rotating page:", l), I.value = c("pdfTools.rotateError");
378
+ } finally {
379
+ T.value = !1;
380
+ }
381
+ }
382
+ }, It = async () => {
383
+ if (m.value.length === 0 || !y.value)
384
+ return null;
385
+ const e = await O.create(), l = await O.load(y.value), o = m.value.map((n) => n.pageIndex).sort((n, a) => n - a);
386
+ return (await e.copyPages(l, o)).forEach((n) => e.addPage(n)), await e.save();
387
+ }, St = async () => {
388
+ if (!(!y.value || m.value.length === 0)) {
389
+ if (m.value.length === F.value.length) {
390
+ w.toast.add({
391
+ severity: "warn",
392
+ summary: c("pdfTools.common.warning"),
393
+ detail: c("pdfTools.deleteAllPagesWarning"),
394
+ life: 3e3
395
+ });
396
+ return;
397
+ }
398
+ T.value = !0;
399
+ try {
400
+ const e = await O.load(y.value), l = e.getPageCount(), o = new Set(m.value.map((u) => u.pageIndex)), t = [];
401
+ for (let u = 0; u < l; u++)
402
+ o.has(u) || t.push(u);
403
+ const n = await O.create();
404
+ (await n.copyPages(e, t)).forEach((u) => n.addPage(u)), await re(n), m.value = [], w.toast.add({
405
+ severity: "success",
406
+ summary: c("pdfTools.common.deleted"),
407
+ detail: c("pdfTools.pagesDeletedSuccess"),
408
+ life: 3e3
409
+ });
410
+ } catch (e) {
411
+ console.error("Error deleting pages:", e), I.value = c("pdfTools.deletePagesError");
412
+ } finally {
413
+ T.value = !1;
414
+ }
415
+ }
416
+ }, $t = async () => {
417
+ se.value = "", B.value = null, ne.value = "", $e.value = !0;
418
+ }, At = (e) => {
419
+ e === 2 && _e.value.length === 0 && !Ge.value && Ft();
420
+ }, _t = async () => {
421
+ let e = null;
422
+ if (B.value?.id ? e = B.value.id : se.value && (e = Fl(se.value)), !e) {
423
+ w.toast.add({
424
+ severity: "warn",
425
+ summary: c("pdfTools.common.warning"),
426
+ detail: c("pdfTools.insertFromAlfresco.invalidInput"),
427
+ life: 3e3
428
+ });
429
+ return;
430
+ }
431
+ await Nt(e), $e.value = !1;
432
+ }, Fl = (e) => {
433
+ if (!e)
434
+ return null;
435
+ const l = e.trim();
436
+ if (/^[0-9a-fA-F-]{20,}$/.test(l))
437
+ return l;
438
+ const o = l.match(/workspace:\/\/SpacesStore\/([0-9a-fA-F-]{20,})/);
439
+ if (o && o[1])
440
+ return o[1];
441
+ const t = l.match(
442
+ /\b(nodes|preview|renditions|content)\/?([0-9a-fA-F-]{20,})\b/
443
+ );
444
+ if (t && t[2])
445
+ return t[2];
446
+ const n = l.match(
447
+ /#\/(?:pdf-tools|consultation-pdf|edit-collabora)\/([0-9a-fA-F-]{20,})/
448
+ );
449
+ if (n && n[1])
450
+ return n[1];
451
+ const a = l.match(/([0-9a-fA-F]{20,})/);
452
+ return a && a[1] ? a[1] : null;
453
+ }, il = async (e) => {
454
+ if (e?.content?.mimeType === "application/pdf" && (B.value = e, ne.value = "", e?.id)) {
455
+ Xe.value = !0, X.value = 1, j.value = 0;
456
+ try {
457
+ const l = Pl.getContentUrl(e.id);
458
+ ge.value && ge.value.startsWith("blob:") && URL.revokeObjectURL(ge.value), ge.value = l;
459
+ } catch (l) {
460
+ console.error("Error loading PDF preview:", l), ge.value = null;
461
+ } finally {
462
+ Xe.value = !1;
463
+ }
464
+ }
465
+ }, Nl = () => {
466
+ X.value < j.value && X.value++;
467
+ }, Rl = () => {
468
+ X.value > 1 && X.value--;
469
+ }, Mt = (e) => {
470
+ ne.value = "", e.isFolder ? (B.value = null, ne.value = c(
471
+ "pdfTools.insertFromAlfresco.folderSelectError"
472
+ )) : e.content?.mimeType !== "application/pdf" ? (B.value = null, ne.value = c(
473
+ "pdfTools.insertFromAlfresco.fileTypeNotAllowedError"
474
+ )) : il(e);
475
+ }, Ll = async () => {
476
+ if (Al.value = !0, !Ae.value || Ae.value.trim().length < 2) {
477
+ me.value = [];
478
+ return;
479
+ }
480
+ rl.value = !0;
481
+ try {
482
+ const e = Fo();
483
+ await e.queryStore(Ae.value);
484
+ const l = e.entries.map((o) => o.entry || o);
485
+ me.value = l.filter(
486
+ (o) => o.isFile && o.content?.mimeType === "application/pdf"
487
+ );
488
+ } catch (e) {
489
+ console.error("performSearch", e), me.value = [];
490
+ } finally {
491
+ rl.value = !1;
492
+ }
493
+ }, Ft = async () => {
494
+ Ge.value = !0;
495
+ try {
496
+ const e = No();
497
+ await e.loadFavorites(), _e.value = e.fileFavorites.filter(
498
+ (l) => l?.target?.file?.content?.mimeType === "application/pdf"
499
+ ).map((l) => l.target.file);
500
+ } catch (e) {
501
+ console.error("loadFavorites error:", e), _e.value = [];
502
+ } finally {
503
+ Ge.value = !1;
504
+ }
505
+ }, Nt = async (e) => {
506
+ if (y.value) {
507
+ T.value = !0;
508
+ try {
509
+ if ((await Ee.getNode(e)).content?.mimeType !== "application/pdf")
510
+ throw new Error(c("pdfTools.invalidNodeForInsert"));
511
+ const t = await (await Ee.getNodeContent(e)).arrayBuffer(), n = new Uint8Array(t), a = await O.load(y.value), u = await O.load(n), x = u.getPageCount(), E = Array.from({ length: x }, (L, be) => be);
512
+ (await a.copyPages(u, E)).forEach((L) => a.addPage(L)), await re(a), m.value = [], w.toast.add({
513
+ severity: "success",
514
+ summary: c("pdfTools.common.success"),
515
+ detail: c("pdfTools.insertFromPristySuccess", { count: x }),
516
+ life: 3e3
517
+ });
518
+ } catch (l) {
519
+ console.error("Error inserting from Alfresco:", l), I.value = l?.message || c("pdfTools.insertFromPristyError"), w.toast.add({
520
+ severity: "error",
521
+ summary: c("pdfTools.common.error"),
522
+ detail: I.value,
523
+ life: 4e3
524
+ });
525
+ } finally {
526
+ T.value = !1;
527
+ }
528
+ }
529
+ }, Rt = async (e) => {
530
+ const l = e.files?.[0];
531
+ l && await Lt(l);
532
+ }, Lt = async (e) => {
533
+ if (y.value) {
534
+ T.value = !0;
535
+ try {
536
+ const l = await O.load(y.value), o = new Uint8Array(await e.arrayBuffer()), t = await O.load(o), n = t.getPageCount(), a = Array.from({ length: n }, (x, E) => E);
537
+ (await l.copyPages(t, a)).forEach((x) => l.addPage(x)), await re(l), m.value = [], w.toast.add({
538
+ severity: "success",
539
+ summary: c("pdfTools.common.success"),
540
+ detail: c("pdfTools.insertFromFileSuccess", { count: n }),
541
+ life: 3e3
542
+ });
543
+ } catch (l) {
544
+ console.error("Error inserting PDF:", l), I.value = c("pdfTools.insertError");
545
+ } finally {
546
+ T.value = !1;
547
+ }
548
+ }
549
+ }, Dt = async () => {
550
+ if (!(!Ie.value || m.value.length === 0 || !y.value)) {
551
+ T.value = !0;
552
+ try {
553
+ const e = await O.load(y.value), l = m.value.map((o) => o.pageIndex);
554
+ for (const o of l) {
555
+ const t = e.getPage(o), { width: n, height: a } = t.getSize();
556
+ for (let u = 0; u < Se.value; u++)
557
+ t.drawText(Ie.value, {
558
+ x: n / (Se.value + 1) * (u + 1) - 150,
559
+ y: a / (Se.value + 1) * (u + 1),
560
+ size: 50,
561
+ color: xl(0.95, 0.1, 0.1),
562
+ opacity: 0.5,
563
+ rotate: Eo(nl.value)
564
+ });
565
+ }
566
+ await re(e, { updatePages: !1 });
567
+ } catch (e) {
568
+ console.error("Error adding watermark:", e), I.value = c("pdfTools.watermarkError");
569
+ } finally {
570
+ T.value = !1;
571
+ }
572
+ }
573
+ }, Ut = async () => {
574
+ if (y.value) {
575
+ T.value = !0;
576
+ try {
577
+ const e = new Blob([y.value], {
578
+ type: "application/pdf"
579
+ }), l = new File([e], "modified.pdf", { type: "application/pdf" }), o = {
580
+ majorVersion: !0,
581
+ comment: "File modified via Pristy Espaces PDF tools"
582
+ };
583
+ await Ee.updateContentNode(w.id, l, o), A.value = !1, w.toast.add({
584
+ severity: "success",
585
+ summary: c("pdfTools.common.success"),
586
+ detail: c("pdfTools.saveSuccess"),
587
+ life: 3e3
588
+ });
589
+ } catch (e) {
590
+ console.error("Error saving changes:", e), w.toast.add({
591
+ severity: "error",
592
+ summary: c("pdfTools.common.error"),
593
+ detail: c("pdfTools.saveError"),
594
+ life: 3e3
595
+ });
596
+ } finally {
597
+ T.value = !1;
598
+ }
599
+ }
600
+ }, Dl = async (e) => {
601
+ if (Sl.value = e, $l.value = c("pdfTools.saveAs.defaultFilename"), ze.value && ze.value.parentId)
602
+ try {
603
+ We.value = await Ee.getNode(
604
+ ze.value.parentId
605
+ );
606
+ } catch (l) {
607
+ console.error("Could not fetch parent node for Save As dialog", l), We.value = null;
608
+ }
609
+ else
610
+ We.value = null;
611
+ Oe.value = !0;
612
+ }, Ht = async ({ filename: e, folderId: l }) => {
613
+ Oe.value = !1, T.value = !0;
614
+ try {
615
+ let o;
616
+ if (Sl.value === "extract" ? o = await It() : o = y.value, !o)
617
+ throw new Error(c("pdfTools.noContentToSave"));
618
+ const t = new Blob([o], { type: "application/pdf" }), n = new File([t], e, { type: "application/pdf" });
619
+ if (!l)
620
+ throw new Error("No destination folder selected.");
621
+ await Pl.uploadFile(l, {}, n), w.toast.add({
622
+ severity: "success",
623
+ summary: c("pdfTools.common.success"),
624
+ detail: c("pdfTools.fileCreatedSuccess", { filename: e }),
625
+ life: 3e3
626
+ });
627
+ } catch (o) {
628
+ console.error('Error during "Save As":', o);
629
+ const t = o.status === 409 ? c("pdfTools.saveAs.conflictError") : c("pdfTools.saveAsError");
630
+ w.toast.add({
631
+ severity: "error",
632
+ summary: c("pdfTools.common.error"),
633
+ detail: t,
634
+ life: 4e3
635
+ });
636
+ } finally {
637
+ T.value = !1;
638
+ }
639
+ }, Ul = async () => {
640
+ const e = H.value;
641
+ if (p.value = p.value.filter(
642
+ (l) => l.type !== d.COMMENT
643
+ ), !y.value || !e) {
644
+ _();
645
+ return;
646
+ }
647
+ try {
648
+ const l = await O.load(y.value), o = zl(), t = Xt.value;
649
+ for (const n of Yo(l.getPage(e.pageIndex)))
650
+ p.value.push({
651
+ type: d.COMMENT,
652
+ rect: {
653
+ x: n.x * o,
654
+ // PDF coordinates start from the bottom, the overlay from the top
655
+ y: (t - (n.y + n.size)) * o,
656
+ w: n.size * o,
657
+ h: n.size * o
658
+ },
659
+ payload: { text: n.text }
660
+ });
661
+ } catch (l) {
662
+ console.error("Error reading existing comments:", l);
663
+ }
664
+ _();
665
+ }, Hl = (e) => {
666
+ H.value = e || V.value, N.value = !0, Q.value = 1, p.value = [], z.value = -1, setTimeout(() => {
667
+ ie(), Ul();
668
+ }, 200);
669
+ }, Bl = () => {
670
+ N.value = !1, H.value = null;
671
+ }, Bt = () => {
672
+ Q.value = Math.min(4, Q.value + 0.1);
673
+ }, Ot = () => {
674
+ Q.value = Math.max(0.2, Q.value - 0.1);
675
+ }, Fe = (e) => {
676
+ e === d.REDACT ? window.confirm(c("pdfTools.redactWarning")) && (C.value = e) : C.value = e;
677
+ }, Vt = (e) => {
678
+ Ce.value = e.files?.[0] || null, Ce.value && (ke.value = null, C.value = d.IMAGE);
679
+ }, zt = () => {
680
+ ve.value = !0;
681
+ }, Wt = () => {
682
+ p.value.pop(), z.value = -1, _();
683
+ }, Ol = async (e) => {
684
+ if (!(!e || e.type !== d.IMAGE || e._loading || e._bitmap)) {
685
+ e._loading = !0;
686
+ try {
687
+ let l = null;
688
+ e.payload?.file ? l = e.payload.file : e.payload?.signature && (l = new Blob([new Uint8Array(e.payload.signature)], {
689
+ type: "image/png"
690
+ })), l && (e._bitmap = await createImageBitmap(l), _());
691
+ } catch (l) {
692
+ console.warn(c("pdfTools.imagePreviewUnavailable"), l);
693
+ } finally {
694
+ e._loading = !1;
695
+ }
696
+ }
697
+ }, Vl = () => {
698
+ const e = kl.value;
699
+ if (!e)
700
+ return null;
701
+ const l = Array.from(e.querySelectorAll("canvas"));
702
+ if (l.length === 0)
703
+ return null;
704
+ const o = l.filter(
705
+ (u) => u.offsetParent !== null && u.width > 0 && u.height > 0
706
+ ), t = o.length ? o : l;
707
+ let n = t[0], a = 0;
708
+ for (const u of t) {
709
+ const x = u.getBoundingClientRect(), E = Math.max(0, x.width) * Math.max(0, x.height);
710
+ E > a && (n = u, a = E);
711
+ }
712
+ return n;
713
+ }, ie = () => {
714
+ const e = Vl();
715
+ if (!e || !D.value)
716
+ return;
717
+ const l = e.getBoundingClientRect(), o = window.devicePixelRatio || 1;
718
+ D.value.style.width = l.width + "px", D.value.style.height = l.height + "px", D.value.width = Math.round(l.width * o), D.value.height = Math.round(l.height * o), _();
719
+ }, he = (e) => {
720
+ const l = D.value;
721
+ if (!l)
722
+ return { x: 0, y: 0 };
723
+ const o = l.getBoundingClientRect(), t = window.devicePixelRatio || 1;
724
+ return {
725
+ x: (e.clientX - o.left) * t,
726
+ y: (e.clientY - o.top) * t
727
+ };
728
+ };
729
+ let Ne = null, Z = null, Re = null, ce = null;
730
+ const Gt = Te(() => {
731
+ const e = H.value || V.value;
732
+ if (!R.value || !e)
733
+ return 0;
734
+ try {
735
+ return R.value.getPage(e.pageIndex).getSize().width;
736
+ } catch {
737
+ return 0;
738
+ }
739
+ }), Xt = Te(() => {
740
+ const e = H.value || V.value;
741
+ if (!R.value || !e)
742
+ return 0;
743
+ try {
744
+ return R.value.getPage(e.pageIndex).getSize().height;
745
+ } catch {
746
+ return 0;
747
+ }
748
+ }), zl = () => ea({
749
+ overlayWidth: D.value?.width || 0,
750
+ pageWidthPt: Gt.value
751
+ }), cl = (e) => Math.max(1, (Number(e?.size) || 18) * zl()), Wl = (e, l) => {
752
+ const o = D.value.getContext("2d"), t = cl(l);
753
+ o.save(), o.font = `${t}px ${l.font || "Helvetica"}`;
754
+ const n = la({
755
+ lines: Cl(e),
756
+ fontSize: t,
757
+ measureLine: (a) => o.measureText(a).width
758
+ });
759
+ return o.restore(), n;
760
+ }, Yt = Te(() => {
761
+ const e = window.devicePixelRatio || 1;
762
+ if (S.value.tool === d.COMMENT)
763
+ return {
764
+ left: `${S.value.x / e}px`,
765
+ top: `${S.value.y / e}px`
766
+ };
767
+ const l = S.value.index >= 0 ? p.value[S.value.index]?.payload : { size: oe.value, font: ae.value, color: J.value }, o = cl(l) / e;
768
+ return {
769
+ left: `${S.value.x / e}px`,
770
+ top: `${S.value.y / e}px`,
771
+ font: `${o}px ${l?.font || "Helvetica"}`,
772
+ lineHeight: al,
773
+ color: l?.color || "#000000"
774
+ };
775
+ }), z = v(-1);
776
+ let dl = !1;
777
+ const jt = Te(
778
+ () => C.value === d.TEXT || p.value[z.value]?.type === d.TEXT
779
+ ), Kt = (e) => {
780
+ z.value = e;
781
+ const l = p.value[e];
782
+ l?.type === d.TEXT && (dl = !0, ae.value = l.payload?.font || "Helvetica", oe.value = Number(l.payload?.size) || 18, J.value = l.payload?.color || "#000000", it(() => {
783
+ dl = !1;
784
+ })), _();
785
+ };
786
+ xe([ae, oe, J], () => {
787
+ if (dl)
788
+ return;
789
+ const e = z.value, l = p.value[e];
790
+ if (!l || l.type !== d.TEXT)
791
+ return;
792
+ const o = {
793
+ ...l.payload,
794
+ font: ae.value,
795
+ size: oe.value,
796
+ color: J.value
797
+ };
798
+ p.value[e] = {
799
+ ...l,
800
+ payload: o,
801
+ rect: {
802
+ x: l.rect.x,
803
+ y: l.rect.y,
804
+ ...Wl(o.text, o)
805
+ }
806
+ }, _();
807
+ });
808
+ const Gl = () => {
809
+ const e = z.value;
810
+ e < 0 || !p.value[e] || (p.value.splice(e, 1), z.value = -1, _());
811
+ }, ul = (e) => {
812
+ if (e.key === "Escape") {
813
+ S.value.visible && qt(), z.value = -1, C.value = d.SELECT, _();
814
+ return;
815
+ }
816
+ const l = S.value.visible || ["INPUT", "TEXTAREA", "SELECT"].includes(e.target?.tagName);
817
+ e.key === "Delete" && !l && Gl();
818
+ };
819
+ xe(N, (e) => {
820
+ e ? document.addEventListener("keydown", ul) : document.removeEventListener("keydown", ul);
821
+ }), To(() => document.removeEventListener("keydown", ul));
822
+ const Xl = Te(
823
+ () => S.value.tool === d.COMMENT ? {
824
+ label: c("pdfTools.pageEditor.tools.comment"),
825
+ placeholder: c("pdfTools.pageEditor.commentPlaceholder")
826
+ } : {
827
+ label: c("pdfTools.pageEditor.textInputLabel"),
828
+ placeholder: c("pdfTools.pageEditor.textInputPlaceholder")
829
+ }
830
+ ), Yl = (e, l, o = -1) => {
831
+ const t = o >= 0 ? p.value[o] : null;
832
+ S.value = {
833
+ visible: !0,
834
+ tool: l,
835
+ x: t ? t.rect.x : e.x,
836
+ y: t ? t.rect.y : e.y,
837
+ value: t ? String(t.payload?.text || "") : "",
838
+ index: o
839
+ }, _(), it(() => Il.value?.focus());
840
+ }, qt = () => {
841
+ S.value = { ...S.value, visible: !1, index: -1 }, _();
842
+ }, vl = () => {
843
+ if (!S.value.visible)
844
+ return;
845
+ const { value: e, index: l, x: o, y: t, tool: n } = S.value;
846
+ if (S.value = { ...S.value, visible: !1, index: -1 }, !e.trim()) {
847
+ l >= 0 && p.value.splice(l, 1), _();
848
+ return;
849
+ }
850
+ if (n === d.COMMENT) {
851
+ const x = {
852
+ type: d.COMMENT,
853
+ rect: { x: o, y: t, w: mt, h: mt },
854
+ payload: { text: e }
855
+ };
856
+ l >= 0 ? p.value[l] = {
857
+ ...p.value[l],
858
+ payload: { text: e }
859
+ } : p.value.push(x), z.value = l >= 0 ? l : p.value.length - 1, _();
860
+ return;
861
+ }
862
+ const a = l >= 0 ? { ...p.value[l].payload, text: e } : {
863
+ text: e,
864
+ font: ae.value,
865
+ size: oe.value,
866
+ color: J.value
867
+ }, u = { x: o, y: t, ...Wl(e, a) };
868
+ l >= 0 ? p.value[l] = {
869
+ ...p.value[l],
870
+ rect: u,
871
+ payload: a
872
+ } : p.value.push({ type: d.TEXT, rect: u, payload: a }), z.value = l >= 0 ? l : p.value.length - 1, _();
873
+ }, Jt = (e) => {
874
+ const l = he(e), o = jl(l), t = o !== -1 ? p.value[o].type : null;
875
+ (t === d.TEXT || t === d.COMMENT) && Yl(l, t, o);
876
+ }, jl = (e) => {
877
+ for (let l = p.value.length - 1; l >= 0; l--) {
878
+ const o = p.value[l].rect;
879
+ if (e.x >= o.x && e.x <= o.x + o.w && e.y >= o.y && e.y <= o.y + o.h)
880
+ return l;
881
+ }
882
+ return -1;
883
+ }, Zt = (e) => {
884
+ const t = 6 * (window.devicePixelRatio || 1) / 2;
885
+ for (let n = p.value.length - 1; n >= 0; n--) {
886
+ const a = p.value[n];
887
+ if (a.type !== d.IMAGE)
888
+ continue;
889
+ const u = a.rect, x = [
890
+ { key: "tl", x: u.x, y: u.y },
891
+ { key: "tr", x: u.x + u.w, y: u.y },
892
+ { key: "bl", x: u.x, y: u.y + u.h },
893
+ { key: "br", x: u.x + u.w, y: u.y + u.h }
894
+ ];
895
+ for (const E of x)
896
+ if (e.x >= E.x - t && e.x <= E.x + t && e.y >= E.y - t && e.y <= E.y + t)
897
+ return { idx: n, corner: E.key };
898
+ }
899
+ return null;
900
+ }, Qt = (e) => {
901
+ if (S.value.visible && vl(), C.value === d.REDACT || C.value === d.HIGHLIGHT)
902
+ pe = !0, te = he(e);
903
+ else if (C.value === d.IMAGE || C.value === d.SELECT || C.value === d.TEXT || C.value === d.COMMENT) {
904
+ const l = he(e), o = Zt(l);
905
+ if (o) {
906
+ Re = o.idx, ce = o.corner, Z = { p: l, rect: { ...p.value[o.idx].rect } }, D.value && (D.value.style.cursor = "nwse-resize");
907
+ return;
908
+ }
909
+ const t = jl(l);
910
+ if (t !== -1 && (p.value[t].type === d.IMAGE || p.value[t].type === d.TEXT || p.value[t].type === d.COMMENT)) {
911
+ Kt(t), Ne = t, Z = { p: l, rect: { ...p.value[t].rect } }, D.value && (D.value.style.cursor = "move");
912
+ return;
913
+ }
914
+ if (z.value = -1, C.value === d.TEXT || C.value === d.COMMENT) {
915
+ e.preventDefault(), Yl(l, C.value);
916
+ return;
917
+ }
918
+ if (C.value === d.IMAGE) {
919
+ if (!Ce.value && !ke.value)
920
+ return;
921
+ const n = {
922
+ type: d.IMAGE,
923
+ rect: { x: l.x, y: l.y, w: 150, h: 100 },
924
+ payload: {
925
+ file: Ce.value,
926
+ signature: ke.value
927
+ }
928
+ };
929
+ p.value.push(n), Ol(n), _(), C.value = d.SELECT, Ce.value = null, ke.value = null;
930
+ }
931
+ }
932
+ }, eo = (e) => {
933
+ if (Re !== null && ce) {
934
+ const o = he(e), t = p.value[Re];
935
+ if (t) {
936
+ const n = Z.rect;
937
+ let a = n.x, u = n.y, x = n.w, E = n.h;
938
+ const W = o.x - Z.p.x, L = o.y - Z.p.y;
939
+ ce === "br" ? (x = Math.max(10, n.w + W), E = Math.max(10, n.h + L)) : ce === "tr" ? (x = Math.max(10, n.w + W), E = Math.max(10, n.h - L), u = n.y + L) : ce === "bl" ? (x = Math.max(10, n.w - W), a = n.x + W, E = Math.max(10, n.h + L)) : ce === "tl" && (x = Math.max(10, n.w - W), a = n.x + W, E = Math.max(10, n.h - L), u = n.y + L), t.rect.x = a, t.rect.y = u, t.rect.w = x, t.rect.h = E, _();
940
+ }
941
+ return;
942
+ }
943
+ if (Ne !== null) {
944
+ const o = he(e), t = p.value[Ne];
945
+ if (t) {
946
+ const n = o.x - Z.p.x, a = o.y - Z.p.y;
947
+ t.rect.x = Z.rect.x + n, t.rect.y = Z.rect.y + a, _();
948
+ }
949
+ return;
950
+ }
951
+ if (!pe || !te)
952
+ return;
953
+ const l = he(e);
954
+ de.value = {
955
+ x: Math.min(te.x, l.x),
956
+ y: Math.min(te.y, l.y),
957
+ w: Math.abs(l.x - te.x),
958
+ h: Math.abs(l.y - te.y)
959
+ }, _();
960
+ }, lo = () => {
961
+ if (Ne !== null || Re !== null) {
962
+ Ne = null, Re = null, ce = null, Z = null, D.value && (D.value.style.cursor = "crosshair"), _();
963
+ return;
964
+ }
965
+ pe && de.value && p.value.push({
966
+ type: C.value,
967
+ rect: { ...de.value }
968
+ }), pe = !1, te = null, de.value = null, _();
969
+ }, to = () => {
970
+ pe && (pe = !1, te = null, de.value = null, _());
971
+ }, de = v(null), _ = () => {
972
+ const e = z.value, l = D.value;
973
+ if (!l)
974
+ return;
975
+ const o = l.getContext("2d"), t = window.devicePixelRatio || 1;
976
+ o.clearRect(0, 0, l.width, l.height);
977
+ const n = (a, u) => {
978
+ if (!(S.value.visible && u === S.value.index)) {
979
+ if (a.type === d.REDACT)
980
+ o.fillStyle = "rgba(0,0,0,1)", o.fillRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), o.strokeStyle = "rgba(0,0,0,1)", o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h);
981
+ else if (a.type === d.HIGHLIGHT)
982
+ o.fillStyle = "rgba(255, 235, 59, 0.4)", o.fillRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), o.strokeStyle = "rgba(255, 193, 7, 0.8)", o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h);
983
+ else if (a.type === d.COMMENT)
984
+ ao(o, a.rect.x, a.rect.y, 20 * t), u === e && (o.save(), o.strokeStyle = "#0ea5e9", o.lineWidth = 2 * t, o.setLineDash([4 * t, 4 * t]), o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), o.restore());
985
+ else if (a.type === d.IMAGE) {
986
+ if (Ol(a), a._bitmap && o.drawImage(
987
+ a._bitmap,
988
+ a.rect.x,
989
+ a.rect.y,
990
+ a.rect.w,
991
+ a.rect.h
992
+ ), o.strokeStyle = u === e ? "#0ea5e9" : "rgba(33,150,243,0.9)", o.lineWidth = u === e ? 2 * t : 1 * t, o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), u === e) {
993
+ o.fillStyle = "#0ea5e9";
994
+ const x = 6 * t, E = x / 2;
995
+ [
996
+ [a.rect.x, a.rect.y],
997
+ [a.rect.x + a.rect.w, a.rect.y],
998
+ [a.rect.x, a.rect.y + a.rect.h],
999
+ [a.rect.x + a.rect.w, a.rect.y + a.rect.h]
1000
+ ].forEach(([L, be]) => {
1001
+ o.fillRect(L - E, be - E, x, x);
1002
+ });
1003
+ }
1004
+ } else if (a.type === d.TEXT) {
1005
+ const x = a.payload || {}, E = cl(x);
1006
+ o.save(), o.fillStyle = x.color || "#000", o.font = `${E}px ${x.font || "Helvetica"}`, o.textBaseline = "top";
1007
+ let W = a.rect.y;
1008
+ for (const L of Cl(x.text))
1009
+ o.fillText(L, a.rect.x, W), W += E * al;
1010
+ o.restore(), o.save(), o.strokeStyle = u === e ? "#0ea5e9" : "rgba(33,150,243,0.5)", o.lineWidth = u === e ? 2 * t : 1 * t, o.setLineDash([4 * t, 4 * t]), o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), o.restore();
1011
+ }
1012
+ }
1013
+ };
1014
+ if (p.value.forEach(n), de.value) {
1015
+ const a = de.value;
1016
+ o.setLineDash([6 * t, 4 * t]), o.strokeStyle = C.value === d.REDACT ? "black" : "goldenrod", o.strokeRect(a.x, a.y, a.w, a.h), o.setLineDash([]);
1017
+ }
1018
+ }, oo = (e) => {
1019
+ let l = e.toString().trim();
1020
+ l.startsWith("#") && (l = l.slice(1)), l.length === 3 && (l = l.split("").map((u) => u + u).join(""));
1021
+ const o = parseInt(l || "000000", 16), t = (o >> 16 & 255) / 255, n = (o >> 8 & 255) / 255, a = (o & 255) / 255;
1022
+ return { r: t, g: n, b: a };
1023
+ }, ao = (e, l, o, t) => {
1024
+ e.save(), e.translate(l, o), e.fillStyle = "#FFEB3B", e.strokeStyle = "#FBC02D", e.lineWidth = 2, e.beginPath(), e.rect(0, 0, t, t), e.fill(), e.stroke(), e.beginPath(), e.moveTo(t * 0.6, 0), e.lineTo(t, t * 0.4), e.lineTo(t * 0.6, t * 0.4), e.closePath(), e.fillStyle = "#FDD835", e.fill(), e.restore();
1025
+ }, so = async () => {
1026
+ if (!(!y.value || !H.value)) {
1027
+ T.value = !0;
1028
+ try {
1029
+ const e = await O.load(y.value), l = H.value.pageIndex;
1030
+ let o = e.getPage(l);
1031
+ const { width: t, height: n } = o.getSize(), a = Vl();
1032
+ if (!a)
1033
+ throw new Error(c("pdfTools.pdfRenderCanvasNotFound"));
1034
+ if (p.value.some(
1035
+ (M) => M.type === d.REDACT
1036
+ )) {
1037
+ if (!window.confirm(c("pdfTools.redactFlattenConfirm"))) {
1038
+ T.value = !1;
1039
+ return;
1040
+ }
1041
+ const pl = await (await Ye.value.promise).getPage(l + 1), we = D.value, ml = await Zo({
1042
+ pdfPage: pl,
1043
+ // Masks are converted to page fractions so they no longer depend on
1044
+ // the screen resolution nor on the current zoom level.
1045
+ redactions: p.value.filter((ee) => ee.type === d.REDACT).map((ee) => ({
1046
+ x: ee.rect.x / we.width,
1047
+ y: ee.rect.y / we.height,
1048
+ w: ee.rect.w / we.width,
1049
+ h: ee.rect.h / we.height
1050
+ }))
1051
+ }), gl = await (await fetch(ml)).arrayBuffer(), yl = await e.embedJpg(gl), je = e.insertPage(l + 1, [t, n]);
1052
+ je.drawImage(yl, { x: 0, y: 0, width: t, height: n }), o = je;
1053
+ }
1054
+ const x = a.getBoundingClientRect(), E = a.width, W = a.height, L = window.devicePixelRatio || 1, be = E / x.width, Ql = W / x.height, et = t / E, lt = n / W;
1055
+ jo(o);
1056
+ for (const M of p.value) {
1057
+ const ot = M.rect.x / L, pl = M.rect.y / L, we = M.rect.w / L, ml = M.rect.h / L, gl = ot * be, yl = pl * Ql, je = we * be, ee = ml * Ql, hl = je * et, bl = ee * lt, Ke = gl * et, qe = n - (yl + ee) * lt;
1058
+ if (M.type !== d.REDACT) {
1059
+ if (M.type === d.HIGHLIGHT)
1060
+ o.drawRectangle({
1061
+ x: Ke,
1062
+ y: qe,
1063
+ width: hl,
1064
+ height: bl,
1065
+ color: xl(1, 0.92, 0.23),
1066
+ opacity: 0.4
1067
+ });
1068
+ else if (M.type === d.COMMENT)
1069
+ Xo({
1070
+ doc: e,
1071
+ page: o,
1072
+ rect: { x: Ke, y: qe, size: Math.max(14, hl) },
1073
+ text: M.payload?.text,
1074
+ title: c("pdfTools.pageEditor.tools.comment")
1075
+ });
1076
+ else if (M.type === d.IMAGE) {
1077
+ let K = null;
1078
+ if (M.payload?.file ? K = await M.payload.file.arrayBuffer() : M.payload?.signature && (K = M.payload.signature), K) {
1079
+ let Le;
1080
+ try {
1081
+ Le = await e.embedPng(K);
1082
+ } catch {
1083
+ Le = await e.embedJpg(K);
1084
+ }
1085
+ o.drawImage(Le, { x: Ke, y: qe, width: hl, height: bl, opacity: 0.98 });
1086
+ }
1087
+ } else if (M.type === d.TEXT) {
1088
+ const K = M.payload || {}, Le = K.font === "TimesRoman" ? El.TimesRoman : K.font === "Courier" ? El.Courier : El.Helvetica, wl = await e.embedFont(Le), Tl = Math.max(6, Number(K.size) || 18), {
1089
+ r: po,
1090
+ g: mo,
1091
+ b: go
1092
+ } = oo(K.color || "#000000"), yo = qe + bl, ho = wl.heightAtSize(Tl, { descender: !1 });
1093
+ Cl(K.text).forEach((at, bo) => {
1094
+ at && o.drawText(at, {
1095
+ x: Ke,
1096
+ y: ta({
1097
+ topY: yo,
1098
+ lineIndex: bo,
1099
+ fontSize: Tl,
1100
+ ascentPt: ho
1101
+ }),
1102
+ size: Tl,
1103
+ font: wl,
1104
+ color: xl(po, mo, go)
1105
+ });
1106
+ });
1107
+ }
1108
+ }
1109
+ }
1110
+ const tt = p.value.some(
1111
+ (M) => M.type === d.REDACT
1112
+ );
1113
+ tt && e.removePage(l), await re(e, { updatePages: tt }), p.value = [], z.value = -1, await Ul(), w.toast.add({
1114
+ severity: "success",
1115
+ summary: c("pdfTools.common.success"),
1116
+ detail: c("pdfTools.pageEditor.applySuccess"),
1117
+ life: 2e3
1118
+ });
1119
+ } catch (e) {
1120
+ console.error("Error applying overlay edits:", e), w.toast.add({
1121
+ severity: "error",
1122
+ summary: c("pdfTools.common.error"),
1123
+ detail: c("pdfTools.pageEditor.applyError"),
1124
+ life: 3e3
1125
+ });
1126
+ } finally {
1127
+ T.value = !1;
1128
+ }
1129
+ }
1130
+ };
1131
+ xe(Q, () => setTimeout(ie, 0)), xe(H, () => setTimeout(ie, 0)), typeof window < "u" && window.addEventListener("resize", () => setTimeout(ie, 0));
1132
+ const no = () => {
1133
+ Q.value = 1, setTimeout(ie, 0);
1134
+ }, ro = () => {
1135
+ const e = fe.value;
1136
+ if (!e)
1137
+ return;
1138
+ const l = window.devicePixelRatio || 1, o = 440, t = 180;
1139
+ e.style.width = o + "px", e.style.height = t + "px", e.width = Math.round(o * l), e.height = Math.round(t * l);
1140
+ const n = e.getContext("2d");
1141
+ n.fillStyle = "#fff", n.fillRect(0, 0, e.width, e.height);
1142
+ }, io = () => {
1143
+ Zl(), ve.value = !1;
1144
+ }, Kl = (e) => {
1145
+ sl = !0, Be = Jl(e);
1146
+ }, ql = (e) => {
1147
+ if (!sl)
1148
+ return;
1149
+ const l = Jl(e);
1150
+ vo(Be, l), Be = l;
1151
+ }, co = (e) => Kl(e.touches[0]), uo = (e) => ql(e.touches[0]), fl = () => {
1152
+ sl = !1, Be = null;
1153
+ }, Jl = (e) => {
1154
+ const o = fe.value.getBoundingClientRect(), t = window.devicePixelRatio || 1, n = e.clientX ?? e.pageX, a = e.clientY ?? e.pageY;
1155
+ return { x: (n - o.left) * t, y: (a - o.top) * t };
1156
+ }, vo = (e, l) => {
1157
+ const t = fe.value.getContext("2d");
1158
+ t.strokeStyle = "#111827", t.lineWidth = 3 * (window.devicePixelRatio || 1), t.lineCap = "round", t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(l.x, l.y), t.stroke();
1159
+ }, Zl = () => {
1160
+ const e = fe.value;
1161
+ if (!e)
1162
+ return;
1163
+ const l = e.getContext("2d");
1164
+ l.fillStyle = "#fff", l.fillRect(0, 0, e.width, e.height);
1165
+ }, fo = () => {
1166
+ const e = fe.value;
1167
+ e && e.toBlob(async (l) => {
1168
+ ke.value = await l.arrayBuffer(), C.value = d.IMAGE, ve.value = !1;
1169
+ });
1170
+ };
1171
+ return xe(ve, (e) => {
1172
+ e && setTimeout(ro, 0);
1173
+ }), xe(Me, async (e) => {
1174
+ if (!e) {
1175
+ j.value = 0;
1176
+ return;
1177
+ }
1178
+ try {
1179
+ const l = await e;
1180
+ j.value = l.numPages;
1181
+ } catch (l) {
1182
+ console.error("Error loading preview PDF:", l), j.value = 0;
1183
+ }
1184
+ }), (e, l) => {
1185
+ const o = xo("tooltip");
1186
+ return g(), h("div", oa, [
1187
+ s("div", aa, [
1188
+ s("h1", null, [
1189
+ le(f(e.$t("pdfTools.title")) + " ", 1),
1190
+ Ve.value ? (g(), h("span", sa, "— " + f(Ve.value), 1)) : U("", !0)
1191
+ ]),
1192
+ P.closable ? (g(), tl(r(b), {
1193
+ key: 0,
1194
+ severity: "secondary",
1195
+ class: "flex-shrink-0",
1196
+ icon: "ri-close-line",
1197
+ label: e.$t("pdfTools.closeEditor"),
1198
+ onClick: Y
1199
+ }, null, 8, ["label"])) : U("", !0)
1200
+ ]),
1201
+ T.value ? (g(), h("div", na, [
1202
+ i(r(Ue)),
1203
+ s("p", null, f(e.$t("pdfTools.loading")), 1)
1204
+ ])) : U("", !0),
1205
+ I.value ? (g(), h("div", ra, [
1206
+ i(r(ko), { severity: "error" }, {
1207
+ default: $(() => [
1208
+ le(f(I.value), 1)
1209
+ ]),
1210
+ _: 1
1211
+ })
1212
+ ])) : U("", !0),
1213
+ !T.value && !I.value ? (g(), h("div", ia, [
1214
+ s("div", ca, [
1215
+ s("div", da, [
1216
+ s("h2", null, f(e.$t("pdfTools.sidebar.actions")), 1),
1217
+ s("div", ua, [
1218
+ i(r(b), {
1219
+ icon: "ri-save-2-line",
1220
+ label: e.$t("pdfTools.sidebar.saveNewVersion"),
1221
+ onClick: Ut
1222
+ }, null, 8, ["label"]),
1223
+ i(r(b), {
1224
+ severity: "secondary",
1225
+ class: "btn-mt",
1226
+ icon: "ri-file-copy-2-line",
1227
+ label: e.$t("pdfTools.sidebar.saveAs"),
1228
+ onClick: l[0] || (l[0] = (t) => Dl("saveAs"))
1229
+ }, null, 8, ["label"]),
1230
+ i(r(pt)),
1231
+ s("div", va, [
1232
+ s("h3", null, f(e.$t("pdfTools.sidebar.extractPages")), 1),
1233
+ i(r(b), {
1234
+ disabled: m.value.length === 0,
1235
+ icon: "ri-file-transfer-line",
1236
+ label: e.$t("pdfTools.sidebar.extractAndSave"),
1237
+ onClick: l[1] || (l[1] = (t) => Dl("extract"))
1238
+ }, null, 8, ["disabled", "label"])
1239
+ ]),
1240
+ s("div", fa, [
1241
+ s("h3", null, f(e.$t("pdfTools.sidebar.deletePages")), 1),
1242
+ i(r(b), {
1243
+ disabled: m.value.length === 0 || F.value.length === m.value.length,
1244
+ severity: "danger",
1245
+ icon: "ri-delete-bin-line",
1246
+ label: e.$t("pdfTools.sidebar.deleteSelectedPages"),
1247
+ onClick: St
1248
+ }, null, 8, ["disabled", "label"])
1249
+ ]),
1250
+ s("div", pa, [
1251
+ s("h3", null, f(e.$t("pdfTools.sidebar.insertPdf")), 1),
1252
+ s("div", ma, [
1253
+ i(r(ft), {
1254
+ auto: !1,
1255
+ customUpload: !1,
1256
+ showCancelButton: !1,
1257
+ showUploadButton: !1,
1258
+ accept: "application/pdf",
1259
+ "choose-label": e.$t("pdfTools.sidebar.fromComputer"),
1260
+ severity: "secondary",
1261
+ class: "btn-full",
1262
+ mode: "basic",
1263
+ name: "pdfToInsert",
1264
+ onSelect: Rt
1265
+ }, null, 8, ["choose-label"]),
1266
+ i(r(b), {
1267
+ severity: "secondary",
1268
+ icon: "ri-cloud-line",
1269
+ label: e.$t("pdfTools.sidebar.fromPristy"),
1270
+ onClick: $t
1271
+ }, null, 8, ["label"])
1272
+ ])
1273
+ ]),
1274
+ s("div", ga, [
1275
+ s("h3", null, f(e.$t("pdfTools.sidebar.addWatermark")), 1),
1276
+ i(r(He), {
1277
+ modelValue: Ie.value,
1278
+ "onUpdate:modelValue": l[2] || (l[2] = (t) => Ie.value = t),
1279
+ placeholder: e.$t("pdfTools.sidebar.watermarkTextPlaceholder"),
1280
+ type: "text"
1281
+ }, null, 8, ["modelValue", "placeholder"]),
1282
+ s("div", ya, [
1283
+ s("div", null, [
1284
+ i(r(vt), {
1285
+ modelValue: nl.value,
1286
+ "onUpdate:modelValue": l[3] || (l[3] = (t) => nl.value = t),
1287
+ max: 360,
1288
+ min: -360,
1289
+ placeholder: e.$t("pdfTools.sidebar.angle"),
1290
+ suffix: "°"
1291
+ }, null, 8, ["modelValue", "placeholder"])
1292
+ ]),
1293
+ s("div", null, [
1294
+ i(r(vt), {
1295
+ modelValue: Se.value,
1296
+ "onUpdate:modelValue": l[4] || (l[4] = (t) => Se.value = t),
1297
+ max: 10,
1298
+ min: 1,
1299
+ placeholder: e.$t("pdfTools.sidebar.repetitions")
1300
+ }, null, 8, ["modelValue", "placeholder"])
1301
+ ])
1302
+ ]),
1303
+ i(r(b), {
1304
+ disabled: !Ie.value || m.value.length === 0,
1305
+ severity: "secondary",
1306
+ class: "btn-mt",
1307
+ icon: "ri-paint-brush-line",
1308
+ label: e.$t("pdfTools.sidebar.addWatermarkButton"),
1309
+ onClick: Dt
1310
+ }, null, 8, ["disabled", "label"])
1311
+ ])
1312
+ ])
1313
+ ])
1314
+ ]),
1315
+ s("div", ha, [
1316
+ s("h2", null, f(e.$t("pdfTools.pagePreview.title")), 1),
1317
+ i(r(Co), {
1318
+ modelValue: F.value,
1319
+ "onUpdate:modelValue": l[5] || (l[5] = (t) => F.value = t),
1320
+ class: "page-grid",
1321
+ "ghost-class": "ghost",
1322
+ "item-key": "pageIndex",
1323
+ onEnd: Ct
1324
+ }, {
1325
+ default: $(() => [
1326
+ (g(!0), h(Je, null, Ze(F.value, (t) => (g(), h("div", {
1327
+ key: t.pageIndex,
1328
+ class: "page-grid-item"
1329
+ }, [
1330
+ s("div", {
1331
+ class: q([{ selected: _l(t) }, "page-thumbnail"]),
1332
+ onClick: (n) => Et(t),
1333
+ onDblclick: ue((n) => Hl(t), ["stop"])
1334
+ }, [
1335
+ s("div", wa, [
1336
+ i(r(Io), {
1337
+ binary: "",
1338
+ "model-value": _l(t)
1339
+ }, null, 8, ["model-value"])
1340
+ ]),
1341
+ s("div", Ta, [
1342
+ i(r(b), {
1343
+ text: "",
1344
+ rounded: "",
1345
+ icon: "ri-clockwise-line",
1346
+ "aria-label": e.$t("pdf.rotationRigth"),
1347
+ onClick: ue((n) => kt(t), ["stop"])
1348
+ }, null, 8, ["aria-label", "onClick"]),
1349
+ i(r(b), {
1350
+ "aria-label": e.$t("pdfTools.pagePreview.openPagePreview", {
1351
+ pageNumber: t.pageNumber
1352
+ }),
1353
+ text: "",
1354
+ rounded: "",
1355
+ icon: "ri-edit-box-line",
1356
+ onClick: ue((n) => Hl(t), ["stop"])
1357
+ }, null, 8, ["aria-label", "onClick"])
1358
+ ]),
1359
+ s("div", xa, [
1360
+ i(r(Qe), {
1361
+ annotations: !1,
1362
+ page: t.pageNumber,
1363
+ pdf: r(Ye),
1364
+ scale: 0.25,
1365
+ text: !1
1366
+ }, null, 8, ["page", "pdf"])
1367
+ ]),
1368
+ s("div", Ea, f(t.pageNumber), 1)
1369
+ ], 42, ba)
1370
+ ]))), 128))
1371
+ ]),
1372
+ _: 1
1373
+ }, 8, ["modelValue"])
1374
+ ])
1375
+ ])) : U("", !0),
1376
+ i(r(ol), {
1377
+ visible: N.value,
1378
+ "onUpdate:visible": l[15] || (l[15] = (t) => N.value = t),
1379
+ breakpoints: { "960px": "95vw", "640px": "100vw" },
1380
+ closeOnEscape: !1,
1381
+ style: { width: "85vw", maxWidth: "1400px", height: "90vh" },
1382
+ dismissableMask: "",
1383
+ modal: "",
1384
+ class: "dialog-page-editor",
1385
+ "content-class": "page-editor-dialog",
1386
+ onHide: Bl
1387
+ }, {
1388
+ header: $(() => [
1389
+ s("div", Pa, [
1390
+ l[22] || (l[22] = s("i", {
1391
+ class: "ri-file-fill",
1392
+ "aria-hidden": "true"
1393
+ }, null, -1)),
1394
+ s("span", null, f(e.$t("pdfTools.pageEditor.title", {
1395
+ pageNumber: (H.value || V.value)?.pageNumber || "",
1396
+ filename: Ve.value
1397
+ })), 1)
1398
+ ])
1399
+ ]),
1400
+ footer: $(() => [
1401
+ s("div", Ba, [
1402
+ s("small", null, f(e.$t("pdfTools.pageEditor.footerHint")), 1)
1403
+ ])
1404
+ ]),
1405
+ default: $(() => [
1406
+ s("div", Ca, [
1407
+ i(r(b), {
1408
+ text: "",
1409
+ icon: "ri-zoom-out-line",
1410
+ "aria-label": e.$t("pdf.dezoom"),
1411
+ onClick: Ot
1412
+ }, null, 8, ["aria-label"]),
1413
+ i(r(b), {
1414
+ text: "",
1415
+ icon: "ri-zoom-in-line",
1416
+ "aria-label": e.$t("pdf.zoom"),
1417
+ onClick: Bt
1418
+ }, null, 8, ["aria-label"]),
1419
+ i(r(b), {
1420
+ text: "",
1421
+ label: e.$t("pdfTools.pageEditor.fit"),
1422
+ onClick: no
1423
+ }, null, 8, ["label"]),
1424
+ s("span", ka, f(Math.round(Q.value * 100)) + "%", 1),
1425
+ l[23] || (l[23] = s("span", { class: "spacer" }, null, -1)),
1426
+ i(r(b), {
1427
+ text: "",
1428
+ icon: "ri-close-line",
1429
+ label: e.$t("pdfTools.pageEditor.close"),
1430
+ onClick: Bl
1431
+ }, null, 8, ["label"])
1432
+ ]),
1433
+ s("div", Ia, [
1434
+ s("div", Sa, [
1435
+ s("h4", null, f(e.$t("pdfTools.pageEditor.tools.actions")), 1),
1436
+ i(r(b), {
1437
+ text: "",
1438
+ severity: "secondary",
1439
+ class: q({ active: C.value === d.SELECT }),
1440
+ icon: "ri-cursor-line",
1441
+ label: e.$t("pdfTools.pageEditor.tools.select"),
1442
+ onClick: l[6] || (l[6] = (t) => Fe(d.SELECT))
1443
+ }, null, 8, ["class", "label"]),
1444
+ i(r(b), {
1445
+ text: "",
1446
+ severity: "secondary",
1447
+ class: q({ active: C.value === d.REDACT }),
1448
+ icon: "ri-eraser-fill",
1449
+ label: e.$t("pdfTools.pageEditor.tools.redact"),
1450
+ onClick: l[7] || (l[7] = (t) => Fe(d.REDACT))
1451
+ }, null, 8, ["class", "label"]),
1452
+ i(r(b), {
1453
+ text: "",
1454
+ severity: "secondary",
1455
+ class: q({ active: C.value === d.HIGHLIGHT }),
1456
+ icon: "ri-mark-pen-line",
1457
+ label: e.$t("pdfTools.pageEditor.tools.highlight"),
1458
+ onClick: l[8] || (l[8] = (t) => Fe(d.HIGHLIGHT))
1459
+ }, null, 8, ["class", "label"]),
1460
+ i(r(b), {
1461
+ text: "",
1462
+ severity: "secondary",
1463
+ class: q({ active: C.value === d.COMMENT }),
1464
+ icon: "ri-sticky-note-line",
1465
+ label: e.$t("pdfTools.pageEditor.tools.comment"),
1466
+ onClick: l[9] || (l[9] = (t) => Fe(d.COMMENT))
1467
+ }, null, 8, ["class", "label"]),
1468
+ i(r(ft), {
1469
+ severity: "secondary",
1470
+ class: q({ active: C.value === d.IMAGE }),
1471
+ accept: "image/*",
1472
+ "choose-label": e.$t("pdfTools.pageEditor.tools.image"),
1473
+ mode: "basic",
1474
+ name: "image",
1475
+ onSelect: Vt
1476
+ }, null, 8, ["class", "choose-label"]),
1477
+ i(r(b), {
1478
+ text: "",
1479
+ severity: "secondary",
1480
+ class: q({ active: C.value === d.SIGNATURE }),
1481
+ icon: "ri-ball-pen-line",
1482
+ label: e.$t("pdfTools.pageEditor.tools.signature"),
1483
+ onClick: zt
1484
+ }, null, 8, ["class", "label"]),
1485
+ i(r(b), {
1486
+ text: "",
1487
+ severity: "secondary",
1488
+ class: q({ active: C.value === d.TEXT }),
1489
+ icon: "ri-font-size",
1490
+ label: e.$t("pdfTools.pageEditor.tools.text"),
1491
+ onClick: l[10] || (l[10] = (t) => Fe(d.TEXT))
1492
+ }, null, 8, ["class", "label"]),
1493
+ jt.value ? (g(), h("div", $a, [
1494
+ s("div", Aa, [
1495
+ s("label", _a, f(e.$t("pdfTools.pageEditor.tools.font")), 1),
1496
+ i(r($o), {
1497
+ modelValue: ae.value,
1498
+ "onUpdate:modelValue": l[11] || (l[11] = (t) => ae.value = t),
1499
+ options: bt,
1500
+ class: "input-full",
1501
+ optionLabel: "label",
1502
+ optionValue: "value"
1503
+ }, null, 8, ["modelValue"])
1504
+ ]),
1505
+ s("div", Ma, [
1506
+ s("label", Fa, f(e.$t("pdfTools.pageEditor.tools.size")) + " : " + f(oe.value), 1),
1507
+ i(r(So), {
1508
+ id: "text-size-slider",
1509
+ modelValue: oe.value,
1510
+ "onUpdate:modelValue": l[12] || (l[12] = (t) => oe.value = t),
1511
+ max: 144,
1512
+ min: 6,
1513
+ class: "input-full"
1514
+ }, null, 8, ["modelValue"])
1515
+ ]),
1516
+ s("div", Na, [
1517
+ s("label", Ra, f(e.$t("pdfTools.pageEditor.tools.color")), 1),
1518
+ s("div", La, [
1519
+ (g(), h(Je, null, Ze(wt, (t) => s("button", {
1520
+ key: t.value,
1521
+ type: "button",
1522
+ class: q(["color-swatch", { selected: J.value === t.value }]),
1523
+ style: st({ backgroundColor: t.value }),
1524
+ "aria-label": e.$t(`pdfTools.pageEditor.colors.${t.name}`),
1525
+ "aria-pressed": J.value === t.value,
1526
+ onClick: (n) => J.value = t.value
1527
+ }, null, 14, Da)), 64))
1528
+ ]),
1529
+ s("label", Ua, [
1530
+ De(s("input", {
1531
+ "onUpdate:modelValue": l[13] || (l[13] = (t) => J.value = t),
1532
+ type: "color",
1533
+ class: "color-custom-input"
1534
+ }, null, 512), [
1535
+ [nt, J.value]
1536
+ ]),
1537
+ s("span", null, f(e.$t("pdfTools.pageEditor.colors.custom")), 1)
1538
+ ])
1539
+ ])
1540
+ ])) : U("", !0),
1541
+ i(r(pt)),
1542
+ i(r(b), {
1543
+ disabled: p.value.length === 0,
1544
+ severity: "info",
1545
+ class: "btn-full btn-mt-auto",
1546
+ icon: "ri-check-line",
1547
+ label: e.$t("pdfTools.pageEditor.apply"),
1548
+ onClick: so
1549
+ }, null, 8, ["disabled", "label"]),
1550
+ i(r(b), {
1551
+ disabled: p.value.length === 0,
1552
+ severity: "warn",
1553
+ class: "btn-full btn-mt-sm",
1554
+ icon: "ri-arrow-go-back-line",
1555
+ label: e.$t("pdfTools.pageEditor.cancel"),
1556
+ onClick: Wt
1557
+ }, null, 8, ["disabled", "label"]),
1558
+ z.value >= 0 ? (g(), tl(r(b), {
1559
+ key: 1,
1560
+ severity: "danger",
1561
+ class: "btn-full btn-mt-sm",
1562
+ icon: "ri-delete-bin-line",
1563
+ label: e.$t("pdfTools.pageEditor.deleteSelected"),
1564
+ onClick: Gl
1565
+ }, null, 8, ["label"])) : U("", !0)
1566
+ ]),
1567
+ s("div", {
1568
+ class: "page-editor-canvas",
1569
+ onWheelPassive: ie,
1570
+ onScrollPassive: ie
1571
+ }, [
1572
+ s("div", {
1573
+ ref_key: "pdfCanvasWrapper",
1574
+ ref: kl,
1575
+ class: "pdf-canvas-wrapper"
1576
+ }, [
1577
+ r(Ye) && (H.value || V.value) ? (g(), tl(r(Qe), {
1578
+ key: 0,
1579
+ annotations: "",
1580
+ page: (H.value || V.value).pageNumber,
1581
+ pdf: r(Ye),
1582
+ scale: Q.value,
1583
+ text: !1,
1584
+ class: "pdf-canvas-absolute"
1585
+ }, null, 8, ["page", "pdf", "scale"])) : U("", !0),
1586
+ s("canvas", {
1587
+ ref_key: "overlayCanvas",
1588
+ ref: D,
1589
+ class: "overlay-canvas",
1590
+ onDblclick: Jt,
1591
+ onMousedown: Qt,
1592
+ onMouseleave: to,
1593
+ onMousemove: eo,
1594
+ onMouseup: lo
1595
+ }, null, 544),
1596
+ S.value.visible ? De((g(), h("textarea", {
1597
+ key: 1,
1598
+ ref_key: "textEditorInput",
1599
+ ref: Il,
1600
+ "onUpdate:modelValue": l[14] || (l[14] = (t) => S.value.value = t),
1601
+ "aria-label": Xl.value.label,
1602
+ placeholder: Xl.value.placeholder,
1603
+ style: st(Yt.value),
1604
+ class: "text-editor-input",
1605
+ onBlur: vl,
1606
+ onKeydown: rt(ue(vl, ["ctrl", "prevent"]), ["enter"])
1607
+ }, null, 44, Ha)), [
1608
+ [nt, S.value.value]
1609
+ ]) : U("", !0)
1610
+ ], 512)
1611
+ ], 32)
1612
+ ])
1613
+ ]),
1614
+ _: 1
1615
+ }, 8, ["visible"]),
1616
+ i(r(ol), {
1617
+ visible: ve.value,
1618
+ "onUpdate:visible": l[16] || (l[16] = (t) => ve.value = t),
1619
+ modal: "",
1620
+ class: "dialog-signature-pad",
1621
+ onHide: io
1622
+ }, {
1623
+ header: $(() => [
1624
+ s("div", Oa, [
1625
+ l[24] || (l[24] = s("i", {
1626
+ class: "ri-ball-pen-line",
1627
+ "aria-hidden": "true"
1628
+ }, null, -1)),
1629
+ s("span", null, f(e.$t("pdfTools.signaturePad.title")), 1)
1630
+ ])
1631
+ ]),
1632
+ footer: $(() => [
1633
+ s("div", za, [
1634
+ i(r(b), {
1635
+ text: "",
1636
+ label: e.$t("pdfTools.signaturePad.clear"),
1637
+ onClick: Zl
1638
+ }, null, 8, ["label"]),
1639
+ i(r(b), {
1640
+ text: "",
1641
+ label: e.$t("pdfTools.signaturePad.use"),
1642
+ onClick: fo
1643
+ }, null, 8, ["label"])
1644
+ ])
1645
+ ]),
1646
+ default: $(() => [
1647
+ s("div", Va, [
1648
+ s("canvas", {
1649
+ ref_key: "signaturePadCanvas",
1650
+ ref: fe,
1651
+ class: "signature-canvas",
1652
+ onMousedown: Kl,
1653
+ onMouseleave: fl,
1654
+ onMousemove: ql,
1655
+ onMouseup: fl,
1656
+ onTouchstart: ue(co, ["prevent"]),
1657
+ onTouchmove: ue(uo, ["prevent"]),
1658
+ onTouchend: ue(fl, ["prevent"])
1659
+ }, null, 544)
1660
+ ])
1661
+ ]),
1662
+ _: 1
1663
+ }, 8, ["visible"]),
1664
+ i(zo, {
1665
+ "default-filename": $l.value,
1666
+ visible: Oe.value,
1667
+ "parent-folder-node": We.value,
1668
+ onClose: l[17] || (l[17] = (t) => Oe.value = !1),
1669
+ onSave: Ht
1670
+ }, null, 8, ["default-filename", "visible", "parent-folder-node"]),
1671
+ i(r(ol), {
1672
+ visible: $e.value,
1673
+ modal: "",
1674
+ header: e.$t("pdfTools.insertFromAlfresco.title"),
1675
+ class: "dialog-insert-pdf",
1676
+ "onUpdate:visible": l[21] || (l[21] = (t) => $e.value = !1)
1677
+ }, {
1678
+ footer: $(() => [
1679
+ s("div", Is, [
1680
+ s("div", Ss, [
1681
+ B.value ? (g(), h("div", $s, [
1682
+ s("span", As, f(e.$t("pdfTools.insertFromAlfresco.selected")), 1),
1683
+ De((g(), h("span", _s, [
1684
+ le(f(B.value?.name), 1)
1685
+ ])), [
1686
+ [
1687
+ o,
1688
+ B.value?.name,
1689
+ void 0,
1690
+ { top: !0 }
1691
+ ]
1692
+ ])
1693
+ ])) : U("", !0),
1694
+ ne.value ? (g(), h("div", Ms, f(ne.value), 1)) : U("", !0)
1695
+ ]),
1696
+ s("div", Fs, [
1697
+ i(r(b), {
1698
+ label: e.$t("pdfTools.insertFromAlfresco.cancel"),
1699
+ text: "",
1700
+ onClick: l[20] || (l[20] = (t) => $e.value = !1)
1701
+ }, null, 8, ["label"]),
1702
+ i(r(b), {
1703
+ disabled: !xt.value,
1704
+ label: e.$t("pdfTools.insertFromAlfresco.insert"),
1705
+ icon: "ri-add-line",
1706
+ onClick: _t
1707
+ }, null, 8, ["disabled", "label"])
1708
+ ])
1709
+ ])
1710
+ ]),
1711
+ default: $(() => [
1712
+ i(r(Ao), {
1713
+ value: 0,
1714
+ "onUpdate:value": At
1715
+ }, {
1716
+ default: $(() => [
1717
+ i(r(_o), null, {
1718
+ default: $(() => [
1719
+ i(r(el), { value: 0 }, {
1720
+ default: $(() => [
1721
+ le(f(e.$t("pdfTools.insertFromAlfresco.browse")), 1)
1722
+ ]),
1723
+ _: 1
1724
+ }),
1725
+ i(r(el), { value: 1 }, {
1726
+ default: $(() => [
1727
+ le(f(e.$t("pdfTools.insertFromAlfresco.search")), 1)
1728
+ ]),
1729
+ _: 1
1730
+ }),
1731
+ i(r(el), { value: 2 }, {
1732
+ default: $(() => [
1733
+ le(f(e.$t("pdfTools.insertFromAlfresco.favorites")), 1)
1734
+ ]),
1735
+ _: 1
1736
+ }),
1737
+ i(r(el), { value: 3 }, {
1738
+ default: $(() => [
1739
+ le(f(e.$t("pdfTools.insertFromAlfresco.linkOrId")), 1)
1740
+ ]),
1741
+ _: 1
1742
+ })
1743
+ ]),
1744
+ _: 1
1745
+ }),
1746
+ i(r(Mo), null, {
1747
+ default: $(() => [
1748
+ i(r(ll), { value: 0 }, {
1749
+ default: $(() => [
1750
+ i(ht, {
1751
+ showUserHome: "",
1752
+ showFiles: "",
1753
+ onSelectNode: Mt
1754
+ })
1755
+ ]),
1756
+ _: 1
1757
+ }),
1758
+ i(r(ll), { value: 1 }, {
1759
+ default: $(() => [
1760
+ s("div", Wa, [
1761
+ i(r(He), {
1762
+ modelValue: Ae.value,
1763
+ "onUpdate:modelValue": l[18] || (l[18] = (t) => Ae.value = t),
1764
+ placeholder: e.$t("pdfTools.insertFromAlfresco.searchPlaceholder"),
1765
+ onKeyup: rt(Ll, ["enter"])
1766
+ }, null, 8, ["modelValue", "placeholder"]),
1767
+ i(r(b), {
1768
+ icon: "ri-search-line",
1769
+ "aria-label": e.$t("search"),
1770
+ onClick: Ll
1771
+ }, null, 8, ["aria-label"])
1772
+ ]),
1773
+ rl.value ? (g(), h("div", Ga, [
1774
+ i(r(Ue), {
1775
+ class: "spinner-sm",
1776
+ strokeWidth: "8"
1777
+ }),
1778
+ s("span", null, f(e.$t("pdfTools.insertFromAlfresco.searching")), 1)
1779
+ ])) : !me.value.length && Al.value ? (g(), h("div", Xa, f(e.$t("pdfTools.insertFromAlfresco.noPdfFound")), 1)) : me.value.length ? (g(), h("div", Ya, [
1780
+ s("div", ja, [
1781
+ (g(!0), h(Je, null, Ze(me.value, (t) => (g(), h("div", {
1782
+ key: t.id,
1783
+ class: q(["favorite-item", {
1784
+ "favorite-item-selected": B.value?.id === t.id
1785
+ }]),
1786
+ onClick: (n) => il(t)
1787
+ }, [
1788
+ s("div", qa, [
1789
+ l[25] || (l[25] = s("i", {
1790
+ class: "ri-file-pdf-line",
1791
+ "aria-hidden": "true"
1792
+ }, null, -1)),
1793
+ De((g(), h("span", Ja, [
1794
+ le(f(t.name), 1)
1795
+ ])), [
1796
+ [
1797
+ o,
1798
+ t.name,
1799
+ void 0,
1800
+ { top: !0 }
1801
+ ]
1802
+ ])
1803
+ ])
1804
+ ], 10, Ka))), 128))
1805
+ ]),
1806
+ s("div", Za, [
1807
+ B.value ? Xe.value ? (g(), h("div", ls, [
1808
+ i(r(Ue), {
1809
+ class: "spinner-md",
1810
+ strokeWidth: "6"
1811
+ }),
1812
+ s("p", ts, f(e.$t("pdfTools.insertFromAlfresco.loadingPreview")), 1)
1813
+ ])) : r(Me) ? (g(), h("div", os, [
1814
+ j.value > 0 ? (g(), h("div", as, [
1815
+ i(r(b), {
1816
+ icon: "ri-arrow-left-s-line",
1817
+ "aria-label": e.$t("pdf.previousPage"),
1818
+ text: "",
1819
+ size: "small",
1820
+ disabled: X.value <= 1,
1821
+ onClick: Rl
1822
+ }, null, 8, ["aria-label", "disabled"]),
1823
+ s("span", ss, f(X.value) + " / " + f(j.value), 1),
1824
+ i(r(b), {
1825
+ icon: "ri-arrow-right-s-line",
1826
+ "aria-label": e.$t("pdf.nextPage"),
1827
+ text: "",
1828
+ size: "small",
1829
+ disabled: X.value >= j.value,
1830
+ onClick: Nl
1831
+ }, null, 8, ["aria-label", "disabled"])
1832
+ ])) : U("", !0),
1833
+ s("div", ns, [
1834
+ i(r(Qe), {
1835
+ pdf: r(Me),
1836
+ page: X.value,
1837
+ scale: 0.6,
1838
+ annotations: !1,
1839
+ text: !1
1840
+ }, null, 8, ["pdf", "page"])
1841
+ ])
1842
+ ])) : U("", !0) : (g(), h("div", Qa, [
1843
+ l[26] || (l[26] = s("i", {
1844
+ class: "ri-file-pdf-line preview-icon",
1845
+ "aria-hidden": "true"
1846
+ }, null, -1)),
1847
+ s("p", es, f(e.$t("pdfTools.insertFromAlfresco.selectPdfToPreview")), 1)
1848
+ ]))
1849
+ ])
1850
+ ])) : U("", !0)
1851
+ ]),
1852
+ _: 1
1853
+ }),
1854
+ i(r(ll), { value: 2 }, {
1855
+ default: $(() => [
1856
+ Ge.value ? (g(), h("div", rs, [
1857
+ i(r(Ue), {
1858
+ class: "spinner-sm",
1859
+ strokeWidth: "8"
1860
+ }),
1861
+ s("span", null, f(e.$t("pdfTools.insertFromAlfresco.loading")), 1)
1862
+ ])) : _e.value.length ? (g(), h("div", cs, [
1863
+ s("div", ds, [
1864
+ (g(!0), h(Je, null, Ze(_e.value, (t) => (g(), h("div", {
1865
+ key: t.id,
1866
+ class: q(["favorite-item", {
1867
+ "favorite-item-selected": B.value?.id === t.id
1868
+ }]),
1869
+ onClick: (n) => il(t)
1870
+ }, [
1871
+ s("div", vs, [
1872
+ l[27] || (l[27] = s("i", {
1873
+ class: "ri-file-pdf-line",
1874
+ "aria-hidden": "true"
1875
+ }, null, -1)),
1876
+ De((g(), h("span", fs, [
1877
+ le(f(t.name), 1)
1878
+ ])), [
1879
+ [
1880
+ o,
1881
+ t.name,
1882
+ void 0,
1883
+ { top: !0 }
1884
+ ]
1885
+ ])
1886
+ ])
1887
+ ], 10, us))), 128))
1888
+ ]),
1889
+ s("div", ps, [
1890
+ B.value ? Xe.value ? (g(), h("div", ys, [
1891
+ i(r(Ue), {
1892
+ class: "spinner-md",
1893
+ strokeWidth: "6"
1894
+ }),
1895
+ s("p", hs, f(e.$t("pdfTools.insertFromAlfresco.loadingPreview")), 1)
1896
+ ])) : r(Me) ? (g(), h("div", bs, [
1897
+ j.value > 0 ? (g(), h("div", ws, [
1898
+ i(r(b), {
1899
+ icon: "ri-arrow-left-s-line",
1900
+ "aria-label": e.$t("pdf.previousPage"),
1901
+ text: "",
1902
+ size: "small",
1903
+ disabled: X.value <= 1,
1904
+ onClick: Rl
1905
+ }, null, 8, ["aria-label", "disabled"]),
1906
+ s("span", Ts, f(X.value) + " / " + f(j.value), 1),
1907
+ i(r(b), {
1908
+ icon: "ri-arrow-right-s-line",
1909
+ "aria-label": e.$t("pdf.nextPage"),
1910
+ text: "",
1911
+ size: "small",
1912
+ disabled: X.value >= j.value,
1913
+ onClick: Nl
1914
+ }, null, 8, ["aria-label", "disabled"])
1915
+ ])) : U("", !0),
1916
+ s("div", xs, [
1917
+ i(r(Qe), {
1918
+ pdf: r(Me),
1919
+ page: X.value,
1920
+ scale: 0.6,
1921
+ annotations: !1,
1922
+ text: !1
1923
+ }, null, 8, ["pdf", "page"])
1924
+ ])
1925
+ ])) : U("", !0) : (g(), h("div", ms, [
1926
+ l[28] || (l[28] = s("i", {
1927
+ class: "ri-file-pdf-line preview-icon",
1928
+ "aria-hidden": "true"
1929
+ }, null, -1)),
1930
+ s("p", gs, f(e.$t("pdfTools.insertFromAlfresco.selectPdfToPreview")), 1)
1931
+ ]))
1932
+ ])
1933
+ ])) : (g(), h("div", is, f(e.$t("pdfTools.insertFromAlfresco.noPdfFavorite")), 1))
1934
+ ]),
1935
+ _: 1
1936
+ }),
1937
+ i(r(ll), { value: 3 }, {
1938
+ default: $(() => [
1939
+ s("div", Es, [
1940
+ s("div", Ps, [
1941
+ s("label", Cs, f(e.$t("pdfTools.insertFromAlfresco.alfrescoIdUrl")), 1),
1942
+ i(r(He), {
1943
+ id: "alfrescoNodeId",
1944
+ modelValue: se.value,
1945
+ "onUpdate:modelValue": l[19] || (l[19] = (t) => se.value = t),
1946
+ placeholder: e.$t("pdfTools.insertFromAlfresco.alfrescoIdUrlHint")
1947
+ }, null, 8, ["modelValue", "placeholder"]),
1948
+ s("small", ks, f(e.$t("pdfTools.insertFromAlfresco.alfrescoIdUrlHint")), 1)
1949
+ ])
1950
+ ])
1951
+ ]),
1952
+ _: 1
1953
+ })
1954
+ ]),
1955
+ _: 1
1956
+ })
1957
+ ]),
1958
+ _: 1
1959
+ })
1960
+ ]),
1961
+ _: 1
1962
+ }, 8, ["visible", "header"])
1963
+ ]);
1964
+ };
1965
+ }
1966
+ }, sn = /* @__PURE__ */ yt(Ns, [["__scopeId", "data-v-f9ae7d64"]]);
1967
+ export {
1968
+ sn as default
1969
+ };
1970
+ //# sourceMappingURL=PdfToolsComponent-CynQg24K.js.map