phirepass-widgets 0.0.112 → 0.0.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +33 -0
  2. package/dist/cjs/{index-B8w6l0VL.js → index-BCgmMoIq.js} +103 -32
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/phirepass-downloader_3.cjs.entry.js +3717 -0
  5. package/dist/cjs/phirepass-rdp.cjs.entry.js +18 -6
  6. package/dist/cjs/phirepass-terminal.cjs.entry.js +6 -5
  7. package/dist/cjs/phirepass-widgets.cjs.js +3 -3
  8. package/dist/cjs/protocol-CYh109n2.js +1472 -0
  9. package/dist/collection/collection-manifest.json +3 -1
  10. package/dist/collection/common/channel.js +21 -1
  11. package/dist/collection/common/fetch.js +44 -0
  12. package/dist/collection/components/phirepass-downloader/form.js +69 -0
  13. package/dist/collection/components/phirepass-downloader/format.js +105 -0
  14. package/dist/collection/components/phirepass-downloader/jobs.js +373 -0
  15. package/dist/collection/components/phirepass-downloader/phirepass-downloader.css +1109 -0
  16. package/dist/collection/components/phirepass-downloader/phirepass-downloader.js +1455 -0
  17. package/dist/collection/components/phirepass-downloader/source.js +120 -0
  18. package/dist/collection/components/phirepass-downloader/views/dialogs.js +34 -0
  19. package/dist/collection/components/phirepass-downloader/views/fetch-form.js +65 -0
  20. package/dist/collection/components/phirepass-downloader/views/icons.js +33 -0
  21. package/dist/collection/components/phirepass-downloader/views/job-row.js +91 -0
  22. package/dist/collection/components/phirepass-downloader/views/notices.js +15 -0
  23. package/dist/collection/components/phirepass-downloader/views/states.js +19 -0
  24. package/dist/collection/components/phirepass-media-player/phirepass-media-player.css +216 -0
  25. package/dist/collection/components/phirepass-media-player/phirepass-media-player.js +473 -0
  26. package/dist/collection/components/phirepass-media-player/player.js +94 -0
  27. package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +36 -13
  28. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +122 -0
  29. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.fetch.js +35 -0
  30. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +181 -31
  31. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +2 -2
  32. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  33. package/dist/collection/testing/fixtures.js +219 -0
  34. package/dist/collection/testing/mock-channel.js +410 -0
  35. package/dist/components/index.js +1 -1
  36. package/dist/components/p-BtMWUitf.js +1 -0
  37. package/dist/components/p-C4cmk3bS.js +1 -0
  38. package/dist/components/p-CKnb-oeB.js +1 -0
  39. package/dist/components/phirepass-downloader.d.ts +11 -0
  40. package/dist/components/phirepass-downloader.js +1 -0
  41. package/dist/components/phirepass-media-player.d.ts +11 -0
  42. package/dist/components/phirepass-media-player.js +1 -0
  43. package/dist/components/phirepass-rdp.js +1 -1
  44. package/dist/components/phirepass-sftp-client.js +1 -1
  45. package/dist/components/phirepass-terminal.js +2 -2
  46. package/dist/esm/{index-DGq2b7rM.js → index-Dd9o0CbU.js} +103 -32
  47. package/dist/esm/loader.js +3 -3
  48. package/dist/esm/phirepass-downloader_3.entry.js +3713 -0
  49. package/dist/esm/phirepass-rdp.entry.js +18 -6
  50. package/dist/esm/phirepass-terminal.entry.js +6 -5
  51. package/dist/esm/phirepass-widgets.js +4 -4
  52. package/dist/esm/protocol-BtMWUitf.js +1467 -0
  53. package/dist/phirepass-widgets/p-97d84225.entry.js +1 -0
  54. package/dist/phirepass-widgets/p-BtMWUitf.js +1 -0
  55. package/dist/phirepass-widgets/p-Dd9o0CbU.js +3 -0
  56. package/dist/phirepass-widgets/p-a4a5e5f5.entry.js +1 -0
  57. package/dist/phirepass-widgets/{p-1fef5b5f.entry.js → p-a5ce104d.entry.js} +2 -2
  58. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  59. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  60. package/dist/types/common/channel.d.ts +30 -0
  61. package/dist/types/common/fetch.d.ts +167 -0
  62. package/dist/types/components/phirepass-downloader/form.d.ts +54 -0
  63. package/dist/types/components/phirepass-downloader/format.d.ts +17 -0
  64. package/dist/types/components/phirepass-downloader/jobs.d.ts +116 -0
  65. package/dist/types/components/phirepass-downloader/phirepass-downloader.d.ts +231 -0
  66. package/dist/types/components/phirepass-downloader/source.d.ts +61 -0
  67. package/dist/types/components/phirepass-downloader/views/dialogs.d.ts +52 -0
  68. package/dist/types/components/phirepass-downloader/views/fetch-form.d.ts +31 -0
  69. package/dist/types/components/phirepass-downloader/views/icons.d.ts +5 -0
  70. package/dist/types/components/phirepass-downloader/views/job-row.d.ts +21 -0
  71. package/dist/types/components/phirepass-downloader/views/notices.d.ts +18 -0
  72. package/dist/types/components/phirepass-downloader/views/states.d.ts +38 -0
  73. package/dist/types/components/phirepass-media-player/phirepass-media-player.d.ts +67 -0
  74. package/dist/types/components/phirepass-media-player/player.d.ts +43 -0
  75. package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +10 -0
  76. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +30 -0
  77. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.fetch.d.ts +40 -0
  78. package/dist/types/components.d.ts +426 -34
  79. package/dist/types/stencil-public-runtime.d.ts +1 -1
  80. package/dist/types/testing/fixtures.d.ts +25 -0
  81. package/dist/types/testing/mock-channel.d.ts +132 -0
  82. package/package.json +26 -12
  83. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +0 -1469
  84. package/dist/cjs/protocol-COvteaUJ.js +0 -1044
  85. package/dist/components/p-Dur4cBX7.js +0 -1
  86. package/dist/esm/phirepass-sftp-client.entry.js +0 -1467
  87. package/dist/esm/protocol-Dur4cBX7.js +0 -1039
  88. package/dist/phirepass-widgets/p-8eb3ec24.entry.js +0 -1
  89. package/dist/phirepass-widgets/p-9a1f9b9f.entry.js +0 -1
  90. package/dist/phirepass-widgets/p-DGq2b7rM.js +0 -3
  91. package/dist/phirepass-widgets/p-Dur4cBX7.js +0 -1
