@rhc-office/sdk 6.6.385 → 6.6.387
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/api/annotation-tool.d.ts +1 -0
- package/dist/api/annotation-tool.d.ts.map +1 -1
- package/dist/browser/document-viewer.js +1 -1
- package/dist/browser/document-viewer.js.map +1 -1
- package/dist/index.js +269 -234
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/viewer/DocumentSDK.d.ts +1 -0
- package/dist/viewer/DocumentSDK.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/annotation-tool.ts +1 -0
- package/src/viewer/DocumentSDK.ts +102 -3
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var X = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.COMPACT = "compact", t.HIDE = "none", t))(X || {});
|
|
2
|
+
const x = "RIGHT_CENTER", V = "REGULAR_ESM", K = "auto", f = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", P = {
|
|
3
3
|
defaults: {
|
|
4
4
|
bjca: {
|
|
5
5
|
pin: ""
|
|
6
6
|
},
|
|
7
7
|
deviceType: "client",
|
|
8
|
-
edgePosition:
|
|
8
|
+
edgePosition: x,
|
|
9
9
|
plugin: {
|
|
10
10
|
pin: "",
|
|
11
11
|
usbKeyType: 14
|
|
12
12
|
},
|
|
13
|
-
rsaMode:
|
|
14
|
-
signatureType:
|
|
13
|
+
rsaMode: K,
|
|
14
|
+
signatureType: V
|
|
15
15
|
},
|
|
16
16
|
signServer: {
|
|
17
17
|
authSource: "Password",
|
|
@@ -25,7 +25,7 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
25
25
|
usbKeyType: 14
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, G = (t) => ({
|
|
29
29
|
bjca: {
|
|
30
30
|
pin: t.bjca.pin
|
|
31
31
|
},
|
|
@@ -37,7 +37,7 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
37
37
|
},
|
|
38
38
|
rsaMode: t.rsaMode,
|
|
39
39
|
signatureType: t.signatureType
|
|
40
|
-
}),
|
|
40
|
+
}), q = (t) => ({
|
|
41
41
|
authSource: t.authSource,
|
|
42
42
|
defaultLogin: t.defaultLogin,
|
|
43
43
|
defaultPassword: t.defaultPassword,
|
|
@@ -49,9 +49,9 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
49
49
|
usbKeyType: t.usbKey.usbKeyType
|
|
50
50
|
}
|
|
51
51
|
}), g = (t) => ({
|
|
52
|
-
defaults:
|
|
53
|
-
signServer:
|
|
54
|
-
}),
|
|
52
|
+
defaults: G(t.defaults),
|
|
53
|
+
signServer: q(t.signServer)
|
|
54
|
+
}), E = (t) => ({
|
|
55
55
|
defaults: t.defaults ? {
|
|
56
56
|
...t.defaults,
|
|
57
57
|
bjca: t.defaults.bjca ? { ...t.defaults.bjca } : void 0,
|
|
@@ -61,7 +61,7 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
61
61
|
...t.signServer,
|
|
62
62
|
usbKey: t.signServer.usbKey ? { ...t.signServer.usbKey } : void 0
|
|
63
63
|
} : void 0
|
|
64
|
-
}),
|
|
64
|
+
}), J = (t, n) => n ? {
|
|
65
65
|
bjca: {
|
|
66
66
|
pin: n.bjca?.pin ?? t.bjca.pin
|
|
67
67
|
},
|
|
@@ -73,7 +73,7 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
73
73
|
},
|
|
74
74
|
rsaMode: n.rsaMode ?? t.rsaMode,
|
|
75
75
|
signatureType: n.signatureType ?? t.signatureType
|
|
76
|
-
} :
|
|
76
|
+
} : G(t), Z = (t, n) => n ? {
|
|
77
77
|
authSource: n.authSource ?? t.authSource,
|
|
78
78
|
defaultLogin: n.defaultLogin ?? t.defaultLogin,
|
|
79
79
|
defaultPassword: n.defaultPassword ?? t.defaultPassword,
|
|
@@ -84,10 +84,10 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
84
84
|
checkCertificateBinding: n.usbKey?.checkCertificateBinding ?? t.usbKey.checkCertificateBinding,
|
|
85
85
|
usbKeyType: n.usbKey?.usbKeyType ?? t.usbKey.usbKeyType
|
|
86
86
|
}
|
|
87
|
-
} :
|
|
88
|
-
defaults:
|
|
89
|
-
signServer:
|
|
90
|
-
}),
|
|
87
|
+
} : q(t), z = (t, n) => ({
|
|
88
|
+
defaults: J(t.defaults, n.defaults),
|
|
89
|
+
signServer: Z(t.signServer, n.signServer)
|
|
90
|
+
}), ee = (t, n) => {
|
|
91
91
|
const e = t.defaults?.bjca || n.defaults?.bjca ? {
|
|
92
92
|
...t.defaults?.bjca,
|
|
93
93
|
...n.defaults?.bjca
|
|
@@ -111,40 +111,40 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
111
111
|
...r ? { usbKey: r } : {}
|
|
112
112
|
} : void 0
|
|
113
113
|
};
|
|
114
|
-
},
|
|
115
|
-
const t =
|
|
114
|
+
}, te = () => globalThis, p = () => {
|
|
115
|
+
const t = te();
|
|
116
116
|
return t[f] || (t[f] = {
|
|
117
|
-
current: g(
|
|
118
|
-
defaults: g(
|
|
117
|
+
current: g(P),
|
|
118
|
+
defaults: g(P),
|
|
119
119
|
overrides: {}
|
|
120
120
|
}), t[f];
|
|
121
|
-
},
|
|
121
|
+
}, gt = () => p().current, mt = () => {
|
|
122
122
|
const t = p();
|
|
123
123
|
return {
|
|
124
124
|
current: g(t.current),
|
|
125
125
|
defaults: g(t.defaults),
|
|
126
|
-
overrides:
|
|
126
|
+
overrides: E(t.overrides)
|
|
127
127
|
};
|
|
128
|
-
}, gt = (t) => {
|
|
129
|
-
const n = p();
|
|
130
|
-
return n.defaults = g(t), n.current = K(n.defaults, n.overrides), n.current;
|
|
131
|
-
}, mt = (t) => {
|
|
132
|
-
const n = p();
|
|
133
|
-
return n.current = g(t), n.overrides = v(t), n.current;
|
|
134
128
|
}, pt = (t) => {
|
|
135
129
|
const n = p();
|
|
136
|
-
return n.
|
|
130
|
+
return n.defaults = g(t), n.current = z(n.defaults, n.overrides), n.current;
|
|
137
131
|
}, bt = (t) => {
|
|
132
|
+
const n = p();
|
|
133
|
+
return n.current = g(t), n.overrides = E(t), n.current;
|
|
134
|
+
}, St = (t) => {
|
|
135
|
+
const n = p();
|
|
136
|
+
return n.overrides = ee(n.overrides, E(t)), n.current = z(n.current, t), n.current;
|
|
137
|
+
}, ft = (t) => {
|
|
138
138
|
const n = p();
|
|
139
139
|
return t && (n.defaults = g(t)), n.overrides = {}, n.current = g(n.defaults), n.current;
|
|
140
|
-
},
|
|
141
|
-
EDGE_POSITION:
|
|
142
|
-
RSA_MODE:
|
|
143
|
-
SIGNATURE_TYPE:
|
|
140
|
+
}, Rt = {
|
|
141
|
+
EDGE_POSITION: x,
|
|
142
|
+
RSA_MODE: K,
|
|
143
|
+
SIGNATURE_TYPE: V
|
|
144
144
|
}, R = (t) => {
|
|
145
145
|
if (t.length !== 0)
|
|
146
146
|
return t.length === 1 ? t[0] : t;
|
|
147
|
-
},
|
|
147
|
+
}, u = (t, n, e) => new Proxy(
|
|
148
148
|
{},
|
|
149
149
|
{
|
|
150
150
|
get: (i, r) => {
|
|
@@ -164,25 +164,25 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
164
164
|
if (a.kind === "query")
|
|
165
165
|
return e.bridge.request(t, o, R(s));
|
|
166
166
|
if (a.kind === "callbackQuery") {
|
|
167
|
-
const
|
|
168
|
-
e.bridge.request(t, o, R(
|
|
169
|
-
const
|
|
170
|
-
|
|
167
|
+
const l = s.find((h) => typeof h == "function"), c = s.filter((h) => typeof h != "function");
|
|
168
|
+
e.bridge.request(t, o, R(c)).then((h) => {
|
|
169
|
+
const $ = a.mapCallbackResult?.(h) ?? [h];
|
|
170
|
+
l?.(...$);
|
|
171
171
|
}).catch(e.onAsyncError);
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
|
-
const
|
|
175
|
-
e.onAsyncError(
|
|
174
|
+
const d = e.bridge.request(t, o, R(s)).catch((l) => {
|
|
175
|
+
e.onAsyncError(l);
|
|
176
176
|
});
|
|
177
177
|
if (a.returnsResult)
|
|
178
|
-
return
|
|
178
|
+
return d;
|
|
179
179
|
} : (...s) => {
|
|
180
180
|
const o = new Error(`${t}.${r} is not implemented by the SDK adapter.`);
|
|
181
181
|
e.onAsyncError(o);
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
),
|
|
185
|
+
), ne = (t) => typeof t == "object" && t !== null && !Array.isArray(t) && "id" in t, C = (t) => t.annotations?.filter(ne).map((n) => ({ ...n })) ?? [], ie = (t) => {
|
|
186
186
|
switch (t) {
|
|
187
187
|
case "select":
|
|
188
188
|
case "pen":
|
|
@@ -202,7 +202,7 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
202
202
|
default:
|
|
203
203
|
return "none";
|
|
204
204
|
}
|
|
205
|
-
},
|
|
205
|
+
}, re = {
|
|
206
206
|
addAnnotationEventCallback: {
|
|
207
207
|
kind: "callbackRegister",
|
|
208
208
|
callback: (t, n) => {
|
|
@@ -216,15 +216,15 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
216
216
|
},
|
|
217
217
|
getAnnotationMode: {
|
|
218
218
|
kind: "stateGetter",
|
|
219
|
-
state: (t) =>
|
|
219
|
+
state: (t) => ie(t.annotationMode)
|
|
220
220
|
},
|
|
221
221
|
getAnnotations: {
|
|
222
222
|
kind: "stateGetter",
|
|
223
|
-
state: (t) =>
|
|
223
|
+
state: (t) => C(t)
|
|
224
224
|
},
|
|
225
225
|
getAnnotationsCount: {
|
|
226
226
|
kind: "stateGetter",
|
|
227
|
-
state: (t) =>
|
|
227
|
+
state: (t) => C(t).length
|
|
228
228
|
},
|
|
229
229
|
openAnnotationView: { kind: "command" },
|
|
230
230
|
closeAnnotationView: { kind: "command" },
|
|
@@ -243,25 +243,25 @@ const U = "RIGHT_CENTER", N = "REGULAR_ESM", B = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
243
243
|
setAnnotationPenWidth: { kind: "command" },
|
|
244
244
|
setAnnotationPenStyle: { kind: "command" }
|
|
245
245
|
};
|
|
246
|
-
class
|
|
246
|
+
class ae {
|
|
247
247
|
constructor(n) {
|
|
248
|
-
this.openAnnotationView = (e) => this.adapter.openAnnotationView(e), this.closeAnnotationView = () => this.adapter.closeAnnotationView(), this.saveAnnotations = (e) => this.adapter.saveAnnotations(e), this.clearAnnotations = () => this.adapter.clearAnnotations(), this.undoAnnotation = () => this.adapter.undoAnnotation(), this.redoAnnotation = () => this.adapter.redoAnnotation(), this.canUndoAnnotation = () => this.adapter.canUndoAnnotation(), this.canRedoAnnotation = () => this.adapter.canRedoAnnotation(), this.selectAnnotationTool = (e, i) => this.adapter.selectAnnotationTool(e, i), this.selectAnnotationStamp = (e) => this.adapter.selectAnnotationStamp(e), this.getCustomStamps = () => this.adapter.getCustomStamps(), this.addCustomTextStamp = (e) => this.adapter.addCustomTextStamp(e), this.addCustomImageStamp = (e) => this.adapter.addCustomImageStamp(e), this.setAnnotationPenColor = (e) => this.adapter.setAnnotationPenColor(e), this.setAnnotationPenWidth = (e) => this.adapter.setAnnotationPenWidth(e), this.setAnnotationPenStyle = (e) => this.adapter.setAnnotationPenStyle(e), this.isInAnnotationMode = () => this.adapter.isInAnnotationMode(), this.getAnnotationMode = () => this.adapter.getAnnotationMode(), this.getAnnotations = () => this.adapter.getAnnotations(), this.getAnnotationsCount = () => this.adapter.getAnnotationsCount(), this.addAnnotationEventCallback = (e) => this.adapter.addAnnotationEventCallback(e), this.adapter =
|
|
248
|
+
this.openAnnotationView = (e) => this.adapter.openAnnotationView(e), this.closeAnnotationView = () => this.adapter.closeAnnotationView(), this.saveAnnotations = (e) => this.adapter.saveAnnotations(e), this.clearAnnotations = () => this.adapter.clearAnnotations(), this.undoAnnotation = () => this.adapter.undoAnnotation(), this.redoAnnotation = () => this.adapter.redoAnnotation(), this.canUndoAnnotation = () => this.adapter.canUndoAnnotation(), this.canRedoAnnotation = () => this.adapter.canRedoAnnotation(), this.selectAnnotationTool = (e, i) => this.adapter.selectAnnotationTool(e, i), this.selectAnnotationStamp = (e) => this.adapter.selectAnnotationStamp(e), this.getCustomStamps = () => this.adapter.getCustomStamps(), this.addCustomTextStamp = (e) => this.adapter.addCustomTextStamp(e), this.addCustomImageStamp = (e) => this.adapter.addCustomImageStamp(e), this.setAnnotationPenColor = (e) => this.adapter.setAnnotationPenColor(e), this.setAnnotationPenWidth = (e) => this.adapter.setAnnotationPenWidth(e), this.setAnnotationPenStyle = (e) => this.adapter.setAnnotationPenStyle(e), this.isInAnnotationMode = () => this.adapter.isInAnnotationMode(), this.getAnnotationMode = () => this.adapter.getAnnotationMode(), this.getAnnotations = () => this.adapter.getAnnotations(), this.getAnnotationsCount = () => this.adapter.getAnnotationsCount(), this.addAnnotationEventCallback = (e) => this.adapter.addAnnotationEventCallback(e), this.adapter = u(
|
|
249
249
|
"annotation",
|
|
250
|
-
|
|
250
|
+
re,
|
|
251
251
|
n
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
const
|
|
255
|
+
const se = {
|
|
256
256
|
configSecurityProvider: { kind: "command" },
|
|
257
257
|
getSecurityProviders: { kind: "query" }
|
|
258
258
|
};
|
|
259
|
-
class
|
|
259
|
+
class oe {
|
|
260
260
|
constructor(n) {
|
|
261
|
-
this.configSecurityProvider = (e) => this.adapter.configSecurityProvider(e), this.getSecurityProviders = () => this.adapter.getSecurityProviders(), this.adapter =
|
|
261
|
+
this.configSecurityProvider = (e) => this.adapter.configSecurityProvider(e), this.getSecurityProviders = () => this.adapter.getSecurityProviders(), this.adapter = u("crypto", se, n);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
const
|
|
264
|
+
const D = (t) => t.digitalSignatures ? [...t.digitalSignatures] : [], de = {
|
|
265
265
|
addDigitalSignatureRetrieveCallback: {
|
|
266
266
|
kind: "callbackRegister",
|
|
267
267
|
callback: (t, n) => {
|
|
@@ -298,25 +298,25 @@ const C = (t) => t.digitalSignatures ? [...t.digitalSignatures] : [], ae = {
|
|
|
298
298
|
listDigitalSignatures: { kind: "callbackQuery" },
|
|
299
299
|
getDigitalSignatures: {
|
|
300
300
|
kind: "stateGetter",
|
|
301
|
-
state: (t) =>
|
|
301
|
+
state: (t) => D(t)
|
|
302
302
|
},
|
|
303
303
|
getDigitalSignaturesCount: {
|
|
304
304
|
kind: "stateGetter",
|
|
305
|
-
state: (t) =>
|
|
305
|
+
state: (t) => D(t).length
|
|
306
306
|
},
|
|
307
307
|
enableDigitalSignatureInfoView: { kind: "command" },
|
|
308
308
|
enableDigitalSignatureRevocation: { kind: "command" }
|
|
309
309
|
};
|
|
310
|
-
class
|
|
310
|
+
class ue {
|
|
311
311
|
constructor(n) {
|
|
312
|
-
this.addDigitalSignatureRetrieveCallback = (e) => this.adapter.addDigitalSignatureRetrieveCallback(e), this.addDigitalSignatureParseCallback = (e) => this.adapter.addDigitalSignatureParseCallback(e), this.setCryptoProvider = (e, i, r) => this.adapter.setCryptoProvider(e, i, r), this.setSealSource = (e) => this.adapter.setSealSource(e), this.setDefaultStampPassword = (e) => this.adapter.setDefaultStampPassword(e), this.setDefaultSealPassword = (e) => this.adapter.setDefaultSealPassword(e), this.setDefaultKeystorePassword = (e) => this.adapter.setDefaultKeystorePassword(e), this.setDefaultUSBKeyPassword = (e) => this.adapter.setDefaultUSBKeyPassword(e), this.addDigitalSignCallback = (e) => this.adapter.addDigitalSignCallback(e), this.setupExternalSealServer = (e) => this.adapter.setupExternalSealServer(e), this.setDigitalSignOptions = (e) => this.adapter.setDigitalSignOptions(e), this.setExternalDigitalSignOptions = (e) => this.adapter.setExternalDigitalSignOptions(e), this.setPDFDigitalSignCaptionOptions = (e) => this.adapter.setPDFDigitalSignCaptionOptions(e), this.addDigitalSignature = (e, i) => this.adapter.addDigitalSignature(e, i), this.addDigitalSignatureBySelectedSearchHighlight = (e) => this.adapter.addDigitalSignatureBySelectedSearchHighlight(e), this.listDigitalSignatures = (e) => this.adapter.listDigitalSignatures(e), this.getDigitalSignatures = () => this.adapter.getDigitalSignatures(), this.getDigitalSignaturesCount = () => this.adapter.getDigitalSignaturesCount(), this.enableDigitalSignatureInfoView = (e) => this.adapter.enableDigitalSignatureInfoView(e), this.enableDigitalSignatureRevocation = (e) => this.adapter.enableDigitalSignatureRevocation(e), this.adapter =
|
|
312
|
+
this.addDigitalSignatureRetrieveCallback = (e) => this.adapter.addDigitalSignatureRetrieveCallback(e), this.addDigitalSignatureParseCallback = (e) => this.adapter.addDigitalSignatureParseCallback(e), this.setCryptoProvider = (e, i, r) => this.adapter.setCryptoProvider(e, i, r), this.setSealSource = (e) => this.adapter.setSealSource(e), this.setDefaultStampPassword = (e) => this.adapter.setDefaultStampPassword(e), this.setDefaultSealPassword = (e) => this.adapter.setDefaultSealPassword(e), this.setDefaultKeystorePassword = (e) => this.adapter.setDefaultKeystorePassword(e), this.setDefaultUSBKeyPassword = (e) => this.adapter.setDefaultUSBKeyPassword(e), this.addDigitalSignCallback = (e) => this.adapter.addDigitalSignCallback(e), this.setupExternalSealServer = (e) => this.adapter.setupExternalSealServer(e), this.setDigitalSignOptions = (e) => this.adapter.setDigitalSignOptions(e), this.setExternalDigitalSignOptions = (e) => this.adapter.setExternalDigitalSignOptions(e), this.setPDFDigitalSignCaptionOptions = (e) => this.adapter.setPDFDigitalSignCaptionOptions(e), this.addDigitalSignature = (e, i) => this.adapter.addDigitalSignature(e, i), this.addDigitalSignatureBySelectedSearchHighlight = (e) => this.adapter.addDigitalSignatureBySelectedSearchHighlight(e), this.listDigitalSignatures = (e) => this.adapter.listDigitalSignatures(e), this.getDigitalSignatures = () => this.adapter.getDigitalSignatures(), this.getDigitalSignaturesCount = () => this.adapter.getDigitalSignaturesCount(), this.enableDigitalSignatureInfoView = (e) => this.adapter.enableDigitalSignatureInfoView(e), this.enableDigitalSignatureRevocation = (e) => this.adapter.enableDigitalSignatureRevocation(e), this.adapter = u(
|
|
313
313
|
"digitalSign",
|
|
314
|
-
|
|
314
|
+
de,
|
|
315
315
|
n
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
const
|
|
319
|
+
const le = "rhc-office.editor-adapter", ce = 1, he = "__RHC_OFFICE_EDITOR_ADAPTER__", A = "rhcOfficeAdapterReady", M = "rhcOfficeAdapterEvent", H = "data-rhc-office-reader-id", ge = {
|
|
320
320
|
addDocumentOpenedCallback: {
|
|
321
321
|
kind: "callbackRegister",
|
|
322
322
|
callback: (t, n) => {
|
|
@@ -365,7 +365,7 @@ const oe = "rhc-office.editor-adapter", de = 1, ue = "__RHC_OFFICE_EDITOR_ADAPTE
|
|
|
365
365
|
print: { kind: "command" },
|
|
366
366
|
createPreview: { kind: "command" }
|
|
367
367
|
};
|
|
368
|
-
class
|
|
368
|
+
class me {
|
|
369
369
|
constructor(n) {
|
|
370
370
|
this.context = n, this.addDocumentOpenedCallback = (e) => this.adapter.addDocumentOpenedCallback(e), this.addDocumentSavedCallback = (e) => this.adapter.addDocumentSavedCallback(e), this.addDocumentClosedCallback = (e) => this.adapter.addDocumentClosedCallback(e), this.openPDFDocument = (e, i) => this.adapter.openPDFDocument(e, i), this.openPdfDocument = (e, i) => this.adapter.openPdfDocument(e, i), this.openOFDDocument = (e, i) => this.adapter.openOFDDocument(e, i), this.openOfdDocument = (e, i) => this.adapter.openOfdDocument(e, i), this.openOfficeDocument = (e, i) => this.adapter.openOfficeDocument(e, i), this.openImageDocument = (e, i) => this.adapter.openImageDocument(e, i), this.openTextDocument = (e, i) => this.adapter.openTextDocument(e, i), this.openFromLocalStorage = () => this.adapter.openFromLocalStorage(), this.setUploadUrl = (e, i) => this.adapter.setUploadUrl(e, i), this.save = (e, i, r) => this.adapter.save(e, i, r), this.saveAs = (e) => {
|
|
371
371
|
const i = this.context.bridge.getReaderId();
|
|
@@ -377,41 +377,41 @@ class ce {
|
|
|
377
377
|
error: "Reader is not mounted or does not expose saveAs."
|
|
378
378
|
});
|
|
379
379
|
const r = document.querySelector(
|
|
380
|
-
`[${
|
|
380
|
+
`[${H}="${i}"]`
|
|
381
381
|
);
|
|
382
382
|
return typeof r?.saveAs == "function" ? r.saveAs(e) : this.adapter.saveAs(e);
|
|
383
|
-
}, this.getDocumentContent = (e) => this.adapter.getDocumentContent(e), this.closeDocument = (e, i, r) => this.adapter.closeDocument(e, i, r), this.isDocumentOpened = () => this.adapter.isDocumentOpened(), this.isDocumentModified = () => this.adapter.isDocumentModified(), this.print = () => this.adapter.print(), this.createPreview = (e, i) => this.adapter.createPreview(e, i), this.adapter =
|
|
383
|
+
}, this.getDocumentContent = (e) => this.adapter.getDocumentContent(e), this.closeDocument = (e, i, r) => this.adapter.closeDocument(e, i, r), this.isDocumentOpened = () => this.adapter.isDocumentOpened(), this.isDocumentModified = () => this.adapter.isDocumentModified(), this.print = () => this.adapter.print(), this.createPreview = (e, i) => this.adapter.createPreview(e, i), this.adapter = u(
|
|
384
384
|
"document",
|
|
385
|
-
|
|
385
|
+
ge,
|
|
386
386
|
n
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const pe = {
|
|
391
391
|
clearFind: { kind: "command" },
|
|
392
392
|
findNext: { kind: "command" },
|
|
393
393
|
findPrevious: { kind: "command" }
|
|
394
394
|
};
|
|
395
|
-
class
|
|
395
|
+
class be {
|
|
396
396
|
constructor(n) {
|
|
397
|
-
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter =
|
|
397
|
+
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter = u("find", pe, n);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
const
|
|
400
|
+
const Se = {
|
|
401
401
|
configFileUpload: { kind: "command" },
|
|
402
402
|
setHttpHeaders: { kind: "command" },
|
|
403
403
|
setHttpFormFields: { kind: "command" }
|
|
404
404
|
};
|
|
405
|
-
class
|
|
405
|
+
class fe {
|
|
406
406
|
constructor(n) {
|
|
407
|
-
this.configFileUpload = (e) => this.adapter.configFileUpload(e), this.setHttpHeaders = (e) => this.adapter.setHttpHeaders(e), this.setHttpFormFields = (e) => this.adapter.setHttpFormFields(e), this.adapter =
|
|
407
|
+
this.configFileUpload = (e) => this.adapter.configFileUpload(e), this.setHttpHeaders = (e) => this.adapter.setHttpHeaders(e), this.setHttpFormFields = (e) => this.adapter.setHttpFormFields(e), this.adapter = u(
|
|
408
408
|
"networking",
|
|
409
|
-
|
|
409
|
+
Se,
|
|
410
410
|
n
|
|
411
411
|
);
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
const
|
|
414
|
+
const Re = () => ({
|
|
415
415
|
clearContent: { kind: "command", returnsResult: !0 },
|
|
416
416
|
commit: { kind: "command", returnsResult: !0 },
|
|
417
417
|
deletePages: { kind: "command", returnsResult: !0 },
|
|
@@ -426,17 +426,17 @@ const be = () => ({
|
|
|
426
426
|
rotateLeft: { kind: "command", returnsResult: !0 },
|
|
427
427
|
rotateRight: { kind: "command", returnsResult: !0 },
|
|
428
428
|
undo: { kind: "command", returnsResult: !0 }
|
|
429
|
-
}),
|
|
430
|
-
class
|
|
429
|
+
}), ke = (t) => t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
430
|
+
class Te {
|
|
431
431
|
constructor(n) {
|
|
432
|
-
this.getSnapshot = () => this.adapter.getSnapshot(), this.execute = (e) => this.adapter.execute(e), this.newPage = (e, i) => this.adapter.newPage(e, i), this.deletePages = (e) => this.adapter.deletePages(e), this.duplicatePages = (e, i) => this.adapter.duplicatePages(e, i), this.rotateLeft = (e) => this.adapter.rotateLeft(e), this.rotateRight = (e) => this.adapter.rotateRight(e), this.clearContent = (e) => this.adapter.clearContent(e), this.moveBefore = (e, i) => this.adapter.moveBefore(e, i), this.moveAfter = (e, i) => this.adapter.moveAfter(e, i), this.importDocument = (e, i) => this.adapter.importDocument(
|
|
432
|
+
this.getSnapshot = () => this.adapter.getSnapshot(), this.execute = (e) => this.adapter.execute(e), this.newPage = (e, i) => this.adapter.newPage(e, i), this.deletePages = (e) => this.adapter.deletePages(e), this.duplicatePages = (e, i) => this.adapter.duplicatePages(e, i), this.rotateLeft = (e) => this.adapter.rotateLeft(e), this.rotateRight = (e) => this.adapter.rotateRight(e), this.clearContent = (e) => this.adapter.clearContent(e), this.moveBefore = (e, i) => this.adapter.moveBefore(e, i), this.moveAfter = (e, i) => this.adapter.moveAfter(e, i), this.importDocument = (e, i) => this.adapter.importDocument(ke(e), i), this.extractPages = (e, i) => this.adapter.extractPages(e, i), this.undo = () => this.adapter.undo(), this.commit = () => this.adapter.commit(), this.adapter = u(
|
|
433
433
|
"pageArrange",
|
|
434
|
-
|
|
434
|
+
Re(),
|
|
435
435
|
n
|
|
436
436
|
);
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
const
|
|
439
|
+
const ye = (t) => ({
|
|
440
440
|
addPageChangeCallback: {
|
|
441
441
|
kind: "callbackRegister",
|
|
442
442
|
callback: (n, e) => {
|
|
@@ -486,16 +486,16 @@ const Re = (t) => ({
|
|
|
486
486
|
gotoPreviousPage: { kind: "command" },
|
|
487
487
|
rotatePage: { kind: "command" }
|
|
488
488
|
});
|
|
489
|
-
class
|
|
489
|
+
class ve {
|
|
490
490
|
constructor(n) {
|
|
491
|
-
this.addPageChangeCallback = (e) => this.adapter.addPageChangeCallback(e), this.addPageModeChangeCallback = (e) => this.adapter.addPageModeChangeCallback(e), this.getPageCount = (e) => this.adapter.getPageCount(e), this.getPageIndex = (e) => this.adapter.getPageIndex(e), this.setSinglePageViewMode = () => this.adapter.setSinglePageViewMode(), this.setTwoPagesViewMode = () => this.adapter.setTwoPagesViewMode(), this.setPageScrollVertical = () => this.adapter.setPageScrollVertical(), this.setPageScrollHorizontal = () => this.adapter.setPageScrollHorizontal(), this.setPageCursorPanDrag = () => this.adapter.setPageCursorPanDrag(), this.setPageCursorTextSelect = () => this.adapter.setPageCursorTextSelect(), this.rotateCW = () => this.adapter.rotateCW(), this.rotateCCW = () => this.adapter.rotateCCW(), this.autoFitPage = () => this.adapter.autoFitPage(), this.fitPageSize = () => this.adapter.fitPageSize(), this.fitPageWidth = () => this.adapter.fitPageWidth(), this.fitPageHeight = () => this.adapter.fitPageHeight(), this.increasePageScale = () => this.adapter.increasePageScale(), this.decreasePageScale = () => this.adapter.decreasePageScale(), this.setPageScale = (e) => this.adapter.setPageScale(e), this.setPageBlendColor = (e, i, r, a) => this.adapter.setPageBlendColor(e, i, r, a), this.gotoPage = (e, i, r) => this.adapter.gotoPage(e, i, r), this.gotoNextPage = () => this.adapter.gotoNextPage(), this.gotoPreviousPage = () => this.adapter.gotoPreviousPage(), this.rotatePage = (e) => this.adapter.rotatePage(e), this.adapter =
|
|
491
|
+
this.addPageChangeCallback = (e) => this.adapter.addPageChangeCallback(e), this.addPageModeChangeCallback = (e) => this.adapter.addPageModeChangeCallback(e), this.getPageCount = (e) => this.adapter.getPageCount(e), this.getPageIndex = (e) => this.adapter.getPageIndex(e), this.setSinglePageViewMode = () => this.adapter.setSinglePageViewMode(), this.setTwoPagesViewMode = () => this.adapter.setTwoPagesViewMode(), this.setPageScrollVertical = () => this.adapter.setPageScrollVertical(), this.setPageScrollHorizontal = () => this.adapter.setPageScrollHorizontal(), this.setPageCursorPanDrag = () => this.adapter.setPageCursorPanDrag(), this.setPageCursorTextSelect = () => this.adapter.setPageCursorTextSelect(), this.rotateCW = () => this.adapter.rotateCW(), this.rotateCCW = () => this.adapter.rotateCCW(), this.autoFitPage = () => this.adapter.autoFitPage(), this.fitPageSize = () => this.adapter.fitPageSize(), this.fitPageWidth = () => this.adapter.fitPageWidth(), this.fitPageHeight = () => this.adapter.fitPageHeight(), this.increasePageScale = () => this.adapter.increasePageScale(), this.decreasePageScale = () => this.adapter.decreasePageScale(), this.setPageScale = (e) => this.adapter.setPageScale(e), this.setPageBlendColor = (e, i, r, a) => this.adapter.setPageBlendColor(e, i, r, a), this.gotoPage = (e, i, r) => this.adapter.gotoPage(e, i, r), this.gotoNextPage = () => this.adapter.gotoNextPage(), this.gotoPreviousPage = () => this.adapter.gotoPreviousPage(), this.rotatePage = (e) => this.adapter.rotatePage(e), this.adapter = u(
|
|
492
492
|
"page",
|
|
493
|
-
|
|
493
|
+
ye(n),
|
|
494
494
|
n
|
|
495
495
|
);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
const
|
|
498
|
+
const Ee = {
|
|
499
499
|
open: { kind: "command" },
|
|
500
500
|
setFormFieldValue: { kind: "command" },
|
|
501
501
|
setFormFieldReadonly: { kind: "command" },
|
|
@@ -512,28 +512,28 @@ const Te = {
|
|
|
512
512
|
mapCallbackResult: (t) => [Array.isArray(t) ? t : []]
|
|
513
513
|
}
|
|
514
514
|
};
|
|
515
|
-
class
|
|
515
|
+
class Pe {
|
|
516
516
|
constructor(n) {
|
|
517
|
-
this.open = () => this.adapter.open(), this.setFormFieldValue = (e, i) => this.adapter.setFormFieldValue(e, i), this.setFormFieldReadonly = (e, i) => this.adapter.setFormFieldReadonly(e, i), this.commit = (e) => this.adapter.commit(e), this.clear = (e) => this.adapter.clear(e), this.toKeyValue = (e) => this.adapter.toKeyValue(e), this.adapter =
|
|
517
|
+
this.open = () => this.adapter.open(), this.setFormFieldValue = (e, i) => this.adapter.setFormFieldValue(e, i), this.setFormFieldReadonly = (e, i) => this.adapter.setFormFieldReadonly(e, i), this.commit = (e) => this.adapter.commit(e), this.clear = (e) => this.adapter.clear(e), this.toKeyValue = (e) => this.adapter.toKeyValue(e), this.adapter = u(
|
|
518
518
|
"pdfFormFiller",
|
|
519
|
-
|
|
519
|
+
Ee,
|
|
520
520
|
n
|
|
521
521
|
);
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
const
|
|
524
|
+
const Ce = /\s*,\s*/, De = /\s*-\s*/, k = (t) => {
|
|
525
525
|
const n = Number.parseInt(t.trim(), 10);
|
|
526
526
|
return !Number.isFinite(n) || n <= 0 ? null : n;
|
|
527
|
-
},
|
|
528
|
-
const n = t.split(
|
|
527
|
+
}, Ae = (t) => {
|
|
528
|
+
const n = t.split(De);
|
|
529
529
|
if (n.length === 1) {
|
|
530
530
|
const r = k(n[0] ?? "");
|
|
531
531
|
return r ? [r] : [];
|
|
532
532
|
}
|
|
533
533
|
const e = k(n[0] ?? ""), i = k(n[1] ?? "");
|
|
534
534
|
return !e || !i || i < e ? [] : Array.from({ length: i - e + 1 }, (r, a) => e + a);
|
|
535
|
-
},
|
|
536
|
-
class
|
|
535
|
+
}, Me = (t) => t ? t.split(Ce).flatMap((e) => Ae(e)).filter((e, i, r) => r.indexOf(e) === i) : [];
|
|
536
|
+
class we {
|
|
537
537
|
constructor(n, e, i) {
|
|
538
538
|
this.setFieldName = (r) => {
|
|
539
539
|
this.key = r;
|
|
@@ -544,7 +544,7 @@ class De {
|
|
|
544
544
|
}, this.key = n, this.value = e, this.description = i;
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
class
|
|
547
|
+
class Ie {
|
|
548
548
|
constructor() {
|
|
549
549
|
this.fields = [], this.keywordTextFixedPositions = void 0, this.keywordOffsetX = 0, this.keywordOffsetY = 0, this.bookmarkOffsetX = 0, this.bookmarkOffsetY = 0, this.printMargin = 0, this.grayscaleSealImage = !1, this.signType = 0, this.sealPosition = 0, this.getSignType = () => this.signType, this.setSignType = (n) => {
|
|
550
550
|
this.signType = n;
|
|
@@ -554,7 +554,7 @@ class Ae {
|
|
|
554
554
|
this.sealPosition = n;
|
|
555
555
|
}, this.setPageRange = (n) => {
|
|
556
556
|
this.pageRange = n;
|
|
557
|
-
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () =>
|
|
557
|
+
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () => Me(this.pageRange), this.setSignUserData = (n) => {
|
|
558
558
|
this.signUserData = n;
|
|
559
559
|
}, this.setPrintMargin = (n) => {
|
|
560
560
|
this.printMargin = n;
|
|
@@ -567,23 +567,23 @@ class Ae {
|
|
|
567
567
|
};
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
const
|
|
570
|
+
const Oe = {
|
|
571
571
|
getSecuritySettings: { kind: "query" },
|
|
572
572
|
isSecuritySettingsLocalEditable: { kind: "query" },
|
|
573
573
|
setSecuritySettingsLocalEditable: { kind: "query" },
|
|
574
574
|
setSecuritySettings: { kind: "query" },
|
|
575
575
|
openSecuritySettingsDialog: { kind: "command" }
|
|
576
576
|
};
|
|
577
|
-
class
|
|
577
|
+
class _e {
|
|
578
578
|
constructor(n) {
|
|
579
|
-
this.getSecuritySettings = () => this.adapter.getSecuritySettings(), this.setSecuritySettings = (e) => this.adapter.setSecuritySettings(e), this.isSecuritySettingsLocalEditable = () => this.adapter.isSecuritySettingsLocalEditable(), this.setSecuritySettingsLocalEditable = (e) => this.adapter.setSecuritySettingsLocalEditable(e), this.openSecuritySettingsDialog = () => this.adapter.openSecuritySettingsDialog(), this.adapter =
|
|
579
|
+
this.getSecuritySettings = () => this.adapter.getSecuritySettings(), this.setSecuritySettings = (e) => this.adapter.setSecuritySettings(e), this.isSecuritySettingsLocalEditable = () => this.adapter.isSecuritySettingsLocalEditable(), this.setSecuritySettingsLocalEditable = (e) => this.adapter.setSecuritySettingsLocalEditable(e), this.openSecuritySettingsDialog = () => this.adapter.openSecuritySettingsDialog(), this.adapter = u(
|
|
580
580
|
"security",
|
|
581
|
-
|
|
581
|
+
Oe,
|
|
582
582
|
n
|
|
583
583
|
);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
const
|
|
586
|
+
const Le = {
|
|
587
587
|
setSignServer: { kind: "command" },
|
|
588
588
|
addSignServerAuthCallback: {
|
|
589
589
|
kind: "callbackRegister",
|
|
@@ -603,28 +603,28 @@ const Ie = {
|
|
|
603
603
|
setSignServerLoginFromUSBKey: { kind: "command" },
|
|
604
604
|
setUserAuthSource: { kind: "command" }
|
|
605
605
|
};
|
|
606
|
-
class
|
|
606
|
+
class Fe {
|
|
607
607
|
constructor(n) {
|
|
608
|
-
this.setSignServer = (e) => this.adapter.setSignServer(e), this.addSignServerAuthCallback = (e) => this.adapter.addSignServerAuthCallback(e), this.setSignServerDefaultLogin = (e) => this.adapter.setSignServerDefaultLogin(e), this.setDefaultSignServerLogin = (e) => this.adapter.setDefaultSignServerLogin(e), this.setSignServerDefaultPassword = (e) => this.adapter.setSignServerDefaultPassword(e), this.setDefaultSignServerPassword = (e) => this.adapter.setDefaultSignServerPassword(e), this.loginNTKOSignServer = (e, i, r) => this.adapter.loginNTKOSignServer(e, i, r), this.loginSignServer = (e, i, r, a) => this.adapter.loginSignServer(e, i, r, a), this.signOutSignServer = () => this.adapter.signOutSignServer(), this.isAuthenticatedOnSignServer = () => this.adapter.isAuthenticatedOnSignServer(), this.setSignServerLoginFromUSBKey = (e, i) => this.adapter.setSignServerLoginFromUSBKey(e, i), this.setUserAuthSource = (e) => this.adapter.setUserAuthSource(e), this.adapter =
|
|
608
|
+
this.setSignServer = (e) => this.adapter.setSignServer(e), this.addSignServerAuthCallback = (e) => this.adapter.addSignServerAuthCallback(e), this.setSignServerDefaultLogin = (e) => this.adapter.setSignServerDefaultLogin(e), this.setDefaultSignServerLogin = (e) => this.adapter.setDefaultSignServerLogin(e), this.setSignServerDefaultPassword = (e) => this.adapter.setSignServerDefaultPassword(e), this.setDefaultSignServerPassword = (e) => this.adapter.setDefaultSignServerPassword(e), this.loginNTKOSignServer = (e, i, r) => this.adapter.loginNTKOSignServer(e, i, r), this.loginSignServer = (e, i, r, a) => this.adapter.loginSignServer(e, i, r, a), this.signOutSignServer = () => this.adapter.signOutSignServer(), this.isAuthenticatedOnSignServer = () => this.adapter.isAuthenticatedOnSignServer(), this.setSignServerLoginFromUSBKey = (e, i) => this.adapter.setSignServerLoginFromUSBKey(e, i), this.setUserAuthSource = (e) => this.adapter.setUserAuthSource(e), this.adapter = u(
|
|
609
609
|
"signServer",
|
|
610
|
-
|
|
610
|
+
Le,
|
|
611
611
|
n
|
|
612
612
|
);
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
const
|
|
615
|
+
const Ue = {
|
|
616
616
|
createPDF417Barcode: { kind: "command" }
|
|
617
617
|
};
|
|
618
|
-
class
|
|
618
|
+
class Ne {
|
|
619
619
|
constructor(n) {
|
|
620
|
-
this.createPDF417Barcode = (e, i, r, a, s, o,
|
|
620
|
+
this.createPDF417Barcode = (e, i, r, a, s, o, d) => this.adapter.createPDF417Barcode(e, i, r, a, s, o, d), this.adapter = u(
|
|
621
621
|
"symbology",
|
|
622
|
-
|
|
622
|
+
Ue,
|
|
623
623
|
n
|
|
624
624
|
);
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
const
|
|
627
|
+
const Be = {
|
|
628
628
|
setup: { kind: "command" },
|
|
629
629
|
create: { kind: "command" },
|
|
630
630
|
getMarkups: { kind: "callbackQuery" },
|
|
@@ -632,16 +632,16 @@ const Fe = {
|
|
|
632
632
|
removeAllMarkups: { kind: "command" },
|
|
633
633
|
sign: { kind: "callbackQuery" }
|
|
634
634
|
};
|
|
635
|
-
class
|
|
635
|
+
class xe {
|
|
636
636
|
constructor(n) {
|
|
637
|
-
this.setup = (e) => this.adapter.setup(e), this.create = (e) => this.adapter.create(e), this.getMarkups = (e) => this.adapter.getMarkups(e), this.removeMarkup = (e, i) => this.adapter.removeMarkup(e, i), this.removeAllMarkups = (e) => this.adapter.removeAllMarkups(e), this.sign = (e) => this.adapter.sign(e), this.adapter =
|
|
637
|
+
this.setup = (e) => this.adapter.setup(e), this.create = (e) => this.adapter.create(e), this.getMarkups = (e) => this.adapter.getMarkups(e), this.removeMarkup = (e, i) => this.adapter.removeMarkup(e, i), this.removeAllMarkups = (e) => this.adapter.removeAllMarkups(e), this.sign = (e) => this.adapter.sign(e), this.adapter = u(
|
|
638
638
|
"templateSign",
|
|
639
|
-
|
|
639
|
+
Be,
|
|
640
640
|
n
|
|
641
641
|
);
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
const
|
|
644
|
+
const Ve = /* @__PURE__ */ new Set([2, 5]), Ke = (t) => ({
|
|
645
645
|
showToolbarMenu: { kind: "command" },
|
|
646
646
|
hideToolbarMenu: { kind: "command" },
|
|
647
647
|
setupToolbarMenu: { kind: "command" },
|
|
@@ -680,13 +680,13 @@ const Ne = /* @__PURE__ */ new Set([2, 5]), Be = (t) => ({
|
|
|
680
680
|
exitBookViewMode: { kind: "command" },
|
|
681
681
|
isBookViewActivated: {
|
|
682
682
|
kind: "stateGetter",
|
|
683
|
-
state: () =>
|
|
683
|
+
state: () => Ve.has(t.state.snapshot().pageMode)
|
|
684
684
|
},
|
|
685
685
|
requestFullScreen: { kind: "command" },
|
|
686
686
|
exitFullScreen: { kind: "command" },
|
|
687
687
|
invalidateView: { kind: "command" }
|
|
688
688
|
});
|
|
689
|
-
class
|
|
689
|
+
class Ge {
|
|
690
690
|
constructor(n) {
|
|
691
691
|
this.showToolbarMenu = () => (this.warnLegacyRibbonMethod("showToolbarMenu", "showRibbonMenu"), this.showRibbonMenu()), this.hideToolbarMenu = () => (this.warnLegacyRibbonMethod("hideToolbarMenu", "hideRibbonMenu"), this.hideRibbonMenu()), this.setupToolbarMenu = (e) => (this.warnLegacyRibbonMethod(
|
|
692
692
|
"setupToolbarMenu",
|
|
@@ -694,13 +694,13 @@ class xe {
|
|
|
694
694
|
), this.setupRibbonMenu(e)), this.showToolbarMenuItem = (e) => (this.warnLegacyRibbonMethod("showToolbarMenuItem", "showRibbonMenuItem"), this.showRibbonMenuItem(e)), this.hideToolbarMenuItem = (e) => (this.warnLegacyRibbonMethod("hideToolbarMenuItem", "hideRibbonMenuItem"), this.hideRibbonMenuItem(e)), this.setupRibbonMenu = (e) => (this.warnLegacyRibbonMethod(
|
|
695
695
|
"setupRibbonMenu",
|
|
696
696
|
"showRibbonMenu/hideRibbonMenu/setupRibbonMenuTab"
|
|
697
|
-
), typeof e == "boolean" ? e ? this.showRibbonMenu() : this.hideRibbonMenu() : this.setupRibbonMenuTab(e.menu, { visible: e.visible })), this.setupRibbonMenuItem = (e, i, r) => (this.warnLegacyRibbonMethod("setupRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: i, config: r })), this.setupRibbonTitleBar = (e) => (this.warnLegacyRibbonMethod("setupRibbonTitleBar", "showRibbonTabs/hideRibbonTabs"), e ? this.showRibbonTabs() : this.hideRibbonTabs()), this.showRibbonMenu = () => this.adapter.showRibbonMenu(), this.hideRibbonMenu = () => this.adapter.hideRibbonMenu(), this.showRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("showRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !0, config: i })), this.hideRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("hideRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !1, config: i })), this.showRibbonTitleBar = () => (this.warnLegacyRibbonMethod("showRibbonTitleBar", "showRibbonTabs"), this.showRibbonTabs()), this.hideRibbonTitleBar = () => (this.warnLegacyRibbonMethod("hideRibbonTitleBar", "hideRibbonTabs"), this.hideRibbonTabs()), this.showRibbonTabs = () => this.adapter.showRibbonTabs(), this.hideRibbonTabs = () => this.adapter.hideRibbonTabs(), this.selectRibbonMenu = (e) => this.adapter.selectRibbonMenu(e), this.setupRibbonMenuTab = (e, i) => this.adapter.setupRibbonMenuTab(e, i), this.showRibbonMenuTab = (e) => this.adapter.showRibbonMenuTab(e), this.hideRibbonMenuTab = (e) => this.adapter.hideRibbonMenuTab(e), this.enableRibbonMenuTab = (e) => this.adapter.enableRibbonMenuTab(e), this.disableRibbonMenuTab = (e) => this.adapter.disableRibbonMenuTab(e), this.setupRibbonMenuItemState = (e, i) => this.adapter.setupRibbonMenuItemState(e, i), this.enableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !1, config: i }), this.disableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !0, config: i }), this.setRibbonMenuButtonStyle = (e, i) => this.adapter.setRibbonMenuButtonStyle(e, i), this.setWatermark = (e) => this.adapter.setWatermark(e), this.setCompactMode = (e) => this.adapter.setCompactMode(e), this.setRulerVisible = (e) => this.adapter.setRulerVisible(e), this.setStatusBarVisible = (e) => this.adapter.setStatusBarVisible(e), this.toggleSidebar = () => this.adapter.toggleSidebar(), this.enterBookViewMode = (e) => this.adapter.enterBookViewMode(e), this.exitBookViewMode = () => this.adapter.exitBookViewMode(), this.isBookViewActivated = () => this.adapter.isBookViewActivated(), this.requestFullScreen = () => this.adapter.requestFullScreen(), this.exitFullScreen = () => this.adapter.exitFullScreen(), this.invalidateView = () => this.adapter.invalidateView(), this.adapter =
|
|
697
|
+
), typeof e == "boolean" ? e ? this.showRibbonMenu() : this.hideRibbonMenu() : this.setupRibbonMenuTab(e.menu, { visible: e.visible })), this.setupRibbonMenuItem = (e, i, r) => (this.warnLegacyRibbonMethod("setupRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: i, config: r })), this.setupRibbonTitleBar = (e) => (this.warnLegacyRibbonMethod("setupRibbonTitleBar", "showRibbonTabs/hideRibbonTabs"), e ? this.showRibbonTabs() : this.hideRibbonTabs()), this.showRibbonMenu = () => this.adapter.showRibbonMenu(), this.hideRibbonMenu = () => this.adapter.hideRibbonMenu(), this.showRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("showRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !0, config: i })), this.hideRibbonMenuItem = (e, i) => (this.warnLegacyRibbonMethod("hideRibbonMenuItem", "setupRibbonMenuItemState"), this.setupRibbonMenuItemState(e, { visible: !1, config: i })), this.showRibbonTitleBar = () => (this.warnLegacyRibbonMethod("showRibbonTitleBar", "showRibbonTabs"), this.showRibbonTabs()), this.hideRibbonTitleBar = () => (this.warnLegacyRibbonMethod("hideRibbonTitleBar", "hideRibbonTabs"), this.hideRibbonTabs()), this.showRibbonTabs = () => this.adapter.showRibbonTabs(), this.hideRibbonTabs = () => this.adapter.hideRibbonTabs(), this.selectRibbonMenu = (e) => this.adapter.selectRibbonMenu(e), this.setupRibbonMenuTab = (e, i) => this.adapter.setupRibbonMenuTab(e, i), this.showRibbonMenuTab = (e) => this.adapter.showRibbonMenuTab(e), this.hideRibbonMenuTab = (e) => this.adapter.hideRibbonMenuTab(e), this.enableRibbonMenuTab = (e) => this.adapter.enableRibbonMenuTab(e), this.disableRibbonMenuTab = (e) => this.adapter.disableRibbonMenuTab(e), this.setupRibbonMenuItemState = (e, i) => this.adapter.setupRibbonMenuItemState(e, i), this.enableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !1, config: i }), this.disableRibbonMenuItem = (e, i) => this.setupRibbonMenuItemState(e, { disabled: !0, config: i }), this.setRibbonMenuButtonStyle = (e, i) => this.adapter.setRibbonMenuButtonStyle(e, i), this.setWatermark = (e) => this.adapter.setWatermark(e), this.setCompactMode = (e) => this.adapter.setCompactMode(e), this.setRulerVisible = (e) => this.adapter.setRulerVisible(e), this.setStatusBarVisible = (e) => this.adapter.setStatusBarVisible(e), this.toggleSidebar = () => this.adapter.toggleSidebar(), this.enterBookViewMode = (e) => this.adapter.enterBookViewMode(e), this.exitBookViewMode = () => this.adapter.exitBookViewMode(), this.isBookViewActivated = () => this.adapter.isBookViewActivated(), this.requestFullScreen = () => this.adapter.requestFullScreen(), this.exitFullScreen = () => this.adapter.exitFullScreen(), this.invalidateView = () => this.adapter.invalidateView(), this.adapter = u("ui", Ke(n), n);
|
|
698
698
|
}
|
|
699
699
|
warnLegacyRibbonMethod(n, e) {
|
|
700
700
|
console.warn(`[RHC Office SDK] ui.${n} is deprecated. Use ui.${e} instead.`);
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
const
|
|
703
|
+
const qe = (t) => {
|
|
704
704
|
if (!t)
|
|
705
705
|
return;
|
|
706
706
|
const n = t.trim().toLowerCase();
|
|
@@ -708,42 +708,42 @@ const Ve = (t) => {
|
|
|
708
708
|
return "auto";
|
|
709
709
|
if (n === "light" || n === "dark" || n === "high-contrast" || n === "auto")
|
|
710
710
|
return n;
|
|
711
|
-
},
|
|
711
|
+
}, Q = (t) => {
|
|
712
712
|
const n = new URL(t, globalThis.location?.href ?? "http://localhost/");
|
|
713
713
|
return n.hash = "", n.pathname.endsWith("/") || (n.pathname = `${n.pathname}/`), n.toString();
|
|
714
|
-
},
|
|
715
|
-
const e =
|
|
714
|
+
}, ze = (t) => new URL("editors.bootstrap.js", t).toString(), He = (t, n) => {
|
|
715
|
+
const e = Q(t);
|
|
716
716
|
return {
|
|
717
717
|
...n,
|
|
718
718
|
appUrl: e,
|
|
719
|
-
theme:
|
|
719
|
+
theme: qe(n.theme)
|
|
720
720
|
};
|
|
721
|
-
}, m = "rhc-office-editor", T = "__RHC_OFFICE_SDK_READER_LOADER__",
|
|
721
|
+
}, m = "rhc-office-editor", T = "__RHC_OFFICE_SDK_READER_LOADER__", j = () => {
|
|
722
722
|
const t = globalThis;
|
|
723
723
|
return t[T] || (t[T] = {
|
|
724
724
|
activeAppUrl: null,
|
|
725
725
|
loadPromises: /* @__PURE__ */ new Map()
|
|
726
726
|
}), t[T];
|
|
727
|
-
},
|
|
728
|
-
class
|
|
727
|
+
}, Qe = (t) => Array.from(document.querySelectorAll("script")).find((n) => n.src === t) ?? null;
|
|
728
|
+
class w extends Error {
|
|
729
729
|
constructor(n) {
|
|
730
730
|
super(`Failed to load reader bootstrap script: ${n}`), this.name = "ReaderScriptLoadError";
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
class
|
|
733
|
+
class je extends Error {
|
|
734
734
|
constructor(n, e) {
|
|
735
735
|
super(
|
|
736
736
|
`Reader Web Component "${m}" is already bound to ${n} and cannot be reloaded from ${e}.`
|
|
737
737
|
), this.name = "ReaderSourceConflictError";
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
const
|
|
741
|
-
const n =
|
|
740
|
+
const W = (t) => {
|
|
741
|
+
const n = j();
|
|
742
742
|
if (n.activeAppUrl && n.activeAppUrl !== t)
|
|
743
|
-
throw new
|
|
744
|
-
},
|
|
745
|
-
const n =
|
|
746
|
-
|
|
743
|
+
throw new je(n.activeAppUrl, t);
|
|
744
|
+
}, We = (t) => {
|
|
745
|
+
const n = j();
|
|
746
|
+
W(t);
|
|
747
747
|
const e = n.loadPromises.get(t);
|
|
748
748
|
if (e)
|
|
749
749
|
return e;
|
|
@@ -752,12 +752,12 @@ const z = (t) => {
|
|
|
752
752
|
const s = Promise.resolve();
|
|
753
753
|
return n.loadPromises.set(t, s), s;
|
|
754
754
|
}
|
|
755
|
-
const i =
|
|
755
|
+
const i = ze(t), r = Qe(i);
|
|
756
756
|
n.activeAppUrl = t;
|
|
757
757
|
const a = new Promise((s, o) => {
|
|
758
|
-
const
|
|
759
|
-
h?.remove(), o(new
|
|
760
|
-
},
|
|
758
|
+
const d = (h) => {
|
|
759
|
+
h?.remove(), o(new w(i));
|
|
760
|
+
}, l = () => {
|
|
761
761
|
globalThis.customElements.whenDefined(m).then(() => {
|
|
762
762
|
s();
|
|
763
763
|
}).catch(o);
|
|
@@ -769,31 +769,31 @@ const z = (t) => {
|
|
|
769
769
|
}
|
|
770
770
|
r.addEventListener(
|
|
771
771
|
"error",
|
|
772
|
-
() => o(new
|
|
772
|
+
() => o(new w(i)),
|
|
773
773
|
{
|
|
774
774
|
once: !0
|
|
775
775
|
}
|
|
776
|
-
),
|
|
776
|
+
), l();
|
|
777
777
|
return;
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
|
|
779
|
+
const c = document.createElement("script");
|
|
780
|
+
c.src = i, c.async = !0, c.dataset.rhcOfficeSdkReader = t, c.addEventListener("load", l, { once: !0 }), c.addEventListener("error", () => d(c), { once: !0 }), document.head.appendChild(c);
|
|
781
781
|
}).catch((s) => {
|
|
782
782
|
throw n.loadPromises.delete(t), !globalThis.customElements?.get(m) && n.activeAppUrl === t && (n.activeAppUrl = null), s;
|
|
783
783
|
});
|
|
784
784
|
return n.loadPromises.set(t, a), a;
|
|
785
|
-
},
|
|
785
|
+
}, Ye = 5e3, $e = 5e3, Xe = () => {
|
|
786
786
|
const t = globalThis.crypto;
|
|
787
787
|
return typeof t?.randomUUID == "function" ? t.randomUUID() : `adapter-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
788
|
-
}, b = () => globalThis[
|
|
789
|
-
class
|
|
788
|
+
}, b = () => globalThis[he];
|
|
789
|
+
class Je extends Error {
|
|
790
790
|
constructor(n, e, i) {
|
|
791
791
|
super(e), this.name = "ReaderBridgeError", this.code = n, this.details = i;
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
|
-
class
|
|
794
|
+
class Ze {
|
|
795
795
|
constructor(n) {
|
|
796
|
-
this.readerId = null, this.readyTimeoutMs = n?.readyTimeoutMs ??
|
|
796
|
+
this.readerId = null, this.readyTimeoutMs = n?.readyTimeoutMs ?? $e, this.requestTimeoutMs = n?.requestTimeoutMs ?? Ye;
|
|
797
797
|
}
|
|
798
798
|
configureTimeouts(n) {
|
|
799
799
|
this.readyTimeoutMs = n?.readyTimeoutMs ?? this.readyTimeoutMs, this.requestTimeoutMs = n?.requestTimeoutMs ?? this.requestTimeoutMs;
|
|
@@ -808,7 +808,7 @@ class $e {
|
|
|
808
808
|
const a = await this.requestRaw(n, e, i, r);
|
|
809
809
|
if (a.ok)
|
|
810
810
|
return a.result;
|
|
811
|
-
throw new
|
|
811
|
+
throw new Je(
|
|
812
812
|
a.error.code,
|
|
813
813
|
a.error.message,
|
|
814
814
|
a.error.details
|
|
@@ -835,9 +835,9 @@ class $e {
|
|
|
835
835
|
}
|
|
836
836
|
};
|
|
837
837
|
const s = {
|
|
838
|
-
protocol:
|
|
839
|
-
version:
|
|
840
|
-
requestId:
|
|
838
|
+
protocol: le,
|
|
839
|
+
version: ce,
|
|
840
|
+
requestId: Xe(),
|
|
841
841
|
readerId: this.readerId,
|
|
842
842
|
tool: n,
|
|
843
843
|
method: e,
|
|
@@ -860,14 +860,14 @@ class $e {
|
|
|
860
860
|
return i?.getCapabilities(n) ? i : new Promise((r) => {
|
|
861
861
|
let a;
|
|
862
862
|
const s = () => {
|
|
863
|
-
a && clearTimeout(a), globalThis.removeEventListener(
|
|
864
|
-
}, o = (
|
|
865
|
-
if ((
|
|
863
|
+
a && clearTimeout(a), globalThis.removeEventListener(A, o);
|
|
864
|
+
}, o = (d) => {
|
|
865
|
+
if ((d instanceof CustomEvent ? d.detail : void 0)?.readerId !== n)
|
|
866
866
|
return;
|
|
867
|
-
const
|
|
868
|
-
s(), r(
|
|
867
|
+
const c = b();
|
|
868
|
+
s(), r(c ?? null);
|
|
869
869
|
};
|
|
870
|
-
globalThis.addEventListener(
|
|
870
|
+
globalThis.addEventListener(A, o), a = setTimeout(() => {
|
|
871
871
|
s(), r(b()?.getCapabilities(n) ? b() : null);
|
|
872
872
|
}, e);
|
|
873
873
|
});
|
|
@@ -899,7 +899,7 @@ class $e {
|
|
|
899
899
|
});
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
const
|
|
902
|
+
const I = {
|
|
903
903
|
annotationEnabled: !1,
|
|
904
904
|
documentModified: !1,
|
|
905
905
|
documentOpened: !1,
|
|
@@ -908,12 +908,12 @@ const w = {
|
|
|
908
908
|
pageMode: 0,
|
|
909
909
|
zoomLevel: 100
|
|
910
910
|
};
|
|
911
|
-
class
|
|
911
|
+
class et {
|
|
912
912
|
constructor() {
|
|
913
|
-
this.state = { ...
|
|
913
|
+
this.state = { ...I };
|
|
914
914
|
}
|
|
915
915
|
reset() {
|
|
916
|
-
this.state = { ...
|
|
916
|
+
this.state = { ...I };
|
|
917
917
|
}
|
|
918
918
|
update(n) {
|
|
919
919
|
n && (this.state = {
|
|
@@ -937,18 +937,18 @@ class Xe {
|
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
|
-
const
|
|
941
|
-
if (!
|
|
940
|
+
const tt = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t : void 0, Y = (t) => typeof t == "object" && t !== null && !Array.isArray(t), O = (t) => {
|
|
941
|
+
if (!Y(t))
|
|
942
942
|
return;
|
|
943
943
|
const n = {};
|
|
944
944
|
return typeof t.currentPage == "number" && (n.currentPage = t.currentPage), typeof t.documentType == "string" && (n.documentType = t.documentType), typeof t.totalPages == "number" ? n.totalPages = t.totalPages : typeof t.pageCount == "number" && (n.totalPages = t.pageCount), typeof t.zoomLevel == "number" && (n.zoomLevel = t.zoomLevel), Object.keys(n).length > 0 ? n : void 0;
|
|
945
|
-
},
|
|
946
|
-
if (!
|
|
945
|
+
}, nt = (t) => {
|
|
946
|
+
if (!Y(t))
|
|
947
947
|
return {
|
|
948
948
|
success: !0,
|
|
949
949
|
status: "ok"
|
|
950
950
|
};
|
|
951
|
-
const n =
|
|
951
|
+
const n = O(t.state), e = O(t), i = typeof t.error == "string" ? t.error : void 0, r = typeof t.success == "boolean" ? t.success : !i, a = typeof t.status == "string" ? t.status : r ? "ok" : "error";
|
|
952
952
|
return {
|
|
953
953
|
success: r,
|
|
954
954
|
status: a,
|
|
@@ -956,7 +956,7 @@ const Je = (t) => typeof t == "object" && t !== null && !Array.isArray(t) ? t :
|
|
|
956
956
|
state: n ?? e
|
|
957
957
|
};
|
|
958
958
|
};
|
|
959
|
-
class
|
|
959
|
+
class it {
|
|
960
960
|
constructor() {
|
|
961
961
|
this.annotationEvents = [], this.annotationPersist = [], this.annotationRetrieve = [], this.digitalAnnotationRetrieve = [], this.digitalSign = [], this.digitalSignatureParse = [], this.digitalSignatureRetrieve = [], this.documentClosed = [], this.documentOpened = [], this.documentSaved = [], this.pageChange = [], this.pageModeChange = [], this.signServerAuth = [];
|
|
962
962
|
}
|
|
@@ -964,7 +964,7 @@ class et {
|
|
|
964
964
|
switch (n) {
|
|
965
965
|
case "documentOpened":
|
|
966
966
|
case "documentLoaded": {
|
|
967
|
-
const i =
|
|
967
|
+
const i = nt(e);
|
|
968
968
|
this.documentOpened.forEach(
|
|
969
969
|
(r) => r(i.status ?? "ok", i.error ?? "", i)
|
|
970
970
|
);
|
|
@@ -993,7 +993,7 @@ class et {
|
|
|
993
993
|
this.annotationEvents.forEach(
|
|
994
994
|
(r) => r(
|
|
995
995
|
i.event ?? "annotationEvent",
|
|
996
|
-
|
|
996
|
+
tt(i.payload)
|
|
997
997
|
)
|
|
998
998
|
);
|
|
999
999
|
return;
|
|
@@ -1030,15 +1030,15 @@ class et {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
|
-
const S = "__RHC_OFFICE_READER_RUNTIME__",
|
|
1033
|
+
const S = "__RHC_OFFICE_READER_RUNTIME__", y = "__rhcOfficeReaderRuntimeConfig", rt = [
|
|
1034
1034
|
"documentLoaded",
|
|
1035
1035
|
"documentStateChange",
|
|
1036
1036
|
"documentError"
|
|
1037
|
-
],
|
|
1037
|
+
], at = "readerReady", st = "readerUnload", v = "readerError", ot = () => typeof globalThis.crypto?.randomUUID == "function" ? globalThis.crypto.randomUUID() : `rhc-reader-${Date.now()}-${Math.random().toString(36).slice(2)}`, _ = (t, n) => ({
|
|
1038
1038
|
appUrl: n?.appUrl ?? null,
|
|
1039
1039
|
configuration: n,
|
|
1040
1040
|
element: t
|
|
1041
|
-
}),
|
|
1041
|
+
}), L = (t, n) => {
|
|
1042
1042
|
if (!t)
|
|
1043
1043
|
return;
|
|
1044
1044
|
const e = typeof t == "string" ? t.trim() : t.userName.trim();
|
|
@@ -1049,7 +1049,13 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", tt = "__rhcOfficeReaderRuntimeConfig"
|
|
|
1049
1049
|
sessionUser: e,
|
|
1050
1050
|
...a ? { sessionUserId: a } : {}
|
|
1051
1051
|
};
|
|
1052
|
-
},
|
|
1052
|
+
}, F = (t) => {
|
|
1053
|
+
const n = t.trim().replace(/[-_\s]/g, "").toLowerCase();
|
|
1054
|
+
return n === "annotation" ? "ANNOTATION" : n === "digitalsign" ? "DIGITAL_SIGN" : "VIEW";
|
|
1055
|
+
}, dt = (t) => {
|
|
1056
|
+
const n = {};
|
|
1057
|
+
return t.canOpenNewFile !== void 0 && (n.canOpenNewFile = t.canOpenNewFile), t.canPrint !== void 0 && (n.canPrint = t.canPrint), t.canDownload !== void 0 && (n.canDownload = t.canDownload), Object.keys(n).length > 0 ? n : void 0;
|
|
1058
|
+
}, ut = (t) => {
|
|
1053
1059
|
if (typeof t == "string") {
|
|
1054
1060
|
const n = document.getElementById(t);
|
|
1055
1061
|
if (!n)
|
|
@@ -1061,52 +1067,52 @@ const S = "__RHC_OFFICE_READER_RUNTIME__", tt = "__rhcOfficeReaderRuntimeConfig"
|
|
|
1061
1067
|
if (!(t instanceof HTMLDivElement))
|
|
1062
1068
|
throw new Error("Reader container must be a div element.");
|
|
1063
1069
|
return t;
|
|
1064
|
-
},
|
|
1070
|
+
}, lt = () => {
|
|
1065
1071
|
const t = typeof globalThis.matchMedia == "function";
|
|
1066
1072
|
return (t ? globalThis.matchMedia("(prefers-contrast: more)").matches : !1) ? "high-contrast" : (t ? globalThis.matchMedia("(prefers-color-scheme: dark)").matches : !1) ? "dark" : "light";
|
|
1067
|
-
},
|
|
1073
|
+
}, U = (t, n) => {
|
|
1068
1074
|
const e = t;
|
|
1069
1075
|
if (typeof e.addEventListener == "function") {
|
|
1070
1076
|
e.addEventListener("change", n);
|
|
1071
1077
|
return;
|
|
1072
1078
|
}
|
|
1073
1079
|
typeof e.addListener == "function" && e.addListener(n);
|
|
1074
|
-
},
|
|
1080
|
+
}, N = (t, n) => {
|
|
1075
1081
|
const e = t;
|
|
1076
1082
|
if (typeof e.removeEventListener == "function") {
|
|
1077
1083
|
e.removeEventListener("change", n);
|
|
1078
1084
|
return;
|
|
1079
1085
|
}
|
|
1080
1086
|
typeof e.removeListener == "function" && e.removeListener(n);
|
|
1081
|
-
},
|
|
1087
|
+
}, ct = (t) => {
|
|
1082
1088
|
t.style.display || (t.style.display = "block"), t.style.width || (t.style.width = "100%"), t.style.height || (t.style.height = "100%");
|
|
1083
|
-
},
|
|
1089
|
+
}, B = (t, n) => {
|
|
1084
1090
|
const e = n;
|
|
1085
1091
|
if (!e)
|
|
1086
1092
|
return t.removeAttribute("theme"), null;
|
|
1087
1093
|
if (e !== "auto")
|
|
1088
1094
|
return t.setAttribute("theme", e), null;
|
|
1089
1095
|
const i = () => {
|
|
1090
|
-
t.setAttribute("theme",
|
|
1096
|
+
t.setAttribute("theme", lt());
|
|
1091
1097
|
};
|
|
1092
1098
|
if (i(), typeof globalThis.matchMedia != "function")
|
|
1093
1099
|
return null;
|
|
1094
1100
|
const r = globalThis.matchMedia("(prefers-color-scheme: dark)"), a = globalThis.matchMedia("(prefers-contrast: more)"), s = () => {
|
|
1095
1101
|
i();
|
|
1096
1102
|
};
|
|
1097
|
-
return
|
|
1098
|
-
|
|
1103
|
+
return U(r, s), U(a, s), () => {
|
|
1104
|
+
N(r, s), N(a, s);
|
|
1099
1105
|
};
|
|
1100
1106
|
};
|
|
1101
|
-
class
|
|
1107
|
+
class ht {
|
|
1102
1108
|
constructor(n) {
|
|
1103
|
-
this.bridge = new
|
|
1109
|
+
this.bridge = new Ze(), this.callbacks = new it(), this.readerState = new et(), this.bridgeToolContext = {
|
|
1104
1110
|
bridge: this.bridge,
|
|
1105
1111
|
callbacks: this.callbacks,
|
|
1106
1112
|
debug: () => this.debugEnabled,
|
|
1107
1113
|
onAsyncError: (e) => this.reportAdapterError(e),
|
|
1108
1114
|
state: this.readerState
|
|
1109
|
-
}, this.documentTool = new
|
|
1115
|
+
}, this.documentTool = new me(this.bridgeToolContext), this.uiTool = new Ge(this.bridgeToolContext), this.pageTool = new ve(this.bridgeToolContext), this.pageArrangeTool = new Te(this.bridgeToolContext), this.findTool = new be(this.bridgeToolContext), this.signServerTool = new Fe(this.bridgeToolContext), this.digitalSignTool = new ue(this.bridgeToolContext), this.symbologyTool = new Ne(this.bridgeToolContext), this.annotationTool = new ae(this.bridgeToolContext), this.templateSignTool = new xe(this.bridgeToolContext), this.pdfFormFiller = new Pe(this.bridgeToolContext), this.networkingTool = new fe(this.bridgeToolContext), this.cryptoTool = new oe(this.bridgeToolContext), this.securityTool = new _e(this.bridgeToolContext), this.readyCallbacks = [], this.unloadCallbacks = [], this.debugEnabled = !1, this.isReady = !1, this.removed = !1, this.mountToken = 0, this.hostContainer = null, this.readerElement = null, this.readerId = null, this.normalizedConfiguration = null, this.runtimeRestoreState = null, this.nativeEventCleanupCallbacks = [], this.themeCleanup = null, this.enableDebug = (e) => {
|
|
1110
1116
|
this.debugEnabled = e;
|
|
1111
1117
|
}, this.changeLanguage = (e) => {
|
|
1112
1118
|
this.readerElement && this.readerElement.setAttribute("language", e);
|
|
@@ -1114,13 +1120,13 @@ class lt {
|
|
|
1114
1120
|
this.themeCleanup?.(), this.themeCleanup = null, this.normalizedConfiguration = this.normalizedConfiguration ? {
|
|
1115
1121
|
...this.normalizedConfiguration,
|
|
1116
1122
|
theme: e
|
|
1117
|
-
} : null, this.readerElement && (this.themeCleanup =
|
|
1123
|
+
} : null, this.readerElement && (this.themeCleanup = B(this.readerElement, e));
|
|
1118
1124
|
}, this.setSessionUser = (e) => {
|
|
1119
|
-
this.sessionUser = e;
|
|
1125
|
+
this.sessionUser = e, this.syncReaderRuntimeConfig();
|
|
1120
1126
|
}, this.setSessionUserId = (e) => {
|
|
1121
|
-
this.sessionUserId = e;
|
|
1127
|
+
this.sessionUserId = e, this.syncReaderRuntimeConfig();
|
|
1122
1128
|
}, this.setSessionData = (e) => {
|
|
1123
|
-
this.sessionData = e;
|
|
1129
|
+
this.sessionData = e, this.syncReaderRuntimeConfig();
|
|
1124
1130
|
}, this.isReaderReady = () => this.isReady, this.isReaderDestroyed = () => this.removed && !this.isReady, this.addReaderReadyCallback = (e) => {
|
|
1125
1131
|
this.readyCallbacks.push(e);
|
|
1126
1132
|
}, this.addReaderUnloadCallback = (e) => {
|
|
@@ -1128,36 +1134,36 @@ class lt {
|
|
|
1128
1134
|
}, this.setReaderEventListener = (e) => {
|
|
1129
1135
|
this.readerEventListener = e;
|
|
1130
1136
|
}, this.embedReader = (e, i, r) => {
|
|
1131
|
-
const a =
|
|
1132
|
-
|
|
1133
|
-
const o =
|
|
1134
|
-
this.removeReader(), this.mountToken =
|
|
1137
|
+
const a = ut(e), s = Q(i);
|
|
1138
|
+
W(s);
|
|
1139
|
+
const o = He(s, r), d = this.mountToken + 1;
|
|
1140
|
+
this.removeReader(), this.mountToken = d, this.removed = !1, this.hostContainer = a, this.normalizedConfiguration = o, this.mountReader(a, o, d);
|
|
1135
1141
|
}, this.removeReader = () => {
|
|
1136
1142
|
const e = !!(this.readerElement || this.hostContainer);
|
|
1137
1143
|
if (this.mountToken += 1, this.cleanupNativeEventForwarders(), this.cleanupThemeBinding(), this.restoreReaderRuntimeConfig(), this.readerElement?.parentNode && this.readerElement.parentNode.removeChild(this.readerElement), this.readerElement = null, this.readerId = null, this.bridge.setReaderId(null), this.readerState.reset(), this.hostContainer = null, this.normalizedConfiguration = null, this.isReady = !1, this.removed = !0, !e)
|
|
1138
1144
|
return;
|
|
1139
1145
|
const i = _(null, null);
|
|
1140
|
-
this.emitReaderEvent(
|
|
1141
|
-
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getPageArrangeTool = () => this.pageArrangeTool, this.getFindTool = () => this.findTool, this.getSignServerTool = () => this.signServerTool, this.getDigitalSignTool = () => this.digitalSignTool, this.getSymbologyTool = () => this.symbologyTool, this.getAnnotationTool = () => this.annotationTool, this.getTemplateSignTool = () => this.templateSignTool, this.getPdfFormFiller = () => this.pdfFormFiller, this.getNetworkingTool = () => this.networkingTool, this.getCryptoTool = () => this.cryptoTool, this.getSecurityTool = () => this.securityTool, this.createDigitalSignOptions = () => new
|
|
1146
|
+
this.emitReaderEvent(st, i), this.unloadCallbacks.forEach((r) => r());
|
|
1147
|
+
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getPageArrangeTool = () => this.pageArrangeTool, this.getFindTool = () => this.findTool, this.getSignServerTool = () => this.signServerTool, this.getDigitalSignTool = () => this.digitalSignTool, this.getSymbologyTool = () => this.symbologyTool, this.getAnnotationTool = () => this.annotationTool, this.getTemplateSignTool = () => this.templateSignTool, this.getPdfFormFiller = () => this.pdfFormFiller, this.getNetworkingTool = () => this.networkingTool, this.getCryptoTool = () => this.cryptoTool, this.getSecurityTool = () => this.securityTool, this.createDigitalSignOptions = () => new Ie(), this.createKVField = (e, i, r) => new we(e, i, r), this.mountReader = async (e, i, r) => {
|
|
1142
1148
|
try {
|
|
1143
|
-
if (await
|
|
1149
|
+
if (await We(i.appUrl), this.mountToken !== r)
|
|
1144
1150
|
return;
|
|
1145
|
-
const a = document.createElement(m), s =
|
|
1146
|
-
a.setAttribute(
|
|
1151
|
+
const a = document.createElement(m), s = ot();
|
|
1152
|
+
a.setAttribute(H, s), this.readerId = s, this.bridge.setReaderId(s), ct(a), this.applyReaderRuntimeConfig(a, i);
|
|
1147
1153
|
const o = i.compactViewer === !0 && i.keepPCMenu !== !0;
|
|
1148
1154
|
if (a.toggleAttribute("data-sdk-compact-mode", o), a.toggleAttribute("data-sdk-ribbon-hidden", i.ribbonMenu === !1), a.toggleAttribute(
|
|
1149
1155
|
"data-sdk-ribbon-title-hidden",
|
|
1150
1156
|
i.ribbonTitle === !1
|
|
1151
|
-
), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup =
|
|
1157
|
+
), a.setAttribute("language", i.language ?? "zh_CN"), this.themeCleanup = B(a, i.theme), this.bindNativeReaderEvents(a), e.replaceChildren(a), this.readerElement = a, await Promise.resolve(), this.mountToken !== r)
|
|
1152
1158
|
return;
|
|
1153
|
-
const
|
|
1159
|
+
const d = await this.bridge.waitForReady();
|
|
1154
1160
|
if (this.mountToken !== r)
|
|
1155
1161
|
return;
|
|
1156
|
-
if (!
|
|
1162
|
+
if (!d)
|
|
1157
1163
|
throw new Error("Editor adapter is not available.");
|
|
1158
1164
|
this.isReady = !0;
|
|
1159
|
-
const
|
|
1160
|
-
this.emitReaderEvent(
|
|
1165
|
+
const l = _(a, i);
|
|
1166
|
+
this.emitReaderEvent(at, l), this.readyCallbacks.forEach((c) => c());
|
|
1161
1167
|
} catch (a) {
|
|
1162
1168
|
if (this.mountToken !== r)
|
|
1163
1169
|
return;
|
|
@@ -1169,15 +1175,15 @@ class lt {
|
|
|
1169
1175
|
const a = r instanceof CustomEvent ? r.detail : null;
|
|
1170
1176
|
!a || a.readerId !== this.readerId || (this.readerState.update(a.statePatch), this.callbacks.emit(a.event, a.payload), this.emitReaderEvent(a.event, a.payload));
|
|
1171
1177
|
};
|
|
1172
|
-
e.addEventListener(
|
|
1178
|
+
e.addEventListener(M, i), this.nativeEventCleanupCallbacks.push(() => {
|
|
1173
1179
|
e.removeEventListener(
|
|
1174
|
-
|
|
1180
|
+
M,
|
|
1175
1181
|
i
|
|
1176
1182
|
);
|
|
1177
|
-
}),
|
|
1183
|
+
}), rt.forEach((r) => {
|
|
1178
1184
|
const a = (s) => {
|
|
1179
1185
|
const o = s instanceof CustomEvent ? s.detail : s;
|
|
1180
|
-
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r, o), r === "documentError" && this.emitReaderEvent(
|
|
1186
|
+
r === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(r, o), r === "documentError" && this.emitReaderEvent(v, o);
|
|
1181
1187
|
};
|
|
1182
1188
|
e.addEventListener(r, a), this.nativeEventCleanupCallbacks.push(() => {
|
|
1183
1189
|
e.removeEventListener(r, a);
|
|
@@ -1190,9 +1196,9 @@ class lt {
|
|
|
1190
1196
|
}, this.emitReaderEvent = (e, i) => {
|
|
1191
1197
|
this.readerEventListener?.(e, i);
|
|
1192
1198
|
}, this.reportReaderError = (e) => {
|
|
1193
|
-
this.isReady = !1, this.debugEnabled && console.error("[RHC Office SDK] Reader mount failed", e), this.emitReaderEvent(
|
|
1199
|
+
this.isReady = !1, this.debugEnabled && console.error("[RHC Office SDK] Reader mount failed", e), this.emitReaderEvent(v, e);
|
|
1194
1200
|
}, this.reportAdapterError = (e) => {
|
|
1195
|
-
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(
|
|
1201
|
+
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(v, e);
|
|
1196
1202
|
}, this.bridge.configureTimeouts({
|
|
1197
1203
|
readyTimeoutMs: n?.readyTimeoutMs,
|
|
1198
1204
|
requestTimeoutMs: n?.requestTimeoutMs
|
|
@@ -1200,19 +1206,48 @@ class lt {
|
|
|
1200
1206
|
}
|
|
1201
1207
|
applyReaderRuntimeConfig(n, e) {
|
|
1202
1208
|
this.restoreReaderRuntimeConfig();
|
|
1203
|
-
const i =
|
|
1209
|
+
const i = L(this.sessionUser, this.sessionUserId), r = {
|
|
1210
|
+
feature: F(e.viewMode),
|
|
1211
|
+
...i ?? {}
|
|
1212
|
+
}, a = dt(e), s = {
|
|
1204
1213
|
hostKind: "server",
|
|
1214
|
+
...a ? { embedOptions: a } : {},
|
|
1205
1215
|
server: {
|
|
1206
1216
|
baseUrl: e.appUrl
|
|
1207
1217
|
},
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1218
|
+
identity: r,
|
|
1219
|
+
...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
|
|
1220
|
+
}, o = n;
|
|
1221
|
+
o[y] = s;
|
|
1222
|
+
const d = globalThis, l = d[S];
|
|
1212
1223
|
this.runtimeRestoreState = {
|
|
1213
|
-
hadPreviousRuntime:
|
|
1214
|
-
...
|
|
1215
|
-
},
|
|
1224
|
+
hadPreviousRuntime: l !== void 0,
|
|
1225
|
+
...l !== void 0 ? { previousRuntime: l } : {}
|
|
1226
|
+
}, d[S] = s;
|
|
1227
|
+
}
|
|
1228
|
+
syncReaderRuntimeConfig() {
|
|
1229
|
+
if (!this.readerElement || !this.normalizedConfiguration)
|
|
1230
|
+
return;
|
|
1231
|
+
const n = this.readerElement, e = n[y];
|
|
1232
|
+
if (!e)
|
|
1233
|
+
return;
|
|
1234
|
+
const i = L(this.sessionUser, this.sessionUserId), r = { ...e.identity ?? {} };
|
|
1235
|
+
delete r.sessionUser, delete r.sessionUserId;
|
|
1236
|
+
const a = {
|
|
1237
|
+
...r,
|
|
1238
|
+
feature: F(this.normalizedConfiguration.viewMode),
|
|
1239
|
+
...i ?? {}
|
|
1240
|
+
}, s = {
|
|
1241
|
+
...e,
|
|
1242
|
+
identity: a,
|
|
1243
|
+
...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
|
|
1244
|
+
};
|
|
1245
|
+
n[y] = s, globalThis[S] = s, this.isReady && this.bridge.request("extension", "updateReaderRuntimeConfig", {
|
|
1246
|
+
identity: a,
|
|
1247
|
+
...this.sessionData !== void 0 ? { sessionData: this.sessionData } : {}
|
|
1248
|
+
}).catch((o) => {
|
|
1249
|
+
this.reportAdapterError(o);
|
|
1250
|
+
});
|
|
1216
1251
|
}
|
|
1217
1252
|
restoreReaderRuntimeConfig() {
|
|
1218
1253
|
if (!this.runtimeRestoreState)
|
|
@@ -1221,33 +1256,33 @@ class lt {
|
|
|
1221
1256
|
this.runtimeRestoreState.hadPreviousRuntime ? n[S] = this.runtimeRestoreState.previousRuntime : Reflect.deleteProperty(n, S), this.runtimeRestoreState = null;
|
|
1222
1257
|
}
|
|
1223
1258
|
}
|
|
1224
|
-
const
|
|
1259
|
+
const kt = (t) => new ht(t);
|
|
1225
1260
|
export {
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1261
|
+
ae as AnnotationToolImpl,
|
|
1262
|
+
oe as CryptoToolImpl,
|
|
1263
|
+
Rt as DIGITAL_SIGN_DEFAULTS,
|
|
1264
|
+
Ie as DigitalSignOptions,
|
|
1265
|
+
ue as DigitalSignToolImpl,
|
|
1266
|
+
ht as DocumentSDK,
|
|
1267
|
+
me as DocumentToolImpl,
|
|
1268
|
+
be as FindToolImpl,
|
|
1269
|
+
we as KVField,
|
|
1270
|
+
fe as NetworkingToolImpl,
|
|
1271
|
+
Te as PageArrangeToolImpl,
|
|
1272
|
+
ve as PageToolImpl,
|
|
1273
|
+
Pe as PdfFormFillerImpl,
|
|
1274
|
+
_e as SecurityToolImpl,
|
|
1275
|
+
Fe as SignServerToolImpl,
|
|
1276
|
+
Ne as SymbologyToolImpl,
|
|
1277
|
+
xe as TemplateSignToolImpl,
|
|
1278
|
+
Ge as UIToolImpl,
|
|
1279
|
+
X as WatermarkDisplay,
|
|
1280
|
+
kt as createNewDocumentSdk,
|
|
1281
|
+
gt as getDigitalSignEnvironment,
|
|
1282
|
+
mt as getDigitalSignEnvironmentSource,
|
|
1283
|
+
pt as initializeDigitalSignEnvironment,
|
|
1284
|
+
St as patchDigitalSignEnvironment,
|
|
1285
|
+
ft as resetDigitalSignEnvironment,
|
|
1286
|
+
bt as setDigitalSignEnvironment
|
|
1252
1287
|
};
|
|
1253
1288
|
//# sourceMappingURL=index.js.map
|