@rhc-office/sdk 6.6.264 → 6.6.268
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/README.md +3 -4
- package/dist/api/callbacks.d.ts +0 -1
- package/dist/api/callbacks.d.ts.map +1 -1
- package/dist/api/crypto-tool.d.ts +12 -1
- package/dist/api/crypto-tool.d.ts.map +1 -1
- package/dist/api/document-sdk.d.ts +0 -6
- package/dist/api/document-sdk.d.ts.map +1 -1
- package/dist/api/sign-tool.d.ts +43 -1
- package/dist/api/sign-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.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +670 -556
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/tools/AnnotationToolImpl.d.ts +47 -0
- package/dist/tools/AnnotationToolImpl.d.ts.map +1 -0
- package/dist/tools/CryptoToolImpl.d.ts +9 -0
- package/dist/tools/CryptoToolImpl.d.ts.map +1 -0
- package/dist/tools/DigitalSignToolImpl.d.ts +27 -0
- package/dist/tools/DigitalSignToolImpl.d.ts.map +1 -0
- package/dist/tools/DocumentToolImpl.d.ts +1 -0
- package/dist/tools/DocumentToolImpl.d.ts.map +1 -1
- package/dist/tools/SignServerToolImpl.d.ts +19 -0
- package/dist/tools/SignServerToolImpl.d.ts.map +1 -0
- package/dist/tools/SymbologyToolImpl.d.ts +8 -0
- package/dist/tools/SymbologyToolImpl.d.ts.map +1 -0
- package/dist/tools/TemplateSignToolImpl.d.ts +13 -0
- package/dist/tools/TemplateSignToolImpl.d.ts.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/viewer/DocumentSDK.d.ts +0 -8
- package/dist/viewer/DocumentSDK.d.ts.map +1 -1
- package/dist/viewer/ReaderStateStore.d.ts +0 -1
- package/dist/viewer/ReaderStateStore.d.ts.map +1 -1
- package/dist/viewer/SdkCallbackRegistry.d.ts +4 -2
- package/dist/viewer/SdkCallbackRegistry.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/callbacks.ts +4 -17
- package/src/api/crypto-tool.ts +13 -1
- package/src/api/document-sdk.ts +0 -9
- package/src/api/sign-tool.ts +62 -1
- package/src/index.ts +1 -3
- package/src/tools/AnnotationToolImpl.ts +263 -0
- package/src/tools/CryptoToolImpl.ts +27 -0
- package/src/tools/DigitalSignToolImpl.ts +155 -0
- package/src/tools/DocumentToolImpl.ts +24 -2
- package/src/tools/SignServerToolImpl.ts +92 -0
- package/src/tools/SymbologyToolImpl.ts +34 -0
- package/src/tools/TemplateSignToolImpl.ts +51 -0
- package/src/tools/index.ts +6 -0
- package/src/viewer/DocumentSDK.ts +13 -157
- package/src/viewer/ReaderBridgeClient.ts +1 -1
- package/src/viewer/ReaderStateStore.ts +0 -2
- package/src/viewer/SdkCallbackRegistry.ts +8 -8
- package/dist/api/ekey-tool.d.ts +0 -8
- package/dist/api/ekey-tool.d.ts.map +0 -1
- package/dist/api/extension-tool.d.ts +0 -5
- package/dist/api/extension-tool.d.ts.map +0 -1
- package/dist/api/review-tool.d.ts +0 -71
- package/dist/api/review-tool.d.ts.map +0 -1
- package/src/api/ekey-tool.ts +0 -11
- package/src/api/extension-tool.ts +0 -5
- package/src/api/review-tool.ts +0 -105
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var K = /* @__PURE__ */ ((
|
|
2
|
-
const w = "RIGHT_CENTER",
|
|
1
|
+
var K = /* @__PURE__ */ ((t) => (t.DEFAULT = "default", t.COMPACT = "compact", t.HIDE = "none", t))(K || {});
|
|
2
|
+
const w = "RIGHT_CENTER", M = "REGULAR_ESM", O = "auto", S = "__RHC_OFFICE_DIGITAL_SIGN_ENVIRONMENT__", A = {
|
|
3
3
|
defaults: {
|
|
4
4
|
bjca: {
|
|
5
5
|
pin: ""
|
|
@@ -17,8 +17,8 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
17
17
|
pin: "",
|
|
18
18
|
usbKeyType: 14
|
|
19
19
|
},
|
|
20
|
-
rsaMode:
|
|
21
|
-
signatureType:
|
|
20
|
+
rsaMode: O,
|
|
21
|
+
signatureType: M
|
|
22
22
|
},
|
|
23
23
|
signServer: {
|
|
24
24
|
authSource: "Password",
|
|
@@ -38,216 +38,343 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
38
38
|
usbKeyType: 14
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
},
|
|
41
|
+
}, _ = (t) => ({
|
|
42
42
|
bjca: {
|
|
43
|
-
pin:
|
|
43
|
+
pin: t.bjca.pin
|
|
44
44
|
},
|
|
45
|
-
deviceType:
|
|
46
|
-
edgePosition:
|
|
45
|
+
deviceType: t.deviceType,
|
|
46
|
+
edgePosition: t.edgePosition,
|
|
47
47
|
kol: {
|
|
48
|
-
appId:
|
|
49
|
-
appName:
|
|
50
|
-
pin:
|
|
51
|
-
serviceUrl:
|
|
52
|
-
token:
|
|
48
|
+
appId: t.kol.appId,
|
|
49
|
+
appName: t.kol.appName,
|
|
50
|
+
pin: t.kol.pin,
|
|
51
|
+
serviceUrl: t.kol.serviceUrl,
|
|
52
|
+
token: t.kol.token
|
|
53
53
|
},
|
|
54
54
|
plugin: {
|
|
55
|
-
pin:
|
|
56
|
-
usbKeyType:
|
|
55
|
+
pin: t.plugin.pin,
|
|
56
|
+
usbKeyType: t.plugin.usbKeyType
|
|
57
57
|
},
|
|
58
|
-
rsaMode:
|
|
59
|
-
signatureType:
|
|
60
|
-
}),
|
|
61
|
-
authSource:
|
|
62
|
-
defaultLogin:
|
|
63
|
-
defaultPassword:
|
|
64
|
-
defaultServer:
|
|
58
|
+
rsaMode: t.rsaMode,
|
|
59
|
+
signatureType: t.signatureType
|
|
60
|
+
}), F = (t) => ({
|
|
61
|
+
authSource: t.authSource,
|
|
62
|
+
defaultLogin: t.defaultLogin,
|
|
63
|
+
defaultPassword: t.defaultPassword,
|
|
64
|
+
defaultServer: t.defaultServer,
|
|
65
65
|
kol: {
|
|
66
|
-
appId:
|
|
67
|
-
appName:
|
|
68
|
-
serviceUrl:
|
|
69
|
-
token:
|
|
66
|
+
appId: t.kol.appId,
|
|
67
|
+
appName: t.kol.appName,
|
|
68
|
+
serviceUrl: t.kol.serviceUrl,
|
|
69
|
+
token: t.kol.token
|
|
70
70
|
},
|
|
71
|
-
macAddress:
|
|
72
|
-
token:
|
|
71
|
+
macAddress: t.macAddress,
|
|
72
|
+
token: t.token,
|
|
73
73
|
usbKey: {
|
|
74
|
-
checkCertificateBinding:
|
|
75
|
-
usbKeyType:
|
|
74
|
+
checkCertificateBinding: t.usbKey.checkCertificateBinding,
|
|
75
|
+
usbKeyType: t.usbKey.usbKeyType
|
|
76
76
|
}
|
|
77
|
-
}),
|
|
78
|
-
defaults:
|
|
79
|
-
signServer:
|
|
80
|
-
}),
|
|
81
|
-
defaults:
|
|
82
|
-
...
|
|
83
|
-
bjca:
|
|
84
|
-
kol:
|
|
85
|
-
plugin:
|
|
77
|
+
}), h = (t) => ({
|
|
78
|
+
defaults: _(t.defaults),
|
|
79
|
+
signServer: F(t.signServer)
|
|
80
|
+
}), L = (t) => ({
|
|
81
|
+
defaults: t.defaults ? {
|
|
82
|
+
...t.defaults,
|
|
83
|
+
bjca: t.defaults.bjca ? { ...t.defaults.bjca } : void 0,
|
|
84
|
+
kol: t.defaults.kol ? { ...t.defaults.kol } : void 0,
|
|
85
|
+
plugin: t.defaults.plugin ? { ...t.defaults.plugin } : void 0
|
|
86
86
|
} : void 0,
|
|
87
|
-
signServer:
|
|
88
|
-
...
|
|
89
|
-
kol:
|
|
90
|
-
usbKey:
|
|
87
|
+
signServer: t.signServer ? {
|
|
88
|
+
...t.signServer,
|
|
89
|
+
kol: t.signServer.kol ? { ...t.signServer.kol } : void 0,
|
|
90
|
+
usbKey: t.signServer.usbKey ? { ...t.signServer.usbKey } : void 0
|
|
91
91
|
} : void 0
|
|
92
|
-
}), G = (
|
|
92
|
+
}), G = (t, n) => n ? {
|
|
93
93
|
bjca: {
|
|
94
|
-
pin:
|
|
94
|
+
pin: n.bjca?.pin ?? t.bjca.pin
|
|
95
95
|
},
|
|
96
|
-
deviceType:
|
|
97
|
-
edgePosition:
|
|
96
|
+
deviceType: n.deviceType ?? t.deviceType,
|
|
97
|
+
edgePosition: n.edgePosition ?? t.edgePosition,
|
|
98
98
|
kol: {
|
|
99
|
-
appId:
|
|
100
|
-
appName:
|
|
101
|
-
pin:
|
|
102
|
-
serviceUrl:
|
|
103
|
-
token:
|
|
99
|
+
appId: n.kol?.appId ?? t.kol.appId,
|
|
100
|
+
appName: n.kol?.appName ?? t.kol.appName,
|
|
101
|
+
pin: n.kol?.pin ?? t.kol.pin,
|
|
102
|
+
serviceUrl: n.kol?.serviceUrl ?? t.kol.serviceUrl,
|
|
103
|
+
token: n.kol?.token ?? t.kol.token
|
|
104
104
|
},
|
|
105
105
|
plugin: {
|
|
106
|
-
pin:
|
|
107
|
-
usbKeyType:
|
|
106
|
+
pin: n.plugin?.pin ?? t.plugin.pin,
|
|
107
|
+
usbKeyType: n.plugin?.usbKeyType ?? t.plugin.usbKeyType
|
|
108
108
|
},
|
|
109
|
-
rsaMode:
|
|
110
|
-
signatureType:
|
|
111
|
-
} :
|
|
112
|
-
authSource:
|
|
113
|
-
defaultLogin:
|
|
114
|
-
defaultPassword:
|
|
115
|
-
defaultServer:
|
|
109
|
+
rsaMode: n.rsaMode ?? t.rsaMode,
|
|
110
|
+
signatureType: n.signatureType ?? t.signatureType
|
|
111
|
+
} : _(t), H = (t, n) => n ? {
|
|
112
|
+
authSource: n.authSource ?? t.authSource,
|
|
113
|
+
defaultLogin: n.defaultLogin ?? t.defaultLogin,
|
|
114
|
+
defaultPassword: n.defaultPassword ?? t.defaultPassword,
|
|
115
|
+
defaultServer: n.defaultServer ?? t.defaultServer,
|
|
116
116
|
kol: {
|
|
117
|
-
appId:
|
|
118
|
-
appName:
|
|
119
|
-
serviceUrl:
|
|
120
|
-
token:
|
|
117
|
+
appId: n.kol?.appId ?? t.kol.appId,
|
|
118
|
+
appName: n.kol?.appName ?? t.kol.appName,
|
|
119
|
+
serviceUrl: n.kol?.serviceUrl ?? t.kol.serviceUrl,
|
|
120
|
+
token: n.kol?.token ?? t.kol.token
|
|
121
121
|
},
|
|
122
|
-
macAddress:
|
|
123
|
-
token:
|
|
122
|
+
macAddress: n.macAddress ?? t.macAddress,
|
|
123
|
+
token: n.token ?? t.token,
|
|
124
124
|
usbKey: {
|
|
125
|
-
checkCertificateBinding:
|
|
126
|
-
usbKeyType:
|
|
125
|
+
checkCertificateBinding: n.usbKey?.checkCertificateBinding ?? t.usbKey.checkCertificateBinding,
|
|
126
|
+
usbKeyType: n.usbKey?.usbKeyType ?? t.usbKey.usbKeyType
|
|
127
127
|
}
|
|
128
|
-
} :
|
|
129
|
-
defaults: G(
|
|
130
|
-
signServer: H(
|
|
131
|
-
}), q = (
|
|
132
|
-
defaults:
|
|
133
|
-
...n.defaults,
|
|
128
|
+
} : F(t), U = (t, n) => ({
|
|
129
|
+
defaults: G(t.defaults, n.defaults),
|
|
130
|
+
signServer: H(t.signServer, n.signServer)
|
|
131
|
+
}), q = (t, n) => ({
|
|
132
|
+
defaults: t.defaults || n.defaults ? {
|
|
134
133
|
...t.defaults,
|
|
134
|
+
...n.defaults,
|
|
135
135
|
bjca: {
|
|
136
|
-
...
|
|
137
|
-
...
|
|
136
|
+
...t.defaults?.bjca ?? {},
|
|
137
|
+
...n.defaults?.bjca ?? {}
|
|
138
138
|
},
|
|
139
139
|
kol: {
|
|
140
|
-
...
|
|
141
|
-
...
|
|
140
|
+
...t.defaults?.kol ?? {},
|
|
141
|
+
...n.defaults?.kol ?? {}
|
|
142
142
|
},
|
|
143
143
|
plugin: {
|
|
144
|
-
...
|
|
145
|
-
...
|
|
144
|
+
...t.defaults?.plugin ?? {},
|
|
145
|
+
...n.defaults?.plugin ?? {}
|
|
146
146
|
}
|
|
147
147
|
} : void 0,
|
|
148
|
-
signServer:
|
|
149
|
-
...n.signServer,
|
|
148
|
+
signServer: t.signServer || n.signServer ? {
|
|
150
149
|
...t.signServer,
|
|
150
|
+
...n.signServer,
|
|
151
151
|
kol: {
|
|
152
|
-
...
|
|
153
|
-
...
|
|
152
|
+
...t.signServer?.kol ?? {},
|
|
153
|
+
...n.signServer?.kol ?? {}
|
|
154
154
|
},
|
|
155
155
|
usbKey: {
|
|
156
|
-
...
|
|
157
|
-
...
|
|
156
|
+
...t.signServer?.usbKey ?? {},
|
|
157
|
+
...n.signServer?.usbKey ?? {}
|
|
158
158
|
}
|
|
159
159
|
} : void 0
|
|
160
|
-
}), Q = () => globalThis,
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
current:
|
|
164
|
-
defaults:
|
|
160
|
+
}), Q = () => globalThis, p = () => {
|
|
161
|
+
const t = Q();
|
|
162
|
+
return t[S] || (t[S] = {
|
|
163
|
+
current: h(A),
|
|
164
|
+
defaults: h(A),
|
|
165
165
|
overrides: {}
|
|
166
|
-
}),
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
return
|
|
170
|
-
},
|
|
171
|
-
const
|
|
172
|
-
return
|
|
173
|
-
},
|
|
174
|
-
const
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
},
|
|
166
|
+
}), t[S];
|
|
167
|
+
}, je = () => p().current, Xe = (t) => {
|
|
168
|
+
const n = p();
|
|
169
|
+
return n.defaults = h(t), n.current = U(n.defaults, n.overrides), n.current;
|
|
170
|
+
}, Je = (t) => {
|
|
171
|
+
const n = p();
|
|
172
|
+
return n.current = h(t), n.overrides = L(t), n.current;
|
|
173
|
+
}, Ze = (t) => {
|
|
174
|
+
const n = p();
|
|
175
|
+
return n.overrides = q(n.overrides, L(t)), n.current = U(n.current, t), n.current;
|
|
176
|
+
}, et = (t) => {
|
|
177
|
+
const n = p();
|
|
178
|
+
return t && (n.defaults = h(t)), n.overrides = {}, n.current = h(n.defaults), n.current;
|
|
179
|
+
}, tt = {
|
|
180
180
|
EDGE_POSITION: w,
|
|
181
|
-
RSA_MODE:
|
|
182
|
-
SIGNATURE_TYPE:
|
|
183
|
-
},
|
|
184
|
-
if (
|
|
185
|
-
return
|
|
186
|
-
}, c = (
|
|
181
|
+
RSA_MODE: O,
|
|
182
|
+
SIGNATURE_TYPE: M
|
|
183
|
+
}, f = (t) => {
|
|
184
|
+
if (t.length !== 0)
|
|
185
|
+
return t.length === 1 ? t[0] : t;
|
|
186
|
+
}, c = (t, n, e) => new Proxy(
|
|
187
187
|
{},
|
|
188
188
|
{
|
|
189
|
-
get: (i,
|
|
190
|
-
if (
|
|
189
|
+
get: (i, a) => {
|
|
190
|
+
if (a === "then")
|
|
191
191
|
return;
|
|
192
|
-
if (typeof
|
|
193
|
-
return
|
|
194
|
-
const
|
|
195
|
-
return
|
|
196
|
-
if (
|
|
197
|
-
|
|
192
|
+
if (typeof a == "symbol")
|
|
193
|
+
return a === Symbol.toStringTag ? t : void 0;
|
|
194
|
+
const r = n[a];
|
|
195
|
+
return r ? (...s) => {
|
|
196
|
+
if (r.kind === "callbackRegister") {
|
|
197
|
+
r.callback?.(e.callbacks, s);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
201
|
-
return
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
204
|
-
return e.bridge.request(
|
|
205
|
-
if (
|
|
206
|
-
const l =
|
|
207
|
-
e.bridge.request(
|
|
208
|
-
const
|
|
209
|
-
l?.(...
|
|
200
|
+
if (r.kind === "stateGetter")
|
|
201
|
+
return r.state?.(e.state.snapshot(), s);
|
|
202
|
+
const o = r.adapterMethod ?? a;
|
|
203
|
+
if (r.kind === "query")
|
|
204
|
+
return e.bridge.request(t, o, f(s));
|
|
205
|
+
if (r.kind === "callbackQuery") {
|
|
206
|
+
const l = s.find((d) => typeof d == "function"), m = s.filter((d) => typeof d != "function");
|
|
207
|
+
e.bridge.request(t, o, f(m)).then((d) => {
|
|
208
|
+
const k = r.mapCallbackResult?.(d) ?? [d];
|
|
209
|
+
l?.(...k);
|
|
210
210
|
}).catch(e.onAsyncError);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
e.bridge.request(
|
|
214
|
-
} : (...
|
|
215
|
-
const
|
|
216
|
-
e.onAsyncError(
|
|
213
|
+
e.bridge.request(t, o, f(s)).catch(e.onAsyncError);
|
|
214
|
+
} : (...s) => {
|
|
215
|
+
const o = new Error(`${t}.${a} is not implemented by the SDK adapter.`);
|
|
216
|
+
e.onAsyncError(o);
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
),
|
|
221
|
-
{
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
220
|
+
), z = {
|
|
221
|
+
addAnnotationEventCallback: {
|
|
222
|
+
kind: "callbackRegister",
|
|
223
|
+
callback: (t, n) => {
|
|
224
|
+
const e = n[0];
|
|
225
|
+
typeof e == "function" && t.annotationEvents.push(e);
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
addAnnotationPersistCallback: {
|
|
229
|
+
kind: "callbackRegister",
|
|
230
|
+
callback: (t, n) => {
|
|
231
|
+
const e = n[0];
|
|
232
|
+
typeof e == "function" && t.annotationPersist.push(e);
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
addAnnotationRetrieveCallback: {
|
|
236
|
+
kind: "callbackRegister",
|
|
237
|
+
callback: (t, n) => {
|
|
238
|
+
const e = n[0];
|
|
239
|
+
typeof e == "function" && t.annotationRetrieve.push(e);
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
addDigitalAnnotationRetrieveCallback: {
|
|
243
|
+
kind: "callbackRegister",
|
|
244
|
+
callback: (t, n) => {
|
|
245
|
+
const e = n[0];
|
|
246
|
+
typeof e == "function" && t.digitalAnnotationRetrieve.push(
|
|
247
|
+
e
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
isInAnnotationMode: {
|
|
252
|
+
kind: "stateGetter",
|
|
253
|
+
state: (t) => t.annotationEnabled
|
|
254
|
+
},
|
|
255
|
+
getAnnotations: { kind: "stateGetter", state: () => [] },
|
|
256
|
+
getAnnotationsCount: { kind: "stateGetter", state: () => 0 },
|
|
257
|
+
queryAnnotationsBy: { kind: "stateGetter", state: () => [] },
|
|
258
|
+
setToolSource: { kind: "command" },
|
|
259
|
+
openAnnotationView: { kind: "command" },
|
|
260
|
+
closeAnnotationView: { kind: "command" },
|
|
261
|
+
openTextAnnotationView: { kind: "command" },
|
|
262
|
+
setTextAnnotationFontColor: { kind: "command" },
|
|
263
|
+
setTextAnnotationFontSize: { kind: "command" },
|
|
264
|
+
closeTextAnnotationView: { kind: "command" },
|
|
265
|
+
createTextAnnotation: { kind: "command" },
|
|
266
|
+
setPersistToDocument: { kind: "command" },
|
|
267
|
+
saveAnnotations: { kind: "callbackQuery" },
|
|
268
|
+
saveTextAnnotations: { kind: "command" },
|
|
269
|
+
clearAnnotations: { kind: "command" },
|
|
270
|
+
clearTextAnnotations: { kind: "command" },
|
|
271
|
+
undoAnnotation: { kind: "command" },
|
|
272
|
+
redoAnnotation: { kind: "command" },
|
|
273
|
+
selectAnnotationTool: { kind: "command" },
|
|
274
|
+
showAnnotationColorPicker: { kind: "command" },
|
|
275
|
+
setAnnotationPenType: { kind: "command" },
|
|
276
|
+
appendAnnotations: { kind: "callbackQuery" },
|
|
277
|
+
batchAppendAnnotations: { kind: "callbackQuery" },
|
|
278
|
+
setAnnotationPenColor: { kind: "command" },
|
|
279
|
+
setAnnotationPenWidth: { kind: "command" },
|
|
280
|
+
setAnnotationPenThickness: { kind: "command" },
|
|
281
|
+
enableAnnotationsInfoView: { kind: "command" },
|
|
282
|
+
enableAnnotationsDeletion: { kind: "command" },
|
|
283
|
+
enableAnnotationsDeletionOnlyByAuthor: { kind: "command" },
|
|
284
|
+
listDigitalStamps: { kind: "command" },
|
|
285
|
+
listAnnotations: { kind: "command" },
|
|
286
|
+
deleteAnnotationsBy: { kind: "command" },
|
|
287
|
+
deleteAnnotationsById: { kind: "command" },
|
|
288
|
+
addDigitalAnnotation: { kind: "command" },
|
|
289
|
+
addInkAnnotationCallback: { kind: "callbackRegister" }
|
|
290
|
+
};
|
|
291
|
+
class W {
|
|
292
|
+
constructor(n) {
|
|
293
|
+
this.setToolSource = (e) => this.adapter.setToolSource(e), this.openAnnotationView = (e) => this.adapter.openAnnotationView(e), this.closeAnnotationView = (e) => this.adapter.closeAnnotationView(e), this.openTextAnnotationView = () => this.adapter.openTextAnnotationView(), this.setTextAnnotationFontColor = (e) => this.adapter.setTextAnnotationFontColor(e), this.setTextAnnotationFontSize = (e) => this.adapter.setTextAnnotationFontSize(e), this.closeTextAnnotationView = (e) => this.adapter.closeTextAnnotationView(e), this.createTextAnnotation = (e) => this.adapter.createTextAnnotation(e), this.setPersistToDocument = (e) => this.adapter.setPersistToDocument(e), this.saveAnnotations = (e) => this.adapter.saveAnnotations(e), this.saveTextAnnotations = () => this.adapter.saveTextAnnotations(), this.clearAnnotations = () => this.adapter.clearAnnotations(), this.clearTextAnnotations = () => this.adapter.clearTextAnnotations(), this.undoAnnotation = () => this.adapter.undoAnnotation(), this.redoAnnotation = () => this.adapter.redoAnnotation(), this.selectAnnotationTool = (e) => this.adapter.selectAnnotationTool(e), this.showAnnotationColorPicker = () => this.adapter.showAnnotationColorPicker(), this.setAnnotationPenType = (e) => this.adapter.setAnnotationPenType(e), this.appendAnnotations = (e, i) => this.adapter.appendAnnotations(e, i), this.batchAppendAnnotations = (e, i) => this.adapter.batchAppendAnnotations(e, i), this.setAnnotationPenColor = (e) => this.adapter.setAnnotationPenColor(e), this.setAnnotationPenWidth = (e) => this.adapter.setAnnotationPenWidth(e), this.setAnnotationPenThickness = (e) => this.adapter.setAnnotationPenThickness(e), this.enableAnnotationsInfoView = (e) => this.adapter.enableAnnotationsInfoView(e), this.enableAnnotationsDeletion = (e) => this.adapter.enableAnnotationsDeletion(e), this.enableAnnotationsDeletionOnlyByAuthor = (e) => this.adapter.enableAnnotationsDeletionOnlyByAuthor(e), this.listDigitalStamps = () => this.adapter.listDigitalStamps(), this.isInAnnotationMode = () => this.adapter.isInAnnotationMode(), this.listAnnotations = (e) => this.adapter.listAnnotations(e), this.getAnnotations = () => this.adapter.getAnnotations(), this.getAnnotationsCount = () => this.adapter.getAnnotationsCount(), this.queryAnnotationsBy = (e) => this.adapter.queryAnnotationsBy(e), this.deleteAnnotationsBy = (e, i) => this.adapter.deleteAnnotationsBy(e, i), this.deleteAnnotationsById = (e, i) => this.adapter.deleteAnnotationsById(e, i), this.addDigitalAnnotation = (e) => this.adapter.addDigitalAnnotation(e), this.addInkAnnotationCallback = (e) => this.adapter.addInkAnnotationCallback(e), this.addAnnotationEventCallback = (e) => this.adapter.addAnnotationEventCallback(e), this.addAnnotationPersistCallback = (e) => this.adapter.addAnnotationPersistCallback(e), this.addAnnotationRetrieveCallback = (e) => this.adapter.addAnnotationRetrieveCallback(e), this.addDigitalAnnotationRetrieveCallback = (e) => this.adapter.addDigitalAnnotationRetrieveCallback(e), this.adapter = c(
|
|
294
|
+
"annotation",
|
|
295
|
+
z,
|
|
296
|
+
n
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const $ = {
|
|
301
|
+
configSecurityProvider: { kind: "command" },
|
|
302
|
+
getSecurityProviders: { kind: "query" }
|
|
303
|
+
};
|
|
304
|
+
class Y {
|
|
305
|
+
constructor(n) {
|
|
306
|
+
this.configSecurityProvider = (e) => this.adapter.configSecurityProvider(e), this.getSecurityProviders = () => this.adapter.getSecurityProviders(), this.adapter = c("crypto", $, n);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
const j = {
|
|
310
|
+
addDigitalSignatureRetrieveCallback: {
|
|
311
|
+
kind: "callbackRegister",
|
|
312
|
+
callback: (t, n) => {
|
|
313
|
+
const e = n[0];
|
|
314
|
+
typeof e == "function" && t.digitalSignatureRetrieve.push(e);
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
addDigitalSignatureParseCallback: {
|
|
318
|
+
kind: "callbackRegister",
|
|
319
|
+
callback: (t, n) => {
|
|
320
|
+
const e = n[0];
|
|
321
|
+
typeof e == "function" && t.digitalSignatureParse.push(e);
|
|
229
322
|
}
|
|
323
|
+
},
|
|
324
|
+
addDigitalSignCallback: {
|
|
325
|
+
kind: "callbackRegister",
|
|
326
|
+
callback: (t, n) => {
|
|
327
|
+
const e = n[0];
|
|
328
|
+
typeof e == "function" && t.digitalSign.push(e);
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
setCryptoProvider: { kind: "command" },
|
|
332
|
+
setSealSource: { kind: "command" },
|
|
333
|
+
setDefaultStampPassword: { kind: "command" },
|
|
334
|
+
setDefaultSealPassword: { kind: "command" },
|
|
335
|
+
setDefaultKeystorePassword: { kind: "command" },
|
|
336
|
+
setDefaultUSBKeyPassword: { kind: "command" },
|
|
337
|
+
setupExternalSealServer: { kind: "command" },
|
|
338
|
+
setDigitalSignOptions: { kind: "command" },
|
|
339
|
+
setExternalDigitalSignOptions: { kind: "command" },
|
|
340
|
+
setPDFDigitalSignCaptionOptions: { kind: "command" },
|
|
341
|
+
addDigitalSignature: { kind: "callbackQuery" },
|
|
342
|
+
addDigitalSignatureBySelectedSearchHighlight: { kind: "command" },
|
|
343
|
+
listDigitalSignatures: { kind: "callbackQuery" },
|
|
344
|
+
getDigitalSignatures: { kind: "stateGetter", state: () => [] },
|
|
345
|
+
getDigitalSignaturesCount: { kind: "stateGetter", state: () => 0 },
|
|
346
|
+
enableDigitalSignatureInfoView: { kind: "command" },
|
|
347
|
+
enableDigitalSignatureRevocation: { kind: "command" }
|
|
348
|
+
};
|
|
349
|
+
class X {
|
|
350
|
+
constructor(n) {
|
|
351
|
+
this.addDigitalSignatureRetrieveCallback = (e) => this.adapter.addDigitalSignatureRetrieveCallback(e), this.addDigitalSignatureParseCallback = (e) => this.adapter.addDigitalSignatureParseCallback(e), this.setCryptoProvider = (e, i, a) => this.adapter.setCryptoProvider(e, i, a), 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 = c(
|
|
352
|
+
"digitalSign",
|
|
353
|
+
j,
|
|
354
|
+
n
|
|
355
|
+
);
|
|
230
356
|
}
|
|
231
|
-
|
|
357
|
+
}
|
|
358
|
+
const J = "rhc-office.editor-adapter", Z = 1, ee = "__RHC_OFFICE_EDITOR_ADAPTER__", R = "rhcOfficeAdapterReady", E = "rhcOfficeAdapterEvent", N = "data-rhc-office-reader-id", te = {
|
|
232
359
|
addDocumentOpenedCallback: {
|
|
233
360
|
kind: "callbackRegister",
|
|
234
|
-
callback: (
|
|
235
|
-
const e =
|
|
236
|
-
typeof e == "function" &&
|
|
361
|
+
callback: (t, n) => {
|
|
362
|
+
const e = n[0];
|
|
363
|
+
typeof e == "function" && t.documentOpened.push(e);
|
|
237
364
|
}
|
|
238
365
|
},
|
|
239
366
|
addDocumentSavedCallback: {
|
|
240
367
|
kind: "callbackRegister",
|
|
241
|
-
callback: (
|
|
242
|
-
const e =
|
|
243
|
-
typeof e == "function" &&
|
|
368
|
+
callback: (t, n) => {
|
|
369
|
+
const e = n[0];
|
|
370
|
+
typeof e == "function" && t.documentSaved.push(e);
|
|
244
371
|
}
|
|
245
372
|
},
|
|
246
373
|
addDocumentClosedCallback: {
|
|
247
374
|
kind: "callbackRegister",
|
|
248
|
-
callback: (
|
|
249
|
-
const e =
|
|
250
|
-
typeof e == "function" &&
|
|
375
|
+
callback: (t, n) => {
|
|
376
|
+
const e = n[0];
|
|
377
|
+
typeof e == "function" && t.documentClosed.push(e);
|
|
251
378
|
}
|
|
252
379
|
},
|
|
253
380
|
openPDFDocument: { kind: "callbackQuery", adapterMethod: "open" },
|
|
@@ -263,83 +390,96 @@ const w = "RIGHT_CENTER", _ = "REGULAR_ESM", F = "auto", f = "__RHC_OFFICE_DIGIT
|
|
|
263
390
|
saveAs: { kind: "query" },
|
|
264
391
|
getDocumentContent: {
|
|
265
392
|
kind: "callbackQuery",
|
|
266
|
-
mapCallbackResult: (
|
|
267
|
-
const
|
|
268
|
-
return [
|
|
393
|
+
mapCallbackResult: (t) => {
|
|
394
|
+
const n = t;
|
|
395
|
+
return [n?.fileCacheId, n?.fileBuffer];
|
|
269
396
|
}
|
|
270
397
|
},
|
|
271
398
|
closeDocument: { kind: "callbackQuery" },
|
|
272
399
|
isDocumentOpened: {
|
|
273
400
|
kind: "stateGetter",
|
|
274
|
-
state: (
|
|
401
|
+
state: (t) => t.documentOpened
|
|
275
402
|
},
|
|
276
403
|
isDocumentModified: {
|
|
277
404
|
kind: "stateGetter",
|
|
278
|
-
state: (
|
|
405
|
+
state: (t) => t.documentModified
|
|
279
406
|
},
|
|
280
407
|
print: { kind: "command" },
|
|
281
408
|
createPreview: { kind: "command" }
|
|
282
409
|
};
|
|
283
|
-
class
|
|
284
|
-
constructor(
|
|
285
|
-
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) => this.adapter.setUploadUrl(e), this.save = (e, i,
|
|
410
|
+
class ne {
|
|
411
|
+
constructor(n) {
|
|
412
|
+
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) => this.adapter.setUploadUrl(e), this.save = (e, i, a) => this.adapter.save(e, i, a), this.saveAs = (e) => {
|
|
413
|
+
const i = this.context.bridge.getReaderId();
|
|
414
|
+
if (!i)
|
|
415
|
+
return Promise.resolve({
|
|
416
|
+
success: !1,
|
|
417
|
+
action: "save-as",
|
|
418
|
+
filename: e?.filename,
|
|
419
|
+
error: "Reader is not mounted or does not expose saveAs."
|
|
420
|
+
});
|
|
421
|
+
const a = document.querySelector(
|
|
422
|
+
`[${N}="${i}"]`
|
|
423
|
+
);
|
|
424
|
+
return typeof a?.saveAs == "function" ? a.saveAs(e) : this.adapter.saveAs(e);
|
|
425
|
+
}, this.getDocumentContent = (e) => this.adapter.getDocumentContent(e), this.closeDocument = (e, i, a) => this.adapter.closeDocument(e, i, a), 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 = c(
|
|
286
426
|
"document",
|
|
287
|
-
|
|
288
|
-
|
|
427
|
+
te,
|
|
428
|
+
n
|
|
289
429
|
);
|
|
290
430
|
}
|
|
291
431
|
}
|
|
292
|
-
const
|
|
432
|
+
const ie = {
|
|
293
433
|
clearFind: { kind: "command" },
|
|
294
434
|
findNext: { kind: "command" },
|
|
295
435
|
findPrevious: { kind: "command" }
|
|
296
436
|
};
|
|
297
|
-
class
|
|
298
|
-
constructor(
|
|
299
|
-
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter = c("find",
|
|
437
|
+
class ae {
|
|
438
|
+
constructor(n) {
|
|
439
|
+
this.clearFind = () => this.adapter.clearFind(), this.findNext = (e) => this.adapter.findNext(e), this.findPrevious = (e) => this.adapter.findPrevious(e), this.adapter = c("find", ie, n);
|
|
300
440
|
}
|
|
301
441
|
}
|
|
302
|
-
const
|
|
442
|
+
const re = {
|
|
303
443
|
configFileUpload: { kind: "command" },
|
|
304
444
|
setHttpHeaders: { kind: "command" },
|
|
305
445
|
setHttpFormFields: { kind: "command" }
|
|
306
446
|
};
|
|
307
|
-
class
|
|
308
|
-
constructor(
|
|
447
|
+
class se {
|
|
448
|
+
constructor(n) {
|
|
309
449
|
this.configFileUpload = (e) => this.adapter.configFileUpload(e), this.setHttpHeaders = (e) => this.adapter.setHttpHeaders(e), this.setHttpFormFields = (e) => this.adapter.setHttpFormFields(e), this.adapter = c(
|
|
310
450
|
"networking",
|
|
311
|
-
|
|
312
|
-
|
|
451
|
+
re,
|
|
452
|
+
n
|
|
313
453
|
);
|
|
314
454
|
}
|
|
315
455
|
}
|
|
316
|
-
const
|
|
456
|
+
const oe = (t) => ({
|
|
317
457
|
addPageChangeCallback: {
|
|
318
458
|
kind: "callbackRegister",
|
|
319
|
-
callback: (
|
|
459
|
+
callback: (n, e) => {
|
|
320
460
|
const i = e[0];
|
|
321
|
-
typeof i == "function" &&
|
|
461
|
+
typeof i == "function" && n.pageChange.push(i);
|
|
322
462
|
}
|
|
323
463
|
},
|
|
324
464
|
addPageModeChangeCallback: {
|
|
325
465
|
kind: "callbackRegister",
|
|
326
|
-
callback: (
|
|
466
|
+
callback: (n, e) => {
|
|
327
467
|
const i = e[0];
|
|
328
|
-
typeof i == "function" &&
|
|
468
|
+
typeof i == "function" && n.pageModeChange.push(i);
|
|
329
469
|
}
|
|
330
470
|
},
|
|
331
471
|
getPageCount: {
|
|
332
472
|
kind: "callbackRegister",
|
|
333
|
-
callback: (
|
|
473
|
+
callback: (n, e) => {
|
|
334
474
|
const i = e[0];
|
|
335
|
-
typeof i == "function" && i(
|
|
475
|
+
typeof i == "function" && i(t.state.snapshot().pageCount);
|
|
336
476
|
}
|
|
337
477
|
},
|
|
338
478
|
getPageIndex: {
|
|
339
479
|
kind: "callbackRegister",
|
|
340
|
-
callback: (
|
|
480
|
+
callback: (n, e) => {
|
|
341
481
|
const i = e[0];
|
|
342
|
-
typeof i == "function" && i(
|
|
482
|
+
typeof i == "function" && i(t.state.snapshot().pageIndex);
|
|
343
483
|
}
|
|
344
484
|
},
|
|
345
485
|
setSinglePageViewMode: { kind: "command" },
|
|
@@ -363,16 +503,16 @@ const J = (n) => ({
|
|
|
363
503
|
gotoPreviousPage: { kind: "command" },
|
|
364
504
|
rotatePage: { kind: "command" }
|
|
365
505
|
});
|
|
366
|
-
class
|
|
367
|
-
constructor(
|
|
368
|
-
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,
|
|
506
|
+
class de {
|
|
507
|
+
constructor(n) {
|
|
508
|
+
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, a, r) => this.adapter.setPageBlendColor(e, i, a, r), this.gotoPage = (e, i, a) => this.adapter.gotoPage(e, i, a), this.gotoNextPage = () => this.adapter.gotoNextPage(), this.gotoPreviousPage = () => this.adapter.gotoPreviousPage(), this.rotatePage = (e) => this.adapter.rotatePage(e), this.adapter = c(
|
|
369
509
|
"page",
|
|
370
|
-
|
|
371
|
-
|
|
510
|
+
oe(n),
|
|
511
|
+
n
|
|
372
512
|
);
|
|
373
513
|
}
|
|
374
514
|
}
|
|
375
|
-
const
|
|
515
|
+
const le = {
|
|
376
516
|
open: { kind: "command" },
|
|
377
517
|
setFormFieldValue: { kind: "command" },
|
|
378
518
|
setFormFieldReadonly: { kind: "command" },
|
|
@@ -386,65 +526,138 @@ const ee = {
|
|
|
386
526
|
},
|
|
387
527
|
toKeyValue: {
|
|
388
528
|
kind: "callbackQuery",
|
|
389
|
-
mapCallbackResult: (
|
|
529
|
+
mapCallbackResult: (t) => [Array.isArray(t) ? t : []]
|
|
390
530
|
}
|
|
391
531
|
};
|
|
392
|
-
class
|
|
393
|
-
constructor(
|
|
532
|
+
class ce {
|
|
533
|
+
constructor(n) {
|
|
394
534
|
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 = c(
|
|
395
535
|
"pdfFormFiller",
|
|
396
|
-
|
|
397
|
-
|
|
536
|
+
le,
|
|
537
|
+
n
|
|
398
538
|
);
|
|
399
539
|
}
|
|
400
540
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}, re = (n) => {
|
|
405
|
-
const t = n.split(ie);
|
|
406
|
-
if (t.length === 1) {
|
|
407
|
-
const r = E(t[0] ?? "");
|
|
408
|
-
return r ? [r] : [];
|
|
541
|
+
class ue extends Error {
|
|
542
|
+
constructor(n, e) {
|
|
543
|
+
super(`[Phase 1] ${n}.${e} is not implemented yet.`), this.name = "SDKPhase1NotImplementedError";
|
|
409
544
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
|
|
545
|
+
}
|
|
546
|
+
const he = (t, n) => () => {
|
|
547
|
+
throw new ue(t, n);
|
|
548
|
+
}, nt = (t) => new Proxy(
|
|
549
|
+
{},
|
|
550
|
+
{
|
|
551
|
+
get: (n, e) => {
|
|
552
|
+
if (e !== "then")
|
|
553
|
+
return typeof e == "symbol" ? e === Symbol.toStringTag ? t : void 0 : he(t, e);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
), me = /\s*,\s*/, ge = /\s*-\s*/, b = (t) => {
|
|
557
|
+
const n = Number.parseInt(t.trim(), 10);
|
|
558
|
+
return !Number.isFinite(n) || n <= 0 ? null : n;
|
|
559
|
+
}, pe = (t) => {
|
|
560
|
+
const n = t.split(ge);
|
|
561
|
+
if (n.length === 1) {
|
|
562
|
+
const a = b(n[0] ?? "");
|
|
563
|
+
return a ? [a] : [];
|
|
564
|
+
}
|
|
565
|
+
const e = b(n[0] ?? ""), i = b(n[1] ?? "");
|
|
566
|
+
return !e || !i || i < e ? [] : Array.from({ length: i - e + 1 }, (a, r) => e + r);
|
|
567
|
+
}, ke = (t) => t ? t.split(me).flatMap((e) => pe(e)).filter((e, i, a) => a.indexOf(e) === i) : [];
|
|
568
|
+
class Se {
|
|
569
|
+
constructor(n, e, i) {
|
|
570
|
+
this.setFieldName = (a) => {
|
|
571
|
+
this.key = a;
|
|
572
|
+
}, this.setFieldValue = (a) => {
|
|
573
|
+
this.value = a;
|
|
574
|
+
}, this.setDescription = (a) => {
|
|
575
|
+
this.description = a;
|
|
576
|
+
}, this.key = n, this.value = e, this.description = i;
|
|
422
577
|
}
|
|
423
578
|
}
|
|
424
|
-
class
|
|
579
|
+
class fe {
|
|
425
580
|
constructor() {
|
|
426
|
-
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 = (
|
|
427
|
-
this.signType =
|
|
428
|
-
}, this.isCrossPageSideSign = () => this.signType === 2 || this.signType === 3, this.getSealPosition = () => this.sealPosition, this.setSignOnPageSides = (
|
|
429
|
-
|
|
430
|
-
}, this.setSignPositionOnPageSides = (
|
|
431
|
-
this.sealPosition =
|
|
432
|
-
}, this.setPageRange = (
|
|
433
|
-
this.pageRange =
|
|
434
|
-
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () =>
|
|
435
|
-
this.signUserData =
|
|
436
|
-
}, this.setPrintMargin = (
|
|
437
|
-
this.printMargin =
|
|
438
|
-
}, this.getPrintMargin = () => this.printMargin ?? 0, this.setSignReason = (
|
|
439
|
-
this.signReason =
|
|
440
|
-
}, this.getSignReason = () => this.signReason, this.setSignLocation = (
|
|
441
|
-
this.signLocation =
|
|
442
|
-
}, this.getSignLocation = () => this.signLocation, this.setDefaultStampPassword = (
|
|
443
|
-
this.defaultStampPassword =
|
|
581
|
+
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) => {
|
|
582
|
+
this.signType = n;
|
|
583
|
+
}, this.isCrossPageSideSign = () => this.signType === 2 || this.signType === 3, this.getSealPosition = () => this.sealPosition, this.setSignOnPageSides = (n) => {
|
|
584
|
+
n >= 0 && n <= 3 && (this.signType = n);
|
|
585
|
+
}, this.setSignPositionOnPageSides = (n) => {
|
|
586
|
+
this.sealPosition = n;
|
|
587
|
+
}, this.setPageRange = (n) => {
|
|
588
|
+
this.pageRange = n;
|
|
589
|
+
}, this.getPageRange = () => this.pageRange, this.getPageRanges = () => ke(this.pageRange), this.setSignUserData = (n) => {
|
|
590
|
+
this.signUserData = n;
|
|
591
|
+
}, this.setPrintMargin = (n) => {
|
|
592
|
+
this.printMargin = n;
|
|
593
|
+
}, this.getPrintMargin = () => this.printMargin ?? 0, this.setSignReason = (n) => {
|
|
594
|
+
this.signReason = n;
|
|
595
|
+
}, this.getSignReason = () => this.signReason, this.setSignLocation = (n) => {
|
|
596
|
+
this.signLocation = n;
|
|
597
|
+
}, this.getSignLocation = () => this.signLocation, this.setDefaultStampPassword = (n) => {
|
|
598
|
+
this.defaultStampPassword = n;
|
|
444
599
|
};
|
|
445
600
|
}
|
|
446
601
|
}
|
|
447
|
-
const
|
|
602
|
+
const be = {
|
|
603
|
+
setSignServer: { kind: "command" },
|
|
604
|
+
addSignServerAuthCallback: {
|
|
605
|
+
kind: "callbackRegister",
|
|
606
|
+
callback: (t, n) => {
|
|
607
|
+
const e = n[0];
|
|
608
|
+
typeof e == "function" && t.signServerAuth.push(e);
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
setSignServerDefaultLogin: { kind: "command" },
|
|
612
|
+
setDefaultSignServerLogin: { kind: "command" },
|
|
613
|
+
setSignServerDefaultPassword: { kind: "command" },
|
|
614
|
+
setDefaultSignServerPassword: { kind: "command" },
|
|
615
|
+
loginNTKOSignServer: { kind: "command" },
|
|
616
|
+
loginSignServer: { kind: "callbackQuery" },
|
|
617
|
+
signOutSignServer: { kind: "command" },
|
|
618
|
+
isAuthenticatedOnSignServer: { kind: "stateGetter", state: () => !1 },
|
|
619
|
+
setSignServerLoginFromUSBKey: { kind: "command" },
|
|
620
|
+
setUserAuthSource: { kind: "command" }
|
|
621
|
+
};
|
|
622
|
+
class Te {
|
|
623
|
+
constructor(n) {
|
|
624
|
+
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, a) => this.adapter.loginNTKOSignServer(e, i, a), this.loginSignServer = (e, i, a, r) => this.adapter.loginSignServer(e, i, a, r), 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 = c(
|
|
625
|
+
"signServer",
|
|
626
|
+
be,
|
|
627
|
+
n
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
const ve = {
|
|
632
|
+
createPDF417Barcode: { kind: "command" }
|
|
633
|
+
};
|
|
634
|
+
class Ae {
|
|
635
|
+
constructor(n) {
|
|
636
|
+
this.createPDF417Barcode = (e, i, a, r, s, o, l) => this.adapter.createPDF417Barcode(e, i, a, r, s, o, l), this.adapter = c(
|
|
637
|
+
"symbology",
|
|
638
|
+
ve,
|
|
639
|
+
n
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
const Re = {
|
|
644
|
+
setup: { kind: "command" },
|
|
645
|
+
create: { kind: "command" },
|
|
646
|
+
getMarkups: { kind: "callbackQuery" },
|
|
647
|
+
removeMarkup: { kind: "command" },
|
|
648
|
+
removeAllMarkups: { kind: "command" },
|
|
649
|
+
sign: { kind: "callbackQuery" }
|
|
650
|
+
};
|
|
651
|
+
class Ee {
|
|
652
|
+
constructor(n) {
|
|
653
|
+
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 = c(
|
|
654
|
+
"templateSign",
|
|
655
|
+
Re,
|
|
656
|
+
n
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
const ye = /* @__PURE__ */ new Set([2, 5]), Pe = (t) => ({
|
|
448
661
|
showToolbarMenu: { kind: "command" },
|
|
449
662
|
hideToolbarMenu: { kind: "command" },
|
|
450
663
|
setupToolbarMenu: { kind: "command" },
|
|
@@ -470,133 +683,133 @@ const de = /* @__PURE__ */ new Set([2, 5]), le = (n) => ({
|
|
|
470
683
|
exitBookViewMode: { kind: "command" },
|
|
471
684
|
isBookViewActivated: {
|
|
472
685
|
kind: "stateGetter",
|
|
473
|
-
state: () =>
|
|
686
|
+
state: () => ye.has(t.state.snapshot().pageMode)
|
|
474
687
|
},
|
|
475
688
|
requestFullScreen: { kind: "command" },
|
|
476
689
|
exitFullScreen: { kind: "command" },
|
|
477
690
|
invalidateView: { kind: "command" }
|
|
478
691
|
});
|
|
479
|
-
class
|
|
480
|
-
constructor(
|
|
481
|
-
this.showToolbarMenu = () => this.adapter.showToolbarMenu(), this.hideToolbarMenu = () => this.adapter.hideToolbarMenu(), this.setupToolbarMenu = (e) => this.adapter.setupToolbarMenu(e), this.showToolbarMenuItem = (e) => this.adapter.showToolbarMenuItem(e), this.hideToolbarMenuItem = (e) => this.adapter.hideToolbarMenuItem(e), this.setupRibbonMenu = (e) => this.adapter.setupRibbonMenu(e), this.setupRibbonMenuItem = (e, i,
|
|
692
|
+
class De {
|
|
693
|
+
constructor(n) {
|
|
694
|
+
this.showToolbarMenu = () => this.adapter.showToolbarMenu(), this.hideToolbarMenu = () => this.adapter.hideToolbarMenu(), this.setupToolbarMenu = (e) => this.adapter.setupToolbarMenu(e), this.showToolbarMenuItem = (e) => this.adapter.showToolbarMenuItem(e), this.hideToolbarMenuItem = (e) => this.adapter.hideToolbarMenuItem(e), this.setupRibbonMenu = (e) => this.adapter.setupRibbonMenu(e), this.setupRibbonMenuItem = (e, i, a) => this.adapter.setupRibbonMenuItem(e, i, a), this.setupRibbonTitleBar = (e) => this.adapter.setupRibbonTitleBar(e), this.showRibbonMenu = () => this.adapter.showRibbonMenu(), this.hideRibbonMenu = () => this.adapter.hideRibbonMenu(), this.showRibbonMenuItem = (e, i) => this.adapter.showRibbonMenuItem(e, i), this.hideRibbonMenuItem = (e, i) => this.adapter.hideRibbonMenuItem(e, i), this.showRibbonTitleBar = () => this.adapter.showRibbonTitleBar(), this.hideRibbonTitleBar = () => this.adapter.hideRibbonTitleBar(), this.selectRibbonMenu = (e) => this.adapter.selectRibbonMenu(e), this.setRibbonMenuButtonStyle = (e, i) => this.adapter.setRibbonMenuButtonStyle(e, i), this.setWatermark = (e) => this.adapter.setWatermark(e), this.setCompactMode = (e) => this.adapter.setCompactMode(e), 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 = c("ui", Pe(n), n);
|
|
482
695
|
}
|
|
483
696
|
}
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
697
|
+
const Ce = (t) => {
|
|
698
|
+
if (!t)
|
|
486
699
|
return;
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
700
|
+
const n = t.trim().toLowerCase();
|
|
701
|
+
if (n === "application")
|
|
489
702
|
return "auto";
|
|
490
|
-
if (
|
|
491
|
-
return
|
|
492
|
-
}, x = (
|
|
493
|
-
const
|
|
494
|
-
return
|
|
495
|
-
},
|
|
496
|
-
const e = x(
|
|
703
|
+
if (n === "light" || n === "dark" || n === "high-contrast" || n === "auto")
|
|
704
|
+
return n;
|
|
705
|
+
}, x = (t) => {
|
|
706
|
+
const n = new URL(t, globalThis.location?.href ?? "http://localhost/");
|
|
707
|
+
return n.hash = "", n.pathname.endsWith("/") || (n.pathname = `${n.pathname}/`), n.toString();
|
|
708
|
+
}, Ie = (t) => new URL("editors.bootstrap.js", t).toString(), we = (t, n) => {
|
|
709
|
+
const e = x(t);
|
|
497
710
|
return {
|
|
498
|
-
...
|
|
711
|
+
...n,
|
|
499
712
|
appUrl: e,
|
|
500
|
-
scrollIntoView:
|
|
501
|
-
theme:
|
|
713
|
+
scrollIntoView: n.scrollIntoView ?? !0,
|
|
714
|
+
theme: Ce(n.theme)
|
|
502
715
|
};
|
|
503
|
-
},
|
|
504
|
-
const
|
|
505
|
-
return
|
|
716
|
+
}, u = "rhc-office-editor", T = "__RHC_OFFICE_SDK_READER_LOADER__", B = () => {
|
|
717
|
+
const t = globalThis;
|
|
718
|
+
return t[T] || (t[T] = {
|
|
506
719
|
activeAppUrl: null,
|
|
507
720
|
loadPromises: /* @__PURE__ */ new Map()
|
|
508
|
-
}),
|
|
509
|
-
},
|
|
510
|
-
class
|
|
511
|
-
constructor(
|
|
512
|
-
super(`Failed to load reader bootstrap script: ${
|
|
721
|
+
}), t[T];
|
|
722
|
+
}, Me = (t) => Array.from(document.querySelectorAll("script")).find((n) => n.src === t) ?? null;
|
|
723
|
+
class y extends Error {
|
|
724
|
+
constructor(n) {
|
|
725
|
+
super(`Failed to load reader bootstrap script: ${n}`), this.name = "ReaderScriptLoadError";
|
|
513
726
|
}
|
|
514
727
|
}
|
|
515
|
-
class
|
|
516
|
-
constructor(
|
|
728
|
+
class Oe extends Error {
|
|
729
|
+
constructor(n, e) {
|
|
517
730
|
super(
|
|
518
|
-
`Reader Web Component "${
|
|
731
|
+
`Reader Web Component "${u}" is already bound to ${n} and cannot be reloaded from ${e}.`
|
|
519
732
|
), this.name = "ReaderSourceConflictError";
|
|
520
733
|
}
|
|
521
734
|
}
|
|
522
|
-
const
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
throw new
|
|
526
|
-
},
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
const e =
|
|
735
|
+
const V = (t) => {
|
|
736
|
+
const n = B();
|
|
737
|
+
if (n.activeAppUrl && n.activeAppUrl !== t)
|
|
738
|
+
throw new Oe(n.activeAppUrl, t);
|
|
739
|
+
}, _e = (t) => {
|
|
740
|
+
const n = B();
|
|
741
|
+
V(t);
|
|
742
|
+
const e = n.loadPromises.get(t);
|
|
530
743
|
if (e)
|
|
531
744
|
return e;
|
|
532
|
-
if (globalThis.customElements?.get(
|
|
533
|
-
|
|
534
|
-
const
|
|
535
|
-
return
|
|
745
|
+
if (globalThis.customElements?.get(u)) {
|
|
746
|
+
n.activeAppUrl = t;
|
|
747
|
+
const s = Promise.resolve();
|
|
748
|
+
return n.loadPromises.set(t, s), s;
|
|
536
749
|
}
|
|
537
|
-
const i =
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
const l = (
|
|
541
|
-
|
|
542
|
-
},
|
|
543
|
-
globalThis.customElements.whenDefined(
|
|
544
|
-
|
|
545
|
-
}).catch(
|
|
750
|
+
const i = Ie(t), a = Me(i);
|
|
751
|
+
n.activeAppUrl = t;
|
|
752
|
+
const r = new Promise((s, o) => {
|
|
753
|
+
const l = (k) => {
|
|
754
|
+
k?.remove(), o(new y(i));
|
|
755
|
+
}, m = () => {
|
|
756
|
+
globalThis.customElements.whenDefined(u).then(() => {
|
|
757
|
+
s();
|
|
758
|
+
}).catch(o);
|
|
546
759
|
};
|
|
547
|
-
if (
|
|
548
|
-
if (globalThis.customElements?.get(
|
|
549
|
-
|
|
760
|
+
if (a) {
|
|
761
|
+
if (globalThis.customElements?.get(u)) {
|
|
762
|
+
s();
|
|
550
763
|
return;
|
|
551
764
|
}
|
|
552
|
-
|
|
765
|
+
a.addEventListener(
|
|
553
766
|
"error",
|
|
554
|
-
() =>
|
|
767
|
+
() => o(new y(i)),
|
|
555
768
|
{
|
|
556
769
|
once: !0
|
|
557
770
|
}
|
|
558
|
-
),
|
|
771
|
+
), m();
|
|
559
772
|
return;
|
|
560
773
|
}
|
|
561
774
|
const d = document.createElement("script");
|
|
562
|
-
d.src = i, d.async = !0, d.dataset.rhcOfficeSdkReader =
|
|
563
|
-
}).catch((
|
|
564
|
-
throw
|
|
775
|
+
d.src = i, d.async = !0, d.dataset.rhcOfficeSdkReader = t, d.addEventListener("load", m, { once: !0 }), d.addEventListener("error", () => l(d), { once: !0 }), document.head.appendChild(d);
|
|
776
|
+
}).catch((s) => {
|
|
777
|
+
throw n.loadPromises.delete(t), !globalThis.customElements?.get(u) && n.activeAppUrl === t && (n.activeAppUrl = null), s;
|
|
565
778
|
});
|
|
566
|
-
return
|
|
567
|
-
},
|
|
568
|
-
const
|
|
569
|
-
return typeof
|
|
570
|
-
}, g = () => globalThis[
|
|
571
|
-
class
|
|
572
|
-
constructor(
|
|
573
|
-
super(e), this.name = "ReaderBridgeError", this.code =
|
|
779
|
+
return n.loadPromises.set(t, r), r;
|
|
780
|
+
}, Fe = 5e3, Le = 5e3, Ue = () => {
|
|
781
|
+
const t = globalThis.crypto;
|
|
782
|
+
return typeof t?.randomUUID == "function" ? t.randomUUID() : `adapter-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
783
|
+
}, g = () => globalThis[ee];
|
|
784
|
+
class Ne extends Error {
|
|
785
|
+
constructor(n, e, i) {
|
|
786
|
+
super(e), this.name = "ReaderBridgeError", this.code = n, this.details = i;
|
|
574
787
|
}
|
|
575
788
|
}
|
|
576
|
-
class
|
|
577
|
-
constructor(
|
|
578
|
-
this.readerId = null, this.readyTimeoutMs =
|
|
789
|
+
class xe {
|
|
790
|
+
constructor(n) {
|
|
791
|
+
this.readerId = null, this.readyTimeoutMs = n?.readyTimeoutMs ?? Le, this.requestTimeoutMs = n?.requestTimeoutMs ?? Fe;
|
|
579
792
|
}
|
|
580
|
-
configureTimeouts(
|
|
581
|
-
this.readyTimeoutMs =
|
|
793
|
+
configureTimeouts(n) {
|
|
794
|
+
this.readyTimeoutMs = n?.readyTimeoutMs ?? this.readyTimeoutMs, this.requestTimeoutMs = n?.requestTimeoutMs ?? this.requestTimeoutMs;
|
|
582
795
|
}
|
|
583
|
-
setReaderId(
|
|
584
|
-
this.readerId =
|
|
796
|
+
setReaderId(n) {
|
|
797
|
+
this.readerId = n;
|
|
585
798
|
}
|
|
586
799
|
getReaderId() {
|
|
587
800
|
return this.readerId;
|
|
588
801
|
}
|
|
589
|
-
async request(
|
|
590
|
-
const
|
|
591
|
-
if (
|
|
592
|
-
return
|
|
593
|
-
throw new
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
802
|
+
async request(n, e, i, a) {
|
|
803
|
+
const r = await this.requestRaw(n, e, i, a);
|
|
804
|
+
if (r.ok)
|
|
805
|
+
return r.result;
|
|
806
|
+
throw new Ne(
|
|
807
|
+
r.error.code,
|
|
808
|
+
r.error.message,
|
|
809
|
+
r.error.details
|
|
597
810
|
);
|
|
598
811
|
}
|
|
599
|
-
async requestRaw(
|
|
812
|
+
async requestRaw(n, e, i, a) {
|
|
600
813
|
if (!this.readerId)
|
|
601
814
|
return {
|
|
602
815
|
ok: !1,
|
|
@@ -606,8 +819,8 @@ class Ce {
|
|
|
606
819
|
message: "Reader is not mounted."
|
|
607
820
|
}
|
|
608
821
|
};
|
|
609
|
-
const
|
|
610
|
-
if (!
|
|
822
|
+
const r = await this.waitForAdapter(this.readerId, a?.timeoutMs);
|
|
823
|
+
if (!r)
|
|
611
824
|
return {
|
|
612
825
|
ok: !1,
|
|
613
826
|
requestId: "",
|
|
@@ -616,45 +829,45 @@ class Ce {
|
|
|
616
829
|
message: "Editor adapter is not available."
|
|
617
830
|
}
|
|
618
831
|
};
|
|
619
|
-
const
|
|
620
|
-
protocol:
|
|
621
|
-
version:
|
|
622
|
-
requestId:
|
|
832
|
+
const s = {
|
|
833
|
+
protocol: J,
|
|
834
|
+
version: Z,
|
|
835
|
+
requestId: Ue(),
|
|
623
836
|
readerId: this.readerId,
|
|
624
|
-
tool:
|
|
837
|
+
tool: n,
|
|
625
838
|
method: e,
|
|
626
839
|
params: i
|
|
627
840
|
};
|
|
628
841
|
return this.withTimeout(
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
842
|
+
r.request(s),
|
|
843
|
+
s.requestId,
|
|
844
|
+
a?.timeoutMs ?? this.requestTimeoutMs
|
|
632
845
|
);
|
|
633
846
|
}
|
|
634
847
|
getCapabilities() {
|
|
635
848
|
return this.readerId ? g()?.getCapabilities(this.readerId) ?? null : null;
|
|
636
849
|
}
|
|
637
|
-
async waitForAdapter(
|
|
850
|
+
async waitForAdapter(n, e = this.readyTimeoutMs) {
|
|
638
851
|
const i = g();
|
|
639
|
-
return i?.getCapabilities(
|
|
640
|
-
let
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
},
|
|
644
|
-
if ((l instanceof CustomEvent ? l.detail : void 0)?.readerId !==
|
|
852
|
+
return i?.getCapabilities(n) ? i : new Promise((a) => {
|
|
853
|
+
let r;
|
|
854
|
+
const s = () => {
|
|
855
|
+
r && clearTimeout(r), globalThis.removeEventListener(R, o);
|
|
856
|
+
}, o = (l) => {
|
|
857
|
+
if ((l instanceof CustomEvent ? l.detail : void 0)?.readerId !== n)
|
|
645
858
|
return;
|
|
646
859
|
const d = g();
|
|
647
|
-
|
|
860
|
+
s(), a(d ?? null);
|
|
648
861
|
};
|
|
649
|
-
globalThis.addEventListener(
|
|
650
|
-
|
|
862
|
+
globalThis.addEventListener(R, o), r = setTimeout(() => {
|
|
863
|
+
s(), a(g()?.getCapabilities(n) ? g() : null);
|
|
651
864
|
}, e);
|
|
652
865
|
});
|
|
653
866
|
}
|
|
654
|
-
async withTimeout(
|
|
655
|
-
return new Promise((
|
|
656
|
-
const
|
|
657
|
-
|
|
867
|
+
async withTimeout(n, e, i) {
|
|
868
|
+
return new Promise((a) => {
|
|
869
|
+
const r = setTimeout(() => {
|
|
870
|
+
a({
|
|
658
871
|
ok: !1,
|
|
659
872
|
requestId: e,
|
|
660
873
|
error: {
|
|
@@ -663,60 +876,59 @@ class Ce {
|
|
|
663
876
|
}
|
|
664
877
|
});
|
|
665
878
|
}, i);
|
|
666
|
-
|
|
667
|
-
|
|
879
|
+
n.then((s) => a(s)).catch((s) => {
|
|
880
|
+
a({
|
|
668
881
|
ok: !1,
|
|
669
882
|
requestId: e,
|
|
670
883
|
error: {
|
|
671
884
|
code: "EXECUTION_FAILED",
|
|
672
|
-
message:
|
|
885
|
+
message: s instanceof Error ? s.message : String(s)
|
|
673
886
|
}
|
|
674
887
|
});
|
|
675
888
|
}).finally(() => {
|
|
676
|
-
clearTimeout(
|
|
889
|
+
clearTimeout(r);
|
|
677
890
|
});
|
|
678
891
|
});
|
|
679
892
|
}
|
|
680
893
|
}
|
|
681
|
-
const
|
|
894
|
+
const P = {
|
|
682
895
|
annotationEnabled: !1,
|
|
683
896
|
documentModified: !1,
|
|
684
897
|
documentOpened: !1,
|
|
685
|
-
extensionState: "disconnected",
|
|
686
898
|
pageCount: 0,
|
|
687
899
|
pageIndex: 1,
|
|
688
900
|
pageMode: 0,
|
|
689
901
|
zoomLevel: 100
|
|
690
902
|
};
|
|
691
|
-
class
|
|
903
|
+
class Be {
|
|
692
904
|
constructor() {
|
|
693
|
-
this.state = { ...
|
|
905
|
+
this.state = { ...P };
|
|
694
906
|
}
|
|
695
907
|
reset() {
|
|
696
|
-
this.state = { ...
|
|
908
|
+
this.state = { ...P };
|
|
697
909
|
}
|
|
698
|
-
update(
|
|
699
|
-
|
|
910
|
+
update(n) {
|
|
911
|
+
n && (this.state = {
|
|
700
912
|
...this.state,
|
|
701
|
-
...
|
|
913
|
+
...n
|
|
702
914
|
});
|
|
703
915
|
}
|
|
704
|
-
setDocumentOpened(
|
|
916
|
+
setDocumentOpened(n) {
|
|
705
917
|
this.state = {
|
|
706
918
|
...this.state,
|
|
707
|
-
documentOpened:
|
|
919
|
+
documentOpened: n
|
|
708
920
|
};
|
|
709
921
|
}
|
|
710
922
|
snapshot() {
|
|
711
923
|
return { ...this.state };
|
|
712
924
|
}
|
|
713
925
|
}
|
|
714
|
-
class
|
|
926
|
+
class Ve {
|
|
715
927
|
constructor() {
|
|
716
|
-
this.annotationEvents = [], this.annotationPersist = [], this.annotationRetrieve = [], this.digitalAnnotationRetrieve = [], this.digitalSignatureParse = [], this.digitalSignatureRetrieve = [], this.documentClosed = [], this.documentOpened = [], this.documentSaved = [], this.
|
|
928
|
+
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 = [];
|
|
717
929
|
}
|
|
718
|
-
emit(
|
|
719
|
-
switch (
|
|
930
|
+
emit(n, e) {
|
|
931
|
+
switch (n) {
|
|
720
932
|
case "documentOpened":
|
|
721
933
|
case "documentLoaded":
|
|
722
934
|
this.documentOpened.forEach((i) => i("ok", ""));
|
|
@@ -730,19 +942,19 @@ class Ae {
|
|
|
730
942
|
case "pageChange": {
|
|
731
943
|
const i = e;
|
|
732
944
|
this.pageChange.forEach(
|
|
733
|
-
(
|
|
945
|
+
(a) => a(i.pageIndex ?? 1, i.pageCount ?? 0)
|
|
734
946
|
);
|
|
735
947
|
return;
|
|
736
948
|
}
|
|
737
949
|
case "pageModeChange": {
|
|
738
950
|
const i = e;
|
|
739
|
-
this.pageModeChange.forEach((
|
|
951
|
+
this.pageModeChange.forEach((a) => a(i.pageMode ?? 0));
|
|
740
952
|
return;
|
|
741
953
|
}
|
|
742
954
|
case "annotationEvent": {
|
|
743
955
|
const i = e;
|
|
744
956
|
this.annotationEvents.forEach(
|
|
745
|
-
(
|
|
957
|
+
(a) => a(i.event ?? "annotationEvent", i.payload)
|
|
746
958
|
);
|
|
747
959
|
return;
|
|
748
960
|
}
|
|
@@ -757,6 +969,9 @@ class Ae {
|
|
|
757
969
|
(i) => i(Array.isArray(e) ? e : [])
|
|
758
970
|
);
|
|
759
971
|
return;
|
|
972
|
+
case "digitalSign":
|
|
973
|
+
this.digitalSign.forEach((i) => i(e));
|
|
974
|
+
return;
|
|
760
975
|
case "digitalSignatureRetrieve":
|
|
761
976
|
this.digitalSignatureRetrieve.forEach(
|
|
762
977
|
(i) => i(Array.isArray(e) ? e : [])
|
|
@@ -767,105 +982,80 @@ class Ae {
|
|
|
767
982
|
(i) => i(Array.isArray(e) ? e : [])
|
|
768
983
|
);
|
|
769
984
|
return;
|
|
770
|
-
case "
|
|
771
|
-
|
|
772
|
-
this.extensionStateChanged.forEach(
|
|
773
|
-
(r) => r(i.state ?? "disconnected")
|
|
774
|
-
);
|
|
985
|
+
case "signServerAuth":
|
|
986
|
+
this.signServerAuth.forEach((i) => i(e));
|
|
775
987
|
return;
|
|
776
|
-
}
|
|
777
988
|
default:
|
|
778
989
|
return;
|
|
779
990
|
}
|
|
780
991
|
}
|
|
781
992
|
}
|
|
782
|
-
const
|
|
993
|
+
const Ke = [
|
|
783
994
|
"documentLoaded",
|
|
784
995
|
"documentStateChange",
|
|
785
996
|
"documentError"
|
|
786
|
-
],
|
|
787
|
-
appUrl:
|
|
788
|
-
configuration:
|
|
789
|
-
element:
|
|
790
|
-
}),
|
|
791
|
-
if (typeof
|
|
792
|
-
const
|
|
793
|
-
if (!
|
|
794
|
-
throw new Error(`Reader container "${
|
|
795
|
-
if (!(
|
|
796
|
-
throw new Error(`Reader container "${
|
|
797
|
-
return
|
|
997
|
+
], Ge = "readerReady", He = "readerUnload", v = "readerError", qe = () => typeof globalThis.crypto?.randomUUID == "function" ? globalThis.crypto.randomUUID() : `rhc-reader-${Date.now()}-${Math.random().toString(36).slice(2)}`, D = (t, n) => ({
|
|
998
|
+
appUrl: n?.appUrl ?? null,
|
|
999
|
+
configuration: n,
|
|
1000
|
+
element: t
|
|
1001
|
+
}), Qe = (t) => {
|
|
1002
|
+
if (typeof t == "string") {
|
|
1003
|
+
const n = document.getElementById(t);
|
|
1004
|
+
if (!n)
|
|
1005
|
+
throw new Error(`Reader container "${t}" was not found.`);
|
|
1006
|
+
if (!(n instanceof HTMLDivElement))
|
|
1007
|
+
throw new Error(`Reader container "${t}" must be a div element.`);
|
|
1008
|
+
return n;
|
|
798
1009
|
}
|
|
799
|
-
if (!(
|
|
1010
|
+
if (!(t instanceof HTMLDivElement))
|
|
800
1011
|
throw new Error("Reader container must be a div element.");
|
|
801
|
-
return
|
|
802
|
-
},
|
|
803
|
-
const
|
|
804
|
-
return (
|
|
805
|
-
},
|
|
806
|
-
const e =
|
|
1012
|
+
return t;
|
|
1013
|
+
}, ze = () => {
|
|
1014
|
+
const t = typeof globalThis.matchMedia == "function";
|
|
1015
|
+
return (t ? globalThis.matchMedia("(prefers-contrast: more)").matches : !1) ? "high-contrast" : (t ? globalThis.matchMedia("(prefers-color-scheme: dark)").matches : !1) ? "dark" : "light";
|
|
1016
|
+
}, C = (t, n) => {
|
|
1017
|
+
const e = t;
|
|
807
1018
|
if (typeof e.addEventListener == "function") {
|
|
808
|
-
e.addEventListener("change",
|
|
1019
|
+
e.addEventListener("change", n);
|
|
809
1020
|
return;
|
|
810
1021
|
}
|
|
811
|
-
typeof e.addListener == "function" && e.addListener(
|
|
812
|
-
}, I = (
|
|
813
|
-
const e =
|
|
1022
|
+
typeof e.addListener == "function" && e.addListener(n);
|
|
1023
|
+
}, I = (t, n) => {
|
|
1024
|
+
const e = t;
|
|
814
1025
|
if (typeof e.removeEventListener == "function") {
|
|
815
|
-
e.removeEventListener("change",
|
|
1026
|
+
e.removeEventListener("change", n);
|
|
816
1027
|
return;
|
|
817
1028
|
}
|
|
818
|
-
typeof e.removeListener == "function" && e.removeListener(
|
|
819
|
-
},
|
|
820
|
-
|
|
821
|
-
},
|
|
822
|
-
const e =
|
|
1029
|
+
typeof e.removeListener == "function" && e.removeListener(n);
|
|
1030
|
+
}, We = (t, n) => {
|
|
1031
|
+
n.style && (t.style.cssText = n.style), t.style.display || (t.style.display = "block"), t.style.width ? n.width && (t.style.width = n.width) : t.style.width = n.width ?? "100%", t.style.height ? n.height && (t.style.height = n.height) : t.style.height = n.height ?? "100%";
|
|
1032
|
+
}, $e = (t, n) => {
|
|
1033
|
+
const e = n.theme;
|
|
823
1034
|
if (!e)
|
|
824
|
-
return
|
|
1035
|
+
return t.removeAttribute("theme"), null;
|
|
825
1036
|
if (e !== "auto")
|
|
826
|
-
return
|
|
1037
|
+
return t.setAttribute("theme", e), null;
|
|
827
1038
|
const i = () => {
|
|
828
|
-
|
|
1039
|
+
t.setAttribute("theme", ze());
|
|
829
1040
|
};
|
|
830
1041
|
if (i(), typeof globalThis.matchMedia != "function")
|
|
831
1042
|
return null;
|
|
832
|
-
const
|
|
1043
|
+
const a = globalThis.matchMedia("(prefers-color-scheme: dark)"), r = globalThis.matchMedia("(prefers-contrast: more)"), s = () => {
|
|
833
1044
|
i();
|
|
834
1045
|
};
|
|
835
|
-
return
|
|
836
|
-
I(
|
|
1046
|
+
return C(a, s), C(r, s), () => {
|
|
1047
|
+
I(a, s), I(r, s);
|
|
837
1048
|
};
|
|
838
1049
|
};
|
|
839
|
-
class
|
|
840
|
-
constructor(
|
|
841
|
-
this.bridge = new
|
|
1050
|
+
class Ye {
|
|
1051
|
+
constructor(n) {
|
|
1052
|
+
this.bridge = new xe(), this.callbacks = new Ve(), this.readerState = new Be(), this.bridgeToolContext = {
|
|
842
1053
|
bridge: this.bridge,
|
|
843
1054
|
callbacks: this.callbacks,
|
|
844
1055
|
debug: () => this.debugEnabled,
|
|
845
1056
|
onAsyncError: (e) => this.reportAdapterError(e),
|
|
846
1057
|
state: this.readerState
|
|
847
|
-
}, this.documentTool = new
|
|
848
|
-
"signServer",
|
|
849
|
-
this.bridgeToolContext
|
|
850
|
-
), this.digitalSignTool = u(
|
|
851
|
-
"digitalSign",
|
|
852
|
-
this.bridgeToolContext
|
|
853
|
-
), this.reviewTool = u(
|
|
854
|
-
"review",
|
|
855
|
-
this.bridgeToolContext
|
|
856
|
-
), this.ekeyTool = u(
|
|
857
|
-
"ekey",
|
|
858
|
-
this.bridgeToolContext
|
|
859
|
-
), this.symbologyTool = u(
|
|
860
|
-
"symbology",
|
|
861
|
-
this.bridgeToolContext
|
|
862
|
-
), this.annotationTool = this.createAnnotationTool(), this.templateSignTool = u(
|
|
863
|
-
"templateSign",
|
|
864
|
-
this.bridgeToolContext
|
|
865
|
-
), this.pdfFormFiller = new te(this.bridgeToolContext), this.extensionTool = this.createExtensionTool(), this.networkingTool = new X(this.bridgeToolContext), this.cryptoTool = u(
|
|
866
|
-
"crypto",
|
|
867
|
-
this.bridgeToolContext
|
|
868
|
-
), 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.nativeEventCleanupCallbacks = [], this.themeCleanup = null, this.enableDebug = (e) => {
|
|
1058
|
+
}, this.documentTool = new ne(this.bridgeToolContext), this.uiTool = new De(this.bridgeToolContext), this.pageTool = new de(this.bridgeToolContext), this.findTool = new ae(this.bridgeToolContext), this.signServerTool = new Te(this.bridgeToolContext), this.digitalSignTool = new X(this.bridgeToolContext), this.symbologyTool = new Ae(this.bridgeToolContext), this.annotationTool = new W(this.bridgeToolContext), this.templateSignTool = new Ee(this.bridgeToolContext), this.pdfFormFiller = new ce(this.bridgeToolContext), this.networkingTool = new se(this.bridgeToolContext), this.cryptoTool = new Y(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.nativeEventCleanupCallbacks = [], this.themeCleanup = null, this.enableDebug = (e) => {
|
|
869
1059
|
this.debugEnabled = e;
|
|
870
1060
|
}, this.changeLanguage = () => {
|
|
871
1061
|
}, this.setLicense = (e, i) => {
|
|
@@ -892,50 +1082,50 @@ class Ue {
|
|
|
892
1082
|
this.unloadCallbacks.push(e);
|
|
893
1083
|
}, this.setReaderEventListener = (e) => {
|
|
894
1084
|
this.readerEventListener = e;
|
|
895
|
-
}, this.embedReader = (e, i,
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
this.removeReader(), this.mountToken = l, this.removed = !1, this.hostContainer =
|
|
1085
|
+
}, this.embedReader = (e, i, a) => {
|
|
1086
|
+
const r = Qe(e), s = x(i);
|
|
1087
|
+
V(s);
|
|
1088
|
+
const o = we(s, a), l = this.mountToken + 1;
|
|
1089
|
+
this.removeReader(), this.mountToken = l, this.removed = !1, this.hostContainer = r, this.normalizedConfiguration = o, this.mountReader(r, o, l);
|
|
900
1090
|
}, this.removeReader = () => {
|
|
901
1091
|
const e = !!(this.readerElement || this.hostContainer);
|
|
902
1092
|
if (this.mountToken += 1, this.cleanupNativeEventForwarders(), this.cleanupThemeBinding(), 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)
|
|
903
1093
|
return;
|
|
904
1094
|
const i = D(null, null);
|
|
905
|
-
this.emitReaderEvent(
|
|
906
|
-
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, this.getFindTool = () => this.findTool, this.getSignServerTool = () => this.signServerTool, this.getDigitalSignTool = () => this.digitalSignTool, this.
|
|
1095
|
+
this.emitReaderEvent(He, i), this.unloadCallbacks.forEach((a) => a());
|
|
1096
|
+
}, this.getDocumentTool = () => this.documentTool, this.getUITool = () => this.uiTool, this.getPageTool = () => this.pageTool, 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.createDigitalSignOptions = () => new fe(), this.createKVField = (e, i, a) => new Se(e, i, a), this.mountReader = async (e, i, a) => {
|
|
907
1097
|
try {
|
|
908
|
-
if (await
|
|
1098
|
+
if (await _e(i.appUrl), this.mountToken !== a)
|
|
909
1099
|
return;
|
|
910
|
-
const
|
|
911
|
-
if (
|
|
1100
|
+
const r = document.createElement(u), s = qe();
|
|
1101
|
+
if (r.setAttribute(N, s), this.readerId = s, this.bridge.setReaderId(s), We(r, i), this.themeCleanup = $e(r, i), this.bindNativeReaderEvents(r), e.replaceChildren(r), this.readerElement = r, await Promise.resolve(), this.mountToken !== a)
|
|
912
1102
|
return;
|
|
913
1103
|
i.scrollIntoView && typeof e.scrollIntoView == "function" && e.scrollIntoView({ behavior: "smooth", block: "nearest" }), this.isReady = !0;
|
|
914
|
-
const
|
|
915
|
-
this.emitReaderEvent(
|
|
916
|
-
} catch (
|
|
917
|
-
if (this.mountToken !==
|
|
1104
|
+
const o = D(r, i);
|
|
1105
|
+
this.emitReaderEvent(Ge, o), this.readyCallbacks.forEach((l) => l());
|
|
1106
|
+
} catch (r) {
|
|
1107
|
+
if (this.mountToken !== a)
|
|
918
1108
|
return;
|
|
919
|
-
this.reportReaderError(
|
|
1109
|
+
this.reportReaderError(r);
|
|
920
1110
|
}
|
|
921
1111
|
}, this.bindNativeReaderEvents = (e) => {
|
|
922
1112
|
this.cleanupNativeEventForwarders();
|
|
923
|
-
const i = (
|
|
924
|
-
const
|
|
925
|
-
!
|
|
1113
|
+
const i = (a) => {
|
|
1114
|
+
const r = a instanceof CustomEvent ? a.detail : null;
|
|
1115
|
+
!r || r.readerId !== this.readerId || (this.readerState.update(r.statePatch), this.callbacks.emit(r.event, r.payload), this.emitReaderEvent(r.event, r.payload));
|
|
926
1116
|
};
|
|
927
|
-
e.addEventListener(
|
|
1117
|
+
e.addEventListener(E, i), this.nativeEventCleanupCallbacks.push(() => {
|
|
928
1118
|
e.removeEventListener(
|
|
929
|
-
|
|
1119
|
+
E,
|
|
930
1120
|
i
|
|
931
1121
|
);
|
|
932
|
-
}),
|
|
933
|
-
const
|
|
934
|
-
const
|
|
935
|
-
|
|
1122
|
+
}), Ke.forEach((a) => {
|
|
1123
|
+
const r = (s) => {
|
|
1124
|
+
const o = s instanceof CustomEvent ? s.detail : s;
|
|
1125
|
+
a === "documentLoaded" && this.readerState.setDocumentOpened(!0), this.emitReaderEvent(a, o), a === "documentError" && this.emitReaderEvent(v, o);
|
|
936
1126
|
};
|
|
937
|
-
e.addEventListener(
|
|
938
|
-
e.removeEventListener(
|
|
1127
|
+
e.addEventListener(a, r), this.nativeEventCleanupCallbacks.push(() => {
|
|
1128
|
+
e.removeEventListener(a, r);
|
|
939
1129
|
});
|
|
940
1130
|
});
|
|
941
1131
|
}, this.cleanupNativeEventForwarders = () => {
|
|
@@ -949,113 +1139,37 @@ class Ue {
|
|
|
949
1139
|
}, this.reportAdapterError = (e) => {
|
|
950
1140
|
this.debugEnabled && console.error("[RHC Office SDK] Adapter command failed", e), this.emitReaderEvent(v, e);
|
|
951
1141
|
}, this.bridge.configureTimeouts({
|
|
952
|
-
readyTimeoutMs:
|
|
953
|
-
requestTimeoutMs:
|
|
1142
|
+
readyTimeoutMs: n?.adapterReadyTimeoutMs,
|
|
1143
|
+
requestTimeoutMs: n?.adapterRequestTimeoutMs
|
|
954
1144
|
});
|
|
955
1145
|
}
|
|
956
|
-
createAnnotationTool() {
|
|
957
|
-
return c(
|
|
958
|
-
"annotation",
|
|
959
|
-
{
|
|
960
|
-
addAnnotationEventCallback: {
|
|
961
|
-
kind: "callbackRegister",
|
|
962
|
-
callback: (t, e) => {
|
|
963
|
-
const i = e[0];
|
|
964
|
-
typeof i == "function" && t.annotationEvents.push(i);
|
|
965
|
-
}
|
|
966
|
-
},
|
|
967
|
-
addAnnotationPersistCallback: {
|
|
968
|
-
kind: "callbackRegister",
|
|
969
|
-
callback: (t, e) => {
|
|
970
|
-
const i = e[0];
|
|
971
|
-
typeof i == "function" && t.annotationPersist.push(i);
|
|
972
|
-
}
|
|
973
|
-
},
|
|
974
|
-
addAnnotationRetrieveCallback: {
|
|
975
|
-
kind: "callbackRegister",
|
|
976
|
-
callback: (t, e) => {
|
|
977
|
-
const i = e[0];
|
|
978
|
-
typeof i == "function" && t.annotationRetrieve.push(i);
|
|
979
|
-
}
|
|
980
|
-
},
|
|
981
|
-
addDigitalAnnotationRetrieveCallback: {
|
|
982
|
-
kind: "callbackRegister",
|
|
983
|
-
callback: (t, e) => {
|
|
984
|
-
const i = e[0];
|
|
985
|
-
typeof i == "function" && t.digitalAnnotationRetrieve.push(
|
|
986
|
-
i
|
|
987
|
-
);
|
|
988
|
-
}
|
|
989
|
-
},
|
|
990
|
-
isInAnnotationMode: {
|
|
991
|
-
kind: "stateGetter",
|
|
992
|
-
state: (t) => t.annotationEnabled
|
|
993
|
-
},
|
|
994
|
-
getAnnotations: { kind: "stateGetter", state: () => [] },
|
|
995
|
-
getAnnotationsCount: { kind: "stateGetter", state: () => 0 },
|
|
996
|
-
queryAnnotationsBy: { kind: "stateGetter", state: () => [] },
|
|
997
|
-
setToolSource: { kind: "command" },
|
|
998
|
-
openAnnotationView: { kind: "command" },
|
|
999
|
-
closeAnnotationView: { kind: "command" },
|
|
1000
|
-
openTextAnnotationView: { kind: "command" },
|
|
1001
|
-
setTextAnnotationFontColor: { kind: "command" },
|
|
1002
|
-
setTextAnnotationFontSize: { kind: "command" },
|
|
1003
|
-
closeTextAnnotationView: { kind: "command" },
|
|
1004
|
-
createTextAnnotation: { kind: "command" },
|
|
1005
|
-
setPersistToDocument: { kind: "command" },
|
|
1006
|
-
saveAnnotations: { kind: "callbackQuery" },
|
|
1007
|
-
saveTextAnnotations: { kind: "command" },
|
|
1008
|
-
clearAnnotations: { kind: "command" },
|
|
1009
|
-
clearTextAnnotations: { kind: "command" },
|
|
1010
|
-
undoAnnotation: { kind: "command" },
|
|
1011
|
-
redoAnnotation: { kind: "command" },
|
|
1012
|
-
selectAnnotationTool: { kind: "command" },
|
|
1013
|
-
showAnnotationColorPicker: { kind: "command" },
|
|
1014
|
-
setAnnotationPenType: { kind: "command" },
|
|
1015
|
-
appendAnnotations: { kind: "callbackQuery" },
|
|
1016
|
-
batchAppendAnnotations: { kind: "callbackQuery" },
|
|
1017
|
-
setAnnotationPenColor: { kind: "command" },
|
|
1018
|
-
setAnnotationPenWidth: { kind: "command" },
|
|
1019
|
-
setAnnotationPenThickness: { kind: "command" },
|
|
1020
|
-
enableAnnotationsInfoView: { kind: "command" },
|
|
1021
|
-
enableAnnotationsDeletion: { kind: "command" },
|
|
1022
|
-
enableAnnotationsDeletionOnlyByAuthor: { kind: "command" },
|
|
1023
|
-
listDigitalStamps: { kind: "command" },
|
|
1024
|
-
listAnnotations: { kind: "command" },
|
|
1025
|
-
deleteAnnotationsBy: { kind: "command" },
|
|
1026
|
-
deleteAnnotationsById: { kind: "command" },
|
|
1027
|
-
addDigitalAnnotation: { kind: "command" },
|
|
1028
|
-
addInkAnnotationCallback: { kind: "callbackRegister" }
|
|
1029
|
-
},
|
|
1030
|
-
this.bridgeToolContext
|
|
1031
|
-
);
|
|
1032
|
-
}
|
|
1033
|
-
createExtensionTool() {
|
|
1034
|
-
return c(
|
|
1035
|
-
"extension",
|
|
1036
|
-
{
|
|
1037
|
-
addExtensionStateChangedCallback: {
|
|
1038
|
-
kind: "callbackRegister",
|
|
1039
|
-
callback: (t, e) => {
|
|
1040
|
-
const i = e[0];
|
|
1041
|
-
typeof i == "function" && t.extensionStateChanged.push(i);
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
},
|
|
1045
|
-
this.bridgeToolContext
|
|
1046
|
-
);
|
|
1047
|
-
}
|
|
1048
1146
|
}
|
|
1049
|
-
const
|
|
1147
|
+
const it = (t) => new Ye(t);
|
|
1050
1148
|
export {
|
|
1051
|
-
|
|
1052
|
-
|
|
1149
|
+
W as AnnotationToolImpl,
|
|
1150
|
+
Y as CryptoToolImpl,
|
|
1151
|
+
tt as DIGITAL_SIGN_DEFAULTS,
|
|
1152
|
+
fe as DigitalSignOptions,
|
|
1153
|
+
X as DigitalSignToolImpl,
|
|
1154
|
+
Ye as DocumentSDK,
|
|
1155
|
+
ne as DocumentToolImpl,
|
|
1156
|
+
ae as FindToolImpl,
|
|
1157
|
+
Se as KVField,
|
|
1158
|
+
se as NetworkingToolImpl,
|
|
1159
|
+
de as PageToolImpl,
|
|
1160
|
+
ce as PdfFormFillerImpl,
|
|
1161
|
+
ue as SDKPhase1NotImplementedError,
|
|
1162
|
+
Te as SignServerToolImpl,
|
|
1163
|
+
Ae as SymbologyToolImpl,
|
|
1164
|
+
Ee as TemplateSignToolImpl,
|
|
1165
|
+
De as UIToolImpl,
|
|
1053
1166
|
K as WatermarkDisplay,
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1167
|
+
it as createNewDocumentSdk,
|
|
1168
|
+
nt as createPhase1ToolPlaceholder,
|
|
1169
|
+
je as getDigitalSignEnvironment,
|
|
1170
|
+
Xe as initializeDigitalSignEnvironment,
|
|
1171
|
+
Ze as patchDigitalSignEnvironment,
|
|
1172
|
+
et as resetDigitalSignEnvironment,
|
|
1173
|
+
Je as setDigitalSignEnvironment
|
|
1060
1174
|
};
|
|
1061
1175
|
//# sourceMappingURL=index.js.map
|