@@ -0,0 +1,1472 @@
1
+ 'use strict';
2
+
3
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
4
+ /* @ts-self-types="./phirepass-channel.d.ts" */
5
+
6
+ class Channel {
7
+ __destroy_into_raw() {
8
+ const ptr = this.__wbg_ptr;
9
+ this.__wbg_ptr = 0;
10
+ ChannelFinalization.unregister(this);
11
+ return ptr;
12
+ }
13
+ free() {
14
+ const ptr = this.__destroy_into_raw();
15
+ wasm.__wbg_channel_free(ptr, 0);
16
+ }
17
+ /**
18
+ * @param {string} token
19
+ * @param {string} node_id
20
+ * @param {number | null} [msg_id]
21
+ */
22
+ authenticate(token, node_id, msg_id) {
23
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
24
+ let ptr0, len0, ptr1, len1;
25
+ try {
26
+ ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
27
+ len0 = WASM_VECTOR_LEN;
28
+ ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
29
+ len1 = WASM_VECTOR_LEN;
30
+ } catch (e) {
31
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
32
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
33
+ throw e;
34
+ }
35
+ wasm.channel_authenticate(this.__wbg_ptr, ptr0, len0, ptr1, len1, val3);
36
+ }
37
+ connect() {
38
+ wasm.channel_connect(this.__wbg_ptr);
39
+ }
40
+ /**
41
+ * @param {string} node_id
42
+ * @param {string} kind
43
+ * @param {string | null | undefined} name
44
+ * @param {string} host
45
+ * @param {number} port
46
+ * @param {string | null} [username]
47
+ * @param {string | null} [password]
48
+ * @param {string | null} [scheme]
49
+ * @param {number | null} [msg_id]
50
+ */
51
+ create_service(node_id, kind, name, host, port, username, password, scheme, msg_id) {
52
+ const val8 = +port;
53
+ const val9 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
54
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6;
55
+ try {
56
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
57
+ len0 = WASM_VECTOR_LEN;
58
+ ptr1 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
59
+ len1 = WASM_VECTOR_LEN;
60
+ ptr2 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
61
+ len2 = WASM_VECTOR_LEN;
62
+ ptr3 = passStringToWasm0(host, wasm.__wbindgen_export, wasm.__wbindgen_export2);
63
+ len3 = WASM_VECTOR_LEN;
64
+ ptr4 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
65
+ len4 = WASM_VECTOR_LEN;
66
+ ptr5 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
67
+ len5 = WASM_VECTOR_LEN;
68
+ ptr6 = isLikeNone(scheme) ? 0 : passStringToWasm0(scheme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
69
+ len6 = WASM_VECTOR_LEN;
70
+ } catch (e) {
71
+ if (ptr6) { wasm.__wbindgen_export3(ptr6, len6 * 1, 1); }
72
+ if (ptr5) { wasm.__wbindgen_export3(ptr5, len5 * 1, 1); }
73
+ if (ptr4) { wasm.__wbindgen_export3(ptr4, len4 * 1, 1); }
74
+ if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
75
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
76
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
77
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
78
+ throw e;
79
+ }
80
+ wasm.channel_create_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val8, ptr4, len4, ptr5, len5, ptr6, len6, val9);
81
+ }
82
+ /**
83
+ * @param {string} node_id
84
+ * @param {string} id
85
+ * @param {number | null} [msg_id]
86
+ */
87
+ delete_service(node_id, id, msg_id) {
88
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
89
+ let ptr0, len0, ptr1, len1;
90
+ try {
91
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
92
+ len0 = WASM_VECTOR_LEN;
93
+ ptr1 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
94
+ len1 = WASM_VECTOR_LEN;
95
+ } catch (e) {
96
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
97
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
98
+ throw e;
99
+ }
100
+ wasm.channel_delete_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, val3);
101
+ }
102
+ disconnect() {
103
+ wasm.channel_disconnect(this.__wbg_ptr);
104
+ }
105
+ /**
106
+ * @returns {boolean}
107
+ */
108
+ is_connected() {
109
+ const ret = wasm.channel_is_connected(this.__wbg_ptr);
110
+ return ret !== 0;
111
+ }
112
+ /**
113
+ * @returns {boolean}
114
+ */
115
+ is_disconnected() {
116
+ const ret = wasm.channel_is_disconnected(this.__wbg_ptr);
117
+ return ret !== 0;
118
+ }
119
+ /**
120
+ * @param {string} endpoint
121
+ * @param {string} node_id
122
+ * @param {string | null} [server_id]
123
+ */
124
+ constructor(endpoint, node_id, server_id) {
125
+ let ptr0, len0, ptr1, len1, ptr2, len2;
126
+ try {
127
+ ptr0 = passStringToWasm0(endpoint, wasm.__wbindgen_export, wasm.__wbindgen_export2);
128
+ len0 = WASM_VECTOR_LEN;
129
+ ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
130
+ len1 = WASM_VECTOR_LEN;
131
+ ptr2 = isLikeNone(server_id) ? 0 : passStringToWasm0(server_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
132
+ len2 = WASM_VECTOR_LEN;
133
+ } catch (e) {
134
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
135
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
136
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
137
+ throw e;
138
+ }
139
+ const ret = wasm.channel_new(ptr0, len0, ptr1, len1, ptr2, len2);
140
+ this.__wbg_ptr = ret;
141
+ ChannelFinalization.register(this, this.__wbg_ptr, this);
142
+ return this;
143
+ }
144
+ /**
145
+ * @param {Function | null} [cb]
146
+ */
147
+ on_connection_close(cb) {
148
+ wasm.channel_on_connection_close(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
149
+ }
150
+ /**
151
+ * @param {Function | null} [cb]
152
+ */
153
+ on_connection_error(cb) {
154
+ wasm.channel_on_connection_error(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
155
+ }
156
+ /**
157
+ * @param {Function | null} [cb]
158
+ */
159
+ on_connection_message(cb) {
160
+ wasm.channel_on_connection_message(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
161
+ }
162
+ /**
163
+ * @param {Function | null} [cb]
164
+ */
165
+ on_connection_open(cb) {
166
+ wasm.channel_on_connection_open(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
167
+ }
168
+ /**
169
+ * @param {Function | null} [cb]
170
+ */
171
+ on_protocol_message(cb) {
172
+ wasm.channel_on_protocol_message(this.__wbg_ptr, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
173
+ }
174
+ /**
175
+ * @param {string} frame_type
176
+ * @param {Function | null} [cb]
177
+ */
178
+ on_protocol_message_type(frame_type, cb) {
179
+ const ptr0 = passStringToWasm0(frame_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
180
+ const len0 = WASM_VECTOR_LEN;
181
+ wasm.channel_on_protocol_message_type(this.__wbg_ptr, ptr0, len0, isLikeNone(cb) ? 0 : addToExternrefTable0(cb));
182
+ }
183
+ /**
184
+ * Requests an RDP tunnel. Credentials are validated by the agent but are
185
+ * not used to log in: CredSSP runs in the browser's own RDP client, inside
186
+ * the tunnel.
187
+ *
188
+ * Unlike the other protocols this does **not** yield a `TunnelOpened`.
189
+ * The answer is an `RDPAuthorized` frame carrying a `sid` and a single-use
190
+ * `ticket`; the RDP client then opens its own socket at
191
+ * `/api/web/rdp/{node_id}` and presents that ticket in its RDCleanPath
192
+ * request. No tunnel data for an RDP session ever crosses *this* channel.
193
+ * @param {string} node_id
194
+ * @param {string} service_id
195
+ * @param {string | null} [username]
196
+ * @param {string | null} [password]
197
+ * @param {number | null} [msg_id]
198
+ */
199
+ open_rdp_tunnel(node_id, service_id, username, password, msg_id) {
200
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
201
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
202
+ try {
203
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
204
+ len0 = WASM_VECTOR_LEN;
205
+ ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
206
+ len1 = WASM_VECTOR_LEN;
207
+ ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
208
+ len2 = WASM_VECTOR_LEN;
209
+ ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
210
+ len3 = WASM_VECTOR_LEN;
211
+ } catch (e) {
212
+ if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
213
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
214
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
215
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
216
+ throw e;
217
+ }
218
+ wasm.channel_open_rdp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5);
219
+ }
220
+ /**
221
+ * @param {string} node_id
222
+ * @param {string} service_id
223
+ * @param {string | null} [username]
224
+ * @param {string | null} [password]
225
+ * @param {number | null} [msg_id]
226
+ */
227
+ open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
228
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
229
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
230
+ try {
231
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
232
+ len0 = WASM_VECTOR_LEN;
233
+ ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
234
+ len1 = WASM_VECTOR_LEN;
235
+ ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
236
+ len2 = WASM_VECTOR_LEN;
237
+ ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
238
+ len3 = WASM_VECTOR_LEN;
239
+ } catch (e) {
240
+ if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
241
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
242
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
243
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
244
+ throw e;
245
+ }
246
+ wasm.channel_open_sftp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5);
247
+ }
248
+ /**
249
+ * @param {string} node_id
250
+ * @param {string} service_id
251
+ * @param {string | null} [username]
252
+ * @param {string | null} [password]
253
+ * @param {number | null} [msg_id]
254
+ */
255
+ open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
256
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
257
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
258
+ try {
259
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
260
+ len0 = WASM_VECTOR_LEN;
261
+ ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
262
+ len1 = WASM_VECTOR_LEN;
263
+ ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
264
+ len2 = WASM_VECTOR_LEN;
265
+ ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
266
+ len3 = WASM_VECTOR_LEN;
267
+ } catch (e) {
268
+ if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
269
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
270
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
271
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
272
+ throw e;
273
+ }
274
+ wasm.channel_open_ssh_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, val5);
275
+ }
276
+ /**
277
+ * @param {string} download_id
278
+ * @param {boolean} delete_file
279
+ * @param {number | null} [msg_id]
280
+ */
281
+ send_download_delete(download_id, delete_file, msg_id) {
282
+ const val2 = +delete_file;
283
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
284
+ const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
285
+ const len0 = WASM_VECTOR_LEN;
286
+ wasm.channel_send_download_delete(this.__wbg_ptr, ptr0, len0, val2, val3);
287
+ }
288
+ /**
289
+ * @param {string} download_id
290
+ * @param {boolean} ignore_window
291
+ * @param {number | null} [msg_id]
292
+ */
293
+ send_download_resume(download_id, ignore_window, msg_id) {
294
+ const val2 = +ignore_window;
295
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
296
+ const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
297
+ const len0 = WASM_VECTOR_LEN;
298
+ wasm.channel_send_download_resume(this.__wbg_ptr, ptr0, len0, val2, val3);
299
+ }
300
+ /**
301
+ * @param {string} download_id
302
+ * @param {boolean} in_order
303
+ * @param {number | null} [msg_id]
304
+ */
305
+ send_download_set_order(download_id, in_order, msg_id) {
306
+ const val2 = +in_order;
307
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
308
+ const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
309
+ const len0 = WASM_VECTOR_LEN;
310
+ wasm.channel_send_download_set_order(this.__wbg_ptr, ptr0, len0, val2, val3);
311
+ }
312
+ /**
313
+ * @param {string} node_id
314
+ * @param {number | null} [msg_id]
315
+ */
316
+ send_download_settings_get(node_id, msg_id) {
317
+ const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
318
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
319
+ const len0 = WASM_VECTOR_LEN;
320
+ wasm.channel_send_download_settings_get(this.__wbg_ptr, ptr0, len0, val2);
321
+ }
322
+ /**
323
+ * @param {string} node_id
324
+ * @param {any} settings
325
+ * @param {number | null} [msg_id]
326
+ */
327
+ send_download_settings_save(node_id, settings, msg_id) {
328
+ const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
329
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
330
+ const len0 = WASM_VECTOR_LEN;
331
+ wasm.channel_send_download_settings_save(this.__wbg_ptr, ptr0, len0, settings, val2);
332
+ }
333
+ /**
334
+ * @param {string} node_id
335
+ * @param {any} source
336
+ * @param {string | null | undefined} sub_dir
337
+ * @param {any} browsing
338
+ * @param {boolean | null | undefined} in_order
339
+ * @param {any} options
340
+ * @param {number | null} [msg_id]
341
+ */
342
+ send_download_start(node_id, source, sub_dir, browsing, in_order, options, msg_id) {
343
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
344
+ let ptr0, len0, ptr1, len1;
345
+ try {
346
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
347
+ len0 = WASM_VECTOR_LEN;
348
+ ptr1 = isLikeNone(sub_dir) ? 0 : passStringToWasm0(sub_dir, wasm.__wbindgen_export, wasm.__wbindgen_export2);
349
+ len1 = WASM_VECTOR_LEN;
350
+ } catch (e) {
351
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
352
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
353
+ throw e;
354
+ }
355
+ wasm.channel_send_download_start(this.__wbg_ptr, ptr0, len0, source, ptr1, len1, browsing, isLikeNone(in_order) ? 0xFFFFFF : in_order ? 1 : 0, options, val3);
356
+ }
357
+ /**
358
+ * @param {string} download_id
359
+ * @param {boolean} discard
360
+ * @param {number | null} [msg_id]
361
+ */
362
+ send_download_stop(download_id, discard, msg_id) {
363
+ const val2 = +discard;
364
+ const val3 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
365
+ const ptr0 = passStringToWasm0(download_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
366
+ const len0 = WASM_VECTOR_LEN;
367
+ wasm.channel_send_download_stop(this.__wbg_ptr, ptr0, len0, val2, val3);
368
+ }
369
+ /**
370
+ * `{ Node: "<uuid>" }` or `"All"`.
371
+ * @param {any} scope
372
+ */
373
+ send_download_subscribe(scope) {
374
+ wasm.channel_send_download_subscribe(this.__wbg_ptr, scope);
375
+ }
376
+ /**
377
+ * @param {string} node_id
378
+ * @param {any} browsing
379
+ * @param {number | null} [msg_id]
380
+ */
381
+ send_download_where(node_id, browsing, msg_id) {
382
+ const val2 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
383
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
384
+ const len0 = WASM_VECTOR_LEN;
385
+ wasm.channel_send_download_where(this.__wbg_ptr, ptr0, len0, browsing, val2);
386
+ }
387
+ /**
388
+ * Set permission bits. The agent masks these to `0o7777`.
389
+ * @param {string} node_id
390
+ * @param {number} sid
391
+ * @param {string} path
392
+ * @param {number} permissions
393
+ * @param {number | null} [msg_id]
394
+ */
395
+ send_sftp_chmod(node_id, sid, path, permissions, msg_id) {
396
+ const val3 = +sid;
397
+ const val4 = +permissions;
398
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
399
+ let ptr0, len0, ptr1, len1;
400
+ try {
401
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
402
+ len0 = WASM_VECTOR_LEN;
403
+ ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
404
+ len1 = WASM_VECTOR_LEN;
405
+ } catch (e) {
406
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
407
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
408
+ throw e;
409
+ }
410
+ wasm.channel_send_sftp_chmod(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4, val5);
411
+ }
412
+ /**
413
+ * @param {string} node_id
414
+ * @param {number} sid
415
+ * @param {string} path
416
+ * @param {string} filename
417
+ * @param {number | null} [msg_id]
418
+ */
419
+ send_sftp_delete(node_id, sid, path, filename, msg_id) {
420
+ const val4 = +sid;
421
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
422
+ let ptr0, len0, ptr1, len1, ptr2, len2;
423
+ try {
424
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
425
+ len0 = WASM_VECTOR_LEN;
426
+ ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
427
+ len1 = WASM_VECTOR_LEN;
428
+ ptr2 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
429
+ len2 = WASM_VECTOR_LEN;
430
+ } catch (e) {
431
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
432
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
433
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
434
+ throw e;
435
+ }
436
+ wasm.channel_send_sftp_delete(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5);
437
+ }
438
+ /**
439
+ * Send a pipelining ACK to the agent: acknowledges all chunks with index ≤ ack_up_to
440
+ * so the agent's sliding window advances, and it can push the next batch.
441
+ * Call this after processing each received SFTPDownloadChunk (or every N chunks).
442
+ * @param {string} node_id
443
+ * @param {number} sid
444
+ * @param {number} download_id
445
+ * @param {number} ack_up_to
446
+ */
447
+ send_sftp_download_ack(node_id, sid, download_id, ack_up_to) {
448
+ const val2 = +sid;
449
+ const val3 = +download_id;
450
+ const val4 = +ack_up_to;
451
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
452
+ const len0 = WASM_VECTOR_LEN;
453
+ wasm.channel_send_sftp_download_ack(this.__wbg_ptr, ptr0, len0, val2, val3, val4);
454
+ }
455
+ /**
456
+ * @param {string} node_id
457
+ * @param {number} sid
458
+ * @param {number} download_id
459
+ * @param {number} chunk_index
460
+ * @param {number | null} [msg_id]
461
+ */
462
+ send_sftp_download_chunk(node_id, sid, download_id, chunk_index, msg_id) {
463
+ const val2 = +sid;
464
+ const val3 = +download_id;
465
+ const val4 = +chunk_index;
466
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
467
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
468
+ const len0 = WASM_VECTOR_LEN;
469
+ wasm.channel_send_sftp_download_chunk(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5);
470
+ }
471
+ /**
472
+ * @param {string} node_id
473
+ * @param {number} sid
474
+ * @param {string} path
475
+ * @param {string} filename
476
+ * @param {number | null} [msg_id]
477
+ */
478
+ send_sftp_download_start(node_id, sid, path, filename, msg_id) {
479
+ const val4 = +sid;
480
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
481
+ let ptr0, len0, ptr1, len1, ptr2, len2;
482
+ try {
483
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
484
+ len0 = WASM_VECTOR_LEN;
485
+ ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
486
+ len1 = WASM_VECTOR_LEN;
487
+ ptr2 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
488
+ len2 = WASM_VECTOR_LEN;
489
+ } catch (e) {
490
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
491
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
492
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
493
+ throw e;
494
+ }
495
+ wasm.channel_send_sftp_download_start(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5);
496
+ }
497
+ /**
498
+ * @param {string} node_id
499
+ * @param {number} sid
500
+ * @param {string} path
501
+ * @param {number | null} [msg_id]
502
+ */
503
+ send_sftp_list_data(node_id, sid, path, msg_id) {
504
+ const val3 = +sid;
505
+ const val4 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
506
+ let ptr0, len0, ptr1, len1;
507
+ try {
508
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
509
+ len0 = WASM_VECTOR_LEN;
510
+ ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
511
+ len1 = WASM_VECTOR_LEN;
512
+ } catch (e) {
513
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
514
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
515
+ throw e;
516
+ }
517
+ wasm.channel_send_sftp_list_data(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4);
518
+ }
519
+ /**
520
+ * Create one directory. Parents must exist already, as with `mkdir`.
521
+ * @param {string} node_id
522
+ * @param {number} sid
523
+ * @param {string} path
524
+ * @param {number | null} [msg_id]
525
+ */
526
+ send_sftp_mkdir(node_id, sid, path, msg_id) {
527
+ const val3 = +sid;
528
+ const val4 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
529
+ let ptr0, len0, ptr1, len1;
530
+ try {
531
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
532
+ len0 = WASM_VECTOR_LEN;
533
+ ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
534
+ len1 = WASM_VECTOR_LEN;
535
+ } catch (e) {
536
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
537
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
538
+ throw e;
539
+ }
540
+ wasm.channel_send_sftp_mkdir(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4);
541
+ }
542
+ /**
543
+ * Read a whole file for the in-page editor. Answered with an
544
+ * `SFTPOpResult` carrying `FileContents`, or an `Error` if the file is
545
+ * above the agent's editor size limit.
546
+ * @param {string} node_id
547
+ * @param {number} sid
548
+ * @param {string} path
549
+ * @param {number | null} [msg_id]
550
+ */
551
+ send_sftp_read_file(node_id, sid, path, msg_id) {
552
+ const val3 = +sid;
553
+ const val4 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
554
+ let ptr0, len0, ptr1, len1;
555
+ try {
556
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
557
+ len0 = WASM_VECTOR_LEN;
558
+ ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
559
+ len1 = WASM_VECTOR_LEN;
560
+ } catch (e) {
561
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
562
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
563
+ throw e;
564
+ }
565
+ wasm.channel_send_sftp_read_file(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4);
566
+ }
567
+ /**
568
+ * Remove a file, a symlink, or a directory. Without `recursive` the remote
569
+ * refuses a directory that still has anything in it.
570
+ * @param {string} node_id
571
+ * @param {number} sid
572
+ * @param {string} path
573
+ * @param {boolean} recursive
574
+ * @param {number | null} [msg_id]
575
+ */
576
+ send_sftp_remove(node_id, sid, path, recursive, msg_id) {
577
+ const val3 = +sid;
578
+ const val4 = +recursive;
579
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
580
+ let ptr0, len0, ptr1, len1;
581
+ try {
582
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
583
+ len0 = WASM_VECTOR_LEN;
584
+ ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
585
+ len1 = WASM_VECTOR_LEN;
586
+ } catch (e) {
587
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
588
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
589
+ throw e;
590
+ }
591
+ wasm.channel_send_sftp_remove(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1, val4, val5);
592
+ }
593
+ /**
594
+ * Rename or move. `to` is a full path, so one call covers both.
595
+ * @param {string} node_id
596
+ * @param {number} sid
597
+ * @param {string} from
598
+ * @param {string} to
599
+ * @param {number | null} [msg_id]
600
+ */
601
+ send_sftp_rename(node_id, sid, from, to, msg_id) {
602
+ const val4 = +sid;
603
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
604
+ let ptr0, len0, ptr1, len1, ptr2, len2;
605
+ try {
606
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
607
+ len0 = WASM_VECTOR_LEN;
608
+ ptr1 = passStringToWasm0(from, wasm.__wbindgen_export, wasm.__wbindgen_export2);
609
+ len1 = WASM_VECTOR_LEN;
610
+ ptr2 = passStringToWasm0(to, wasm.__wbindgen_export, wasm.__wbindgen_export2);
611
+ len2 = WASM_VECTOR_LEN;
612
+ } catch (e) {
613
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
614
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
615
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
616
+ throw e;
617
+ }
618
+ wasm.channel_send_sftp_rename(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5);
619
+ }
620
+ /**
621
+ * @param {string} node_id
622
+ * @param {number} sid
623
+ * @param {number} upload_id
624
+ * @param {number} chunk_index
625
+ * @param {number} chunk_size
626
+ * @param {Uint8Array | number[]} data
627
+ * @param {number | null} [msg_id]
628
+ */
629
+ send_sftp_upload_chunk(node_id, sid, upload_id, chunk_index, chunk_size, data, msg_id) {
630
+ const val3 = +sid;
631
+ const val4 = +upload_id;
632
+ const val5 = +chunk_index;
633
+ const val6 = +chunk_size;
634
+ const val7 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
635
+ let ptr0, len0, ptr1, len1;
636
+ try {
637
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
638
+ len0 = WASM_VECTOR_LEN;
639
+ ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
640
+ len1 = WASM_VECTOR_LEN;
641
+ } catch (e) {
642
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
643
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
644
+ throw e;
645
+ }
646
+ wasm.channel_send_sftp_upload_chunk(this.__wbg_ptr, ptr0, len0, val3, val4, val5, val6, ptr1, len1, val7);
647
+ }
648
+ /**
649
+ * @param {string} node_id
650
+ * @param {number} sid
651
+ * @param {string} filename
652
+ * @param {string} remote_path
653
+ * @param {number} total_chunks
654
+ * @param {bigint} total_size
655
+ * @param {number | null} [msg_id]
656
+ */
657
+ send_sftp_upload_start(node_id, sid, filename, remote_path, total_chunks, total_size, msg_id) {
658
+ const val4 = +sid;
659
+ const val5 = +total_chunks;
660
+ const val6 = BigInt.asIntN(64, total_size);
661
+ const val7 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
662
+ let ptr0, len0, ptr1, len1, ptr2, len2;
663
+ try {
664
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
665
+ len0 = WASM_VECTOR_LEN;
666
+ ptr1 = passStringToWasm0(filename, wasm.__wbindgen_export, wasm.__wbindgen_export2);
667
+ len1 = WASM_VECTOR_LEN;
668
+ ptr2 = passStringToWasm0(remote_path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
669
+ len2 = WASM_VECTOR_LEN;
670
+ } catch (e) {
671
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
672
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
673
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
674
+ throw e;
675
+ }
676
+ wasm.channel_send_sftp_upload_start(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5, val6, val7);
677
+ }
678
+ /**
679
+ * Write a whole file back, truncating whatever was there.
680
+ * @param {string} node_id
681
+ * @param {number} sid
682
+ * @param {string} path
683
+ * @param {Uint8Array | number[]} contents
684
+ * @param {number | null} [msg_id]
685
+ */
686
+ send_sftp_write_file(node_id, sid, path, contents, msg_id) {
687
+ const val4 = +sid;
688
+ const val5 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
689
+ let ptr0, len0, ptr1, len1, ptr2, len2;
690
+ try {
691
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
692
+ len0 = WASM_VECTOR_LEN;
693
+ ptr1 = passStringToWasm0(path, wasm.__wbindgen_export, wasm.__wbindgen_export2);
694
+ len1 = WASM_VECTOR_LEN;
695
+ ptr2 = passArray8ToWasm0(contents, wasm.__wbindgen_export);
696
+ len2 = WASM_VECTOR_LEN;
697
+ } catch (e) {
698
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
699
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
700
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
701
+ throw e;
702
+ }
703
+ wasm.channel_send_sftp_write_file(this.__wbg_ptr, ptr0, len0, val4, ptr1, len1, ptr2, len2, val5);
704
+ }
705
+ /**
706
+ * @param {string} node_id
707
+ * @param {number} sid
708
+ * @param {number} cols
709
+ * @param {number} rows
710
+ * @param {number} px_width
711
+ * @param {number} px_height
712
+ */
713
+ send_ssh_terminal_resize(node_id, sid, cols, rows, px_width, px_height) {
714
+ const val2 = +sid;
715
+ const val3 = +cols;
716
+ const val4 = +rows;
717
+ const val5 = +px_width;
718
+ const val6 = +px_height;
719
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
720
+ const len0 = WASM_VECTOR_LEN;
721
+ wasm.channel_send_ssh_terminal_resize(this.__wbg_ptr, ptr0, len0, val2, val3, val4, val5, val6);
722
+ }
723
+ /**
724
+ * @param {string} node_id
725
+ * @param {number} sid
726
+ * @param {string} data
727
+ */
728
+ send_ssh_tunnel_data(node_id, sid, data) {
729
+ const val3 = +sid;
730
+ let ptr0, len0, ptr1, len1;
731
+ try {
732
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
733
+ len0 = WASM_VECTOR_LEN;
734
+ ptr1 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
735
+ len1 = WASM_VECTOR_LEN;
736
+ } catch (e) {
737
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
738
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
739
+ throw e;
740
+ }
741
+ wasm.channel_send_ssh_tunnel_data(this.__wbg_ptr, ptr0, len0, val3, ptr1, len1);
742
+ }
743
+ /**
744
+ * @param {number} interval_as_millis
745
+ */
746
+ start_heartbeat(interval_as_millis) {
747
+ wasm.channel_start_heartbeat(this.__wbg_ptr, interval_as_millis);
748
+ }
749
+ stop_heartbeat() {
750
+ wasm.channel_stop_heartbeat(this.__wbg_ptr);
751
+ }
752
+ /**
753
+ * @param {string} node_id
754
+ * @param {string} service_id
755
+ * @param {string} kind
756
+ * @param {string | null | undefined} name
757
+ * @param {string} host
758
+ * @param {number} port
759
+ * @param {string | null} [username]
760
+ * @param {string | null} [password]
761
+ * @param {string | null} [scheme]
762
+ * @param {number | null} [msg_id]
763
+ */
764
+ update_service(node_id, service_id, kind, name, host, port, username, password, scheme, msg_id) {
765
+ const val9 = +port;
766
+ const val10 = +(isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
767
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7;
768
+ try {
769
+ ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
770
+ len0 = WASM_VECTOR_LEN;
771
+ ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
772
+ len1 = WASM_VECTOR_LEN;
773
+ ptr2 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
774
+ len2 = WASM_VECTOR_LEN;
775
+ ptr3 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
776
+ len3 = WASM_VECTOR_LEN;
777
+ ptr4 = passStringToWasm0(host, wasm.__wbindgen_export, wasm.__wbindgen_export2);
778
+ len4 = WASM_VECTOR_LEN;
779
+ ptr5 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
780
+ len5 = WASM_VECTOR_LEN;
781
+ ptr6 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
782
+ len6 = WASM_VECTOR_LEN;
783
+ ptr7 = isLikeNone(scheme) ? 0 : passStringToWasm0(scheme, wasm.__wbindgen_export, wasm.__wbindgen_export2);
784
+ len7 = WASM_VECTOR_LEN;
785
+ } catch (e) {
786
+ if (ptr7) { wasm.__wbindgen_export3(ptr7, len7 * 1, 1); }
787
+ if (ptr6) { wasm.__wbindgen_export3(ptr6, len6 * 1, 1); }
788
+ if (ptr5) { wasm.__wbindgen_export3(ptr5, len5 * 1, 1); }
789
+ if (ptr4) { wasm.__wbindgen_export3(ptr4, len4 * 1, 1); }
790
+ if (ptr3) { wasm.__wbindgen_export3(ptr3, len3 * 1, 1); }
791
+ if (ptr2) { wasm.__wbindgen_export3(ptr2, len2 * 1, 1); }
792
+ if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
793
+ if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
794
+ throw e;
795
+ }
796
+ wasm.channel_update_service(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, val9, ptr5, len5, ptr6, len6, ptr7, len7, val10);
797
+ }
798
+ }
799
+ if (Symbol.dispose) Channel.prototype[Symbol.dispose] = Channel.prototype.free;
800
+
801
+ /**
802
+ * @enum {0 | 10 | 100 | 110 | 120}
803
+ */
804
+ const ErrorType = Object.freeze({
805
+ Generic: 0, "0": "Generic",
806
+ Authentication: 10, "10": "Authentication",
807
+ RequiresUsername: 100, "100": "RequiresUsername",
808
+ RequiresPassword: 110, "110": "RequiresPassword",
809
+ RequiresUsernamePassword: 120, "120": "RequiresUsernamePassword",
810
+ });
811
+ function __wbg_get_imports() {
812
+ const import0 = {
813
+ __proto__: null,
814
+ __wbg_Error_208446807d0d1e30: function(arg0, arg1) {
815
+ const ret = Error(getStringFromWasm0(arg0, arg1));
816
+ return ret;
817
+ },
818
+ __wbg_Number_ff192a72a0dcdf6d: function(arg0) {
819
+ const ret = Number(arg0);
820
+ return ret;
821
+ },
822
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
823
+ const ret = String(arg1);
824
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
825
+ const len1 = WASM_VECTOR_LEN;
826
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
827
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
828
+ },
829
+ __wbg___wbindgen_bigint_get_as_i64_11da4b52cd0aedef: function(arg0, arg1) {
830
+ const v = arg1;
831
+ const ret = typeof(v) === 'bigint' ? v : undefined;
832
+ getDataViewMemory0().setBigInt64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
833
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
834
+ },
835
+ __wbg___wbindgen_boolean_get_4f1baf9a00be3c74: function(arg0) {
836
+ const v = arg0;
837
+ const ret = typeof(v) === 'boolean' ? v : undefined;
838
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
839
+ },
840
+ __wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
841
+ const ret = debugString(arg1);
842
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
843
+ const len1 = WASM_VECTOR_LEN;
844
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
845
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
846
+ },
847
+ __wbg___wbindgen_in_3f58a9d3b3a7eed2: function(arg0, arg1) {
848
+ const ret = arg0 in arg1;
849
+ return ret;
850
+ },
851
+ __wbg___wbindgen_is_bigint_5fa10641e039d3ef: function(arg0) {
852
+ const ret = typeof(arg0) === 'bigint';
853
+ return ret;
854
+ },
855
+ __wbg___wbindgen_is_function_741ff2bb612836f5: function(arg0) {
856
+ const ret = typeof(arg0) === 'function';
857
+ return ret;
858
+ },
859
+ __wbg___wbindgen_is_null_c22311b1cc228e3a: function(arg0) {
860
+ const ret = arg0 === null;
861
+ return ret;
862
+ },
863
+ __wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
864
+ const val = arg0;
865
+ const ret = typeof(val) === 'object' && val !== null;
866
+ return ret;
867
+ },
868
+ __wbg___wbindgen_is_string_fc456fee5d3317de: function(arg0) {
869
+ const ret = typeof(arg0) === 'string';
870
+ return ret;
871
+ },
872
+ __wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
873
+ const ret = arg0 === undefined;
874
+ return ret;
875
+ },
876
+ __wbg___wbindgen_jsval_eq_38d7bfbe4cc84039: function(arg0, arg1) {
877
+ const ret = arg0 === arg1;
878
+ return ret;
879
+ },
880
+ __wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36: function(arg0, arg1) {
881
+ const ret = arg0 == arg1;
882
+ return ret;
883
+ },
884
+ __wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
885
+ const obj = arg1;
886
+ const ret = typeof(obj) === 'number' ? obj : undefined;
887
+ getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
888
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
889
+ },
890
+ __wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
891
+ const obj = arg1;
892
+ const ret = typeof(obj) === 'string' ? obj : undefined;
893
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
894
+ var len1 = WASM_VECTOR_LEN;
895
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
896
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
897
+ },
898
+ __wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
899
+ throw new Error(getStringFromWasm0(arg0, arg1));
900
+ },
901
+ __wbg__wbg_cb_unref_09736879a3f67559: function(arg0) {
902
+ arg0._wbg_cb_unref();
903
+ },
904
+ __wbg_call_40b008ba32f73991: function() { return handleError(function (arg0, arg1) {
905
+ const ret = arg0.call(arg1);
906
+ return ret;
907
+ }, arguments); },
908
+ __wbg_call_a410eb4b59ed5965: function() { return handleError(function (arg0, arg1, arg2) {
909
+ const ret = arg0.call(arg1, arg2);
910
+ return ret;
911
+ }, arguments); },
912
+ __wbg_call_fc92fee6137d452d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
913
+ const ret = arg0.call(arg1, arg2, arg3);
914
+ return ret;
915
+ }, arguments); },
916
+ __wbg_clearInterval_2ed00e80b9bdc143: function(arg0) {
917
+ const ret = clearInterval(arg0);
918
+ return ret;
919
+ },
920
+ __wbg_close_5ee9c5fe4e8754a4: function() { return handleError(function (arg0) {
921
+ arg0.close();
922
+ }, arguments); },
923
+ __wbg_data_c7e5e8500f1bca2f: function(arg0) {
924
+ const ret = arg0.data;
925
+ return ret;
926
+ },
927
+ __wbg_done_57e08d0be6e30c02: function(arg0) {
928
+ const ret = arg0.done;
929
+ return ret;
930
+ },
931
+ __wbg_entries_7bb1459bd9b5c2b9: function(arg0) {
932
+ const ret = Object.entries(arg0);
933
+ return ret;
934
+ },
935
+ __wbg_from_eac91875c8a5ffa4: function(arg0) {
936
+ const ret = Array.from(arg0);
937
+ return ret;
938
+ },
939
+ __wbg_getRandomValues_5d8c030b527203a6: function() { return handleError(function (arg0, arg1) {
940
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
941
+ }, arguments); },
942
+ __wbg_get_2080c49015e35254: function() { return handleError(function (arg0, arg1) {
943
+ const ret = Reflect.get(arg0, arg1);
944
+ return ret;
945
+ }, arguments); },
946
+ __wbg_get_635eea311fa1a291: function() { return handleError(function (arg0, arg1) {
947
+ const ret = Reflect.get(arg0, arg1);
948
+ return ret;
949
+ }, arguments); },
950
+ __wbg_get_d7176cfb76d71114: function(arg0, arg1) {
951
+ const ret = arg0[arg1 >>> 0];
952
+ return ret;
953
+ },
954
+ __wbg_get_unchecked_e6325ad374eff861: function(arg0, arg1) {
955
+ const ret = arg0[arg1 >>> 0];
956
+ return ret;
957
+ },
958
+ __wbg_get_with_ref_key_fc601247060b7204: function(arg0, arg1) {
959
+ const ret = arg0[arg1];
960
+ return ret;
961
+ },
962
+ __wbg_info_b0bac022aae81d46: function(arg0, arg1) {
963
+ console.info(getStringFromWasm0(arg0, arg1));
964
+ },
965
+ __wbg_instanceof_ArrayBuffer_12cdaa4161423e6b: function(arg0) {
966
+ let result;
967
+ try {
968
+ result = arg0 instanceof ArrayBuffer;
969
+ } catch (_) {
970
+ result = false;
971
+ }
972
+ const ret = result;
973
+ return ret;
974
+ },
975
+ __wbg_instanceof_Uint8Array_d7aeb0dcb3108fea: function(arg0) {
976
+ let result;
977
+ try {
978
+ result = arg0 instanceof Uint8Array;
979
+ } catch (_) {
980
+ result = false;
981
+ }
982
+ const ret = result;
983
+ return ret;
984
+ },
985
+ __wbg_isArray_bcf1376d0d732d08: function(arg0) {
986
+ const ret = Array.isArray(arg0);
987
+ return ret;
988
+ },
989
+ __wbg_isSafeInteger_1a35ba4d31e71d38: function(arg0) {
990
+ const ret = Number.isSafeInteger(arg0);
991
+ return ret;
992
+ },
993
+ __wbg_iterator_e4c5e8f68ada7b58: function() {
994
+ const ret = Symbol.iterator;
995
+ return ret;
996
+ },
997
+ __wbg_length_186163212ffe79c3: function(arg0) {
998
+ const ret = arg0.length;
999
+ return ret;
1000
+ },
1001
+ __wbg_length_b03a0fabb109b1e9: function(arg0) {
1002
+ const ret = arg0.length;
1003
+ return ret;
1004
+ },
1005
+ __wbg_new_13de428334042d26: function(arg0) {
1006
+ const ret = new Uint8Array(arg0);
1007
+ return ret;
1008
+ },
1009
+ __wbg_new_37eb45aaf5eeb820: function() {
1010
+ const ret = new Array();
1011
+ return ret;
1012
+ },
1013
+ __wbg_new_cd4348290afae586: function() {
1014
+ const ret = new Object();
1015
+ return ret;
1016
+ },
1017
+ __wbg_new_with_str_sequence_75b26d88172889d0: function() { return handleError(function (arg0, arg1, arg2) {
1018
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
1019
+ return ret;
1020
+ }, arguments); },
1021
+ __wbg_next_178c1651c11432b3: function(arg0) {
1022
+ const ret = arg0.next;
1023
+ return ret;
1024
+ },
1025
+ __wbg_next_af5ac6a08bb0a717: function() { return handleError(function (arg0) {
1026
+ const ret = arg0.next();
1027
+ return ret;
1028
+ }, arguments); },
1029
+ __wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
1030
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1031
+ },
1032
+ __wbg_push_c9f4893fc209f768: function(arg0, arg1) {
1033
+ const ret = arg0.push(arg1);
1034
+ return ret;
1035
+ },
1036
+ __wbg_readyState_039bc047141a5f6d: function(arg0) {
1037
+ const ret = arg0.readyState;
1038
+ return ret;
1039
+ },
1040
+ __wbg_send_d83d0891cf698779: function() { return handleError(function (arg0, arg1, arg2) {
1041
+ arg0.send(getArrayU8FromWasm0(arg1, arg2));
1042
+ }, arguments); },
1043
+ __wbg_setInterval_ef738bbfe8cc0974: function() { return handleError(function (arg0, arg1) {
1044
+ const ret = setInterval(arg0, arg1);
1045
+ return ret;
1046
+ }, arguments); },
1047
+ __wbg_set_binaryType_d5b4dafd0f127fb2: function(arg0, arg1) {
1048
+ arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1049
+ },
1050
+ __wbg_set_d2d33b52458e984a: function(arg0, arg1, arg2) {
1051
+ arg0[arg1 >>> 0] = arg2;
1052
+ },
1053
+ __wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
1054
+ arg0[arg1] = arg2;
1055
+ },
1056
+ __wbg_set_onclose_078935cf8d0fb024: function(arg0, arg1) {
1057
+ arg0.onclose = arg1;
1058
+ },
1059
+ __wbg_set_onerror_f7f089f7f059501c: function(arg0, arg1) {
1060
+ arg0.onerror = arg1;
1061
+ },
1062
+ __wbg_set_onmessage_26abc49cfa5f9ffc: function(arg0, arg1) {
1063
+ arg0.onmessage = arg1;
1064
+ },
1065
+ __wbg_set_onopen_757be120cc7b1ea6: function(arg0, arg1) {
1066
+ arg0.onopen = arg1;
1067
+ },
1068
+ __wbg_value_e0f328965e184931: function(arg0) {
1069
+ const ret = arg0.value;
1070
+ return ret;
1071
+ },
1072
+ __wbg_warn_95c497419b251cd5: function(arg0, arg1) {
1073
+ console.warn(getStringFromWasm0(arg0, arg1));
1074
+ },
1075
+ __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1076
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1077
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96);
1078
+ return ret;
1079
+ },
1080
+ __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1081
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1082
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96_46);
1083
+ return ret;
1084
+ },
1085
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1086
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 3, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1087
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_96_47);
1088
+ return ret;
1089
+ },
1090
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
1091
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 7, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1092
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_100);
1093
+ return ret;
1094
+ },
1095
+ __wbindgen_generic_0000000000000005: function(arg0) {
1096
+ // Cast intrinsic for `F64 -> Externref`.
1097
+ const ret = arg0;
1098
+ return ret;
1099
+ },
1100
+ __wbindgen_generic_0000000000000006: function(arg0, arg1) {
1101
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1102
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1103
+ return ret;
1104
+ },
1105
+ __wbindgen_generic_0000000000000007: function(arg0, arg1) {
1106
+ // Cast intrinsic for `Ref(String) -> Externref`.
1107
+ const ret = getStringFromWasm0(arg0, arg1);
1108
+ return ret;
1109
+ },
1110
+ __wbindgen_generic_0000000000000008: function(arg0) {
1111
+ // Cast intrinsic for `U64 -> Externref`.
1112
+ const ret = BigInt.asUintN(64, arg0);
1113
+ return ret;
1114
+ },
1115
+ __wbindgen_init_externref_table: function() {
1116
+ const table = wasm.__wbindgen_externrefs;
1117
+ table.set(0, undefined);
1118
+ table.set(1024, undefined);
1119
+ table.set(1025, null);
1120
+ table.set(1026, true);
1121
+ table.set(1027, false);
1122
+ },
1123
+ };
1124
+ return {
1125
+ __proto__: null,
1126
+ "./phirepass-channel_bg.js": import0,
1127
+ };
1128
+ }
1129
+
1130
+ function __wasm_bindgen_func_elem_100(arg0, arg1) {
1131
+ wasm.__wasm_bindgen_func_elem_100(arg0, arg1);
1132
+ }
1133
+
1134
+ function __wasm_bindgen_func_elem_96(arg0, arg1, arg2) {
1135
+ wasm.__wasm_bindgen_func_elem_96(arg0, arg1, arg2);
1136
+ }
1137
+
1138
+ function __wasm_bindgen_func_elem_96_46(arg0, arg1, arg2) {
1139
+ wasm.__wasm_bindgen_func_elem_96_46(arg0, arg1, arg2);
1140
+ }
1141
+
1142
+ function __wasm_bindgen_func_elem_96_47(arg0, arg1, arg2) {
1143
+ wasm.__wasm_bindgen_func_elem_96_47(arg0, arg1, arg2);
1144
+ }
1145
+
1146
+
1147
+ const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
1148
+ const ChannelFinalization = (typeof FinalizationRegistry === 'undefined')
1149
+ ? { register: () => {}, unregister: () => {} }
1150
+ : new FinalizationRegistry(ptr => wasm.__wbg_channel_free(ptr, 1));
1151
+
1152
+ function addToExternrefTable0(obj) {
1153
+ const idx = wasm.__wbindgen_export5();
1154
+ wasm.__wbindgen_externrefs.set(idx, obj);
1155
+ return idx;
1156
+ }
1157
+
1158
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1159
+ ? { register: () => {}, unregister: () => {} }
1160
+ : new FinalizationRegistry(state => wasm.__wbindgen_export6(state.a, state.b));
1161
+
1162
+ function debugString(val) {
1163
+ switch (typeof val) {
1164
+ // primitive types
1165
+ case 'number':
1166
+ case 'boolean':
1167
+ case 'undefined':
1168
+ return `${val}`;
1169
+ case 'string':
1170
+ return JSON.stringify(val);
1171
+ case 'bigint':
1172
+ return `${val}n`;
1173
+ case 'symbol':
1174
+ return val.description !== undefined
1175
+ ? `Symbol(${val.description})`
1176
+ : 'Symbol';
1177
+ case 'function':
1178
+ return typeof val.name === 'string' && val.name !== ''
1179
+ ? `Function(${val.name})`
1180
+ : 'Function';
1181
+ case 'object': {
1182
+ if (val === null) {
1183
+ return 'null';
1184
+ }
1185
+ // objects
1186
+ if (Array.isArray(val)) {
1187
+ return '[' + Array.from(val, debugString).join(', ') + ']';
1188
+ }
1189
+ // errors
1190
+ if (val instanceof Error) {
1191
+ return `${val.name}: ${val.message}\n${val.stack}`;
1192
+ }
1193
+
1194
+ const toStringOutput = toString.call(val);
1195
+ // Test for built-in
1196
+ const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
1197
+
1198
+ // Failed to match the standard '[object ClassName]'
1199
+ if (className === undefined) {
1200
+ return toStringOutput;
1201
+ }
1202
+ if (className === 'Object') {
1203
+ // we're a user defined class or Object
1204
+ // JSON.stringify avoids problems with cycles, and is generally much
1205
+ // easier than looping through ownProperties of `val`.
1206
+ try {
1207
+ return 'Object(' + JSON.stringify(val) + ')';
1208
+ } catch (_) {
1209
+ return 'Object';
1210
+ }
1211
+ }
1212
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1213
+ return className;
1214
+ }
1215
+ // Per MDN: 'This list of values is exhaustive.'
1216
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
1217
+ }
1218
+ }
1219
+
1220
+ function getArrayU8FromWasm0(ptr, len) {
1221
+ ptr = ptr >>> 0;
1222
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1223
+ }
1224
+
1225
+ let cachedDataViewMemory0 = null;
1226
+ function getDataViewMemory0() {
1227
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1228
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1229
+ }
1230
+ return cachedDataViewMemory0;
1231
+ }
1232
+
1233
+ function getStringFromWasm0(ptr, len) {
1234
+ ptr = ptr >>> 0;
1235
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1236
+ }
1237
+
1238
+ let cachedUint8ArrayMemory0 = null;
1239
+ function getUint8ArrayMemory0() {
1240
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1241
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1242
+ }
1243
+ return cachedUint8ArrayMemory0;
1244
+ }
1245
+
1246
+ function handleError(f, args) {
1247
+ try {
1248
+ return f.apply(this, args);
1249
+ } catch (e) {
1250
+ const idx = addToExternrefTable0(e);
1251
+ wasm.__wbindgen_export4(idx);
1252
+ }
1253
+ }
1254
+
1255
+ function isLikeNone(x) {
1256
+ return x === undefined || x === null;
1257
+ }
1258
+
1259
+ function makeMutClosure(arg0, arg1, f) {
1260
+ const state = { a: arg0, b: arg1, cnt: 1 };
1261
+ const real = (...args) => {
1262
+
1263
+ // First up with a closure we increment the internal reference
1264
+ // count. This ensures that the Rust closure environment won't
1265
+ // be deallocated while we're invoking it.
1266
+ state.cnt++;
1267
+ const a = state.a;
1268
+ state.a = 0;
1269
+ try {
1270
+ return f(a, state.b, ...args);
1271
+ } finally {
1272
+ state.a = a;
1273
+ real._wbg_cb_unref();
1274
+ }
1275
+ };
1276
+ real._wbg_cb_unref = () => {
1277
+ if (--state.cnt === 0) {
1278
+ wasm.__wbindgen_export6(state.a, state.b);
1279
+ state.a = 0;
1280
+ CLOSURE_DTORS.unregister(state);
1281
+ }
1282
+ };
1283
+ CLOSURE_DTORS.register(real, state, state);
1284
+ return real;
1285
+ }
1286
+
1287
+ function passArray8ToWasm0(arg, malloc) {
1288
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1289
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1290
+ WASM_VECTOR_LEN = arg.length;
1291
+ return ptr;
1292
+ }
1293
+
1294
+ function passStringToWasm0(arg, malloc, realloc) {
1295
+ if (realloc === undefined) {
1296
+ const buf = cachedTextEncoder.encode(arg);
1297
+ const ptr = malloc(buf.length, 1) >>> 0;
1298
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1299
+ WASM_VECTOR_LEN = buf.length;
1300
+ return ptr;
1301
+ }
1302
+
1303
+ let len = arg.length;
1304
+ let ptr = malloc(len, 1) >>> 0;
1305
+
1306
+ const mem = getUint8ArrayMemory0();
1307
+
1308
+ let offset = 0;
1309
+
1310
+ for (; offset < len; offset++) {
1311
+ const code = arg.charCodeAt(offset);
1312
+ if (code > 0x7F) break;
1313
+ mem[ptr + offset] = code;
1314
+ }
1315
+ if (offset !== len) {
1316
+ if (offset !== 0) {
1317
+ arg = arg.slice(offset);
1318
+ }
1319
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1320
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1321
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1322
+
1323
+ offset += ret.written;
1324
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1325
+ }
1326
+
1327
+ WASM_VECTOR_LEN = offset;
1328
+ return ptr;
1329
+ }
1330
+
1331
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
1332
+ cachedTextDecoder.decode();
1333
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1334
+ let numBytesDecoded = 0;
1335
+ function decodeText(bytes) {
1336
+ numBytesDecoded += bytes.length;
1337
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1338
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
1339
+ cachedTextDecoder.decode();
1340
+ numBytesDecoded = bytes.length;
1341
+ }
1342
+ return cachedTextDecoder.decode(bytes);
1343
+ }
1344
+
1345
+ const cachedTextEncoder = new TextEncoder();
1346
+
1347
+ if (!('encodeInto' in cachedTextEncoder)) {
1348
+ cachedTextEncoder.encodeInto = function (arg, view) {
1349
+ const buf = cachedTextEncoder.encode(arg);
1350
+ view.set(buf);
1351
+ return {
1352
+ read: arg.length,
1353
+ written: buf.length
1354
+ };
1355
+ };
1356
+ }
1357
+
1358
+ let WASM_VECTOR_LEN = 0;
1359
+
1360
+ let wasm;
1361
+ function __wbg_finalize_init(instance, module) {
1362
+ wasm = instance.exports;
1363
+ cachedDataViewMemory0 = null;
1364
+ cachedUint8ArrayMemory0 = null;
1365
+ wasm.__wbindgen_start();
1366
+ return wasm;
1367
+ }
1368
+
1369
+ async function __wbg_load(module, imports) {
1370
+ if (typeof Response === 'function' && module instanceof Response) {
1371
+ if (!module.ok) {
1372
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
1373
+ }
1374
+
1375
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1376
+ try {
1377
+ return await WebAssembly.instantiateStreaming(module, imports);
1378
+ } catch (e) {
1379
+ const validResponse = expectedResponseType(module.type);
1380
+
1381
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1382
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1383
+
1384
+ } else { throw e; }
1385
+ }
1386
+ }
1387
+
1388
+ const bytes = await module.arrayBuffer();
1389
+ return await WebAssembly.instantiate(bytes, imports);
1390
+ } else {
1391
+ const instance = await WebAssembly.instantiate(module, imports);
1392
+
1393
+ if (instance instanceof WebAssembly.Instance) {
1394
+ return { instance, module };
1395
+ } else {
1396
+ return instance;
1397
+ }
1398
+ }
1399
+
1400
+ function expectedResponseType(type) {
1401
+ switch (type) {
1402
+ case 'basic': case 'cors': case 'default': return true;
1403
+ }
1404
+ return false;
1405
+ }
1406
+ }
1407
+
1408
+ let __wbg_init_promise;
1409
+ async function __wbg_init(module_or_path) {
1410
+ if (wasm !== undefined) return wasm;
1411
+ if (__wbg_init_promise === undefined) {
1412
+ __wbg_init_promise = __wbg_init_once(module_or_path);
1413
+ __wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
1414
+ }
1415
+ return __wbg_init_promise;
1416
+ }
1417
+
1418
+ async function __wbg_init_once(module_or_path) {
1419
+
1420
+ if (module_or_path !== undefined) {
1421
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1422
+ ({module_or_path} = module_or_path);
1423
+ } else {
1424
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead');
1425
+ }
1426
+ }
1427
+
1428
+ if (module_or_path === undefined) {
1429
+ module_or_path = new URL('phirepass-channel_bg.wasm', (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('protocol-CYh109n2.js', document.baseURI).href)));
1430
+ }
1431
+ const imports = __wbg_get_imports();
1432
+
1433
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1434
+ module_or_path = fetch(module_or_path);
1435
+ }
1436
+
1437
+ const { instance} = await __wbg_load(await module_or_path, imports);
1438
+
1439
+ return __wbg_finalize_init(instance);
1440
+ }
1441
+
1442
+ exports.ProtocolMessageType = void 0;
1443
+ (function (ProtocolMessageType) {
1444
+ ProtocolMessageType["Error"] = "Error";
1445
+ ProtocolMessageType["AuthSuccess"] = "AuthSuccess";
1446
+ ProtocolMessageType["TunnelOpened"] = "TunnelOpened";
1447
+ ProtocolMessageType["TunnelClosed"] = "TunnelClosed";
1448
+ ProtocolMessageType["TunnelData"] = "TunnelData";
1449
+ ProtocolMessageType["RDPAuthorized"] = "RDPAuthorized";
1450
+ ProtocolMessageType["SFTPListItems"] = "SFTPListItems";
1451
+ ProtocolMessageType["SFTPDownloadStartResponse"] = "SFTPDownloadStartResponse";
1452
+ ProtocolMessageType["SFTPDownloadChunk"] = "SFTPDownloadChunk";
1453
+ ProtocolMessageType["SFTPUploadStartResponse"] = "SFTPUploadStartResponse";
1454
+ ProtocolMessageType["SFTPUploadChunkAck"] = "SFTPUploadChunkAck";
1455
+ ProtocolMessageType["SFTPOpResult"] = "SFTPOpResult";
1456
+ })(exports.ProtocolMessageType || (exports.ProtocolMessageType = {}));
1457
+ exports.InputMode = void 0;
1458
+ (function (InputMode) {
1459
+ InputMode[InputMode["Username"] = 0] = "Username";
1460
+ InputMode[InputMode["Password"] = 1] = "Password";
1461
+ InputMode[InputMode["Default"] = 2] = "Default";
1462
+ })(exports.InputMode || (exports.InputMode = {}));
1463
+ exports.ConnectionState = void 0;
1464
+ (function (ConnectionState) {
1465
+ ConnectionState["Disconnected"] = "disconnected";
1466
+ ConnectionState["Connected"] = "connected";
1467
+ ConnectionState["Error"] = "error";
1468
+ })(exports.ConnectionState || (exports.ConnectionState = {}));
1469
+
1470
+ exports.Channel = Channel;
1471
+ exports.ErrorType = ErrorType;
1472
+ exports.__wbg_init = __wbg_init;