phirepass-widgets 0.0.79 → 0.0.81

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 (44) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/phirepass-rdp.cjs.entry.js +308 -0
  3. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +17 -17
  4. package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
  5. package/dist/cjs/phirepass-widgets.cjs.js +1 -1
  6. package/dist/cjs/{protocol-DC4eLkqJ.js → protocol-DS0qXomZ.js} +25 -26
  7. package/dist/collection/collection-manifest.json +2 -2
  8. package/dist/collection/common/protocol.js +1 -0
  9. package/dist/collection/components/{phirepass-vnc/phirepass-vnc.css → phirepass-rdp/phirepass-rdp.css} +9 -2
  10. package/dist/collection/components/{phirepass-vnc/phirepass-vnc.js → phirepass-rdp/phirepass-rdp.js} +198 -90
  11. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +16 -16
  12. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +1 -1
  13. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  14. package/dist/components/p-CWIhN33k.js +1 -0
  15. package/dist/components/{phirepass-vnc.d.ts → phirepass-rdp.d.ts} +4 -4
  16. package/dist/components/phirepass-rdp.js +1 -0
  17. package/dist/components/phirepass-sftp-client.js +1 -1
  18. package/dist/components/phirepass-terminal.js +2 -2
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/esm/phirepass-rdp.entry.js +306 -0
  21. package/dist/esm/phirepass-sftp-client.entry.js +17 -17
  22. package/dist/esm/phirepass-terminal.entry.js +2 -2
  23. package/dist/esm/phirepass-widgets.js +1 -1
  24. package/dist/esm/{protocol-BR2c80mW.js → protocol-CWIhN33k.js} +24 -25
  25. package/dist/phirepass-widgets/{p-339cd54e.entry.js → p-19789356.entry.js} +1 -1
  26. package/dist/phirepass-widgets/{p-14c7611f.entry.js → p-2478a6eb.entry.js} +2 -2
  27. package/dist/phirepass-widgets/p-CWIhN33k.js +1 -0
  28. package/dist/phirepass-widgets/p-a5528005.entry.js +1 -0
  29. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  30. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  31. package/dist/types/common/protocol.d.ts +17 -1
  32. package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +90 -0
  33. package/dist/types/components.d.ts +136 -90
  34. package/package.json +4 -3
  35. package/dist/cjs/phirepass-vnc.cjs.entry.js +0 -336
  36. package/dist/collection/common/channel-socket.js +0 -89
  37. package/dist/components/p-BR2c80mW.js +0 -1
  38. package/dist/components/phirepass-vnc.js +0 -1
  39. package/dist/esm/phirepass-vnc.entry.js +0 -334
  40. package/dist/phirepass-widgets/p-19e2a30c.entry.js +0 -1
  41. package/dist/phirepass-widgets/p-BR2c80mW.js +0 -1
  42. package/dist/types/common/channel-socket.d.ts +0 -47
  43. package/dist/types/common/novnc.d.ts +0 -53
  44. package/dist/types/components/phirepass-vnc/phirepass-vnc.d.ts +0 -52
@@ -0,0 +1,306 @@
1
+ import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-DovZQ7sb.js';
2
+ import { _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-CWIhN33k.js';
3
+
4
+ const phirepassRdpCss = () => `:host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021}.screen{width:100%;height:100%}.screen iron-remote-desktop{display:block;width:100%;height:100%}.screen canvas{max-width:100%;display:block}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}`;
5
+
6
+ const PhirepassRdp = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.connectionStateChanged = createEvent(this, "connectionStateChanged");
10
+ }
11
+ channel;
12
+ containerEl;
13
+ ironEl;
14
+ userInteraction;
15
+ domReady = false;
16
+ runtimeReady = false;
17
+ connected = false;
18
+ session_id;
19
+ /** Credentials in force for this session, from props or from the prompt. */
20
+ credentials;
21
+ credentialsPrompt = false;
22
+ statusMessage;
23
+ usernameBuffer = '';
24
+ passwordBuffer = '';
25
+ get el() { return getElement(this); }
26
+ serverHost = "phirepass.com";
27
+ serverPort = 443;
28
+ allowInsecure = false;
29
+ heartbeatInterval = 30_000;
30
+ nodeId;
31
+ serviceId;
32
+ token;
33
+ /**
34
+ * Credentials for the remote host. When either is missing the widget
35
+ * prompts for both.
36
+ *
37
+ * They serve two purposes at once: the agent checks them before it
38
+ * authorises the tunnel, and the browser uses them for CredSSP. The agent
39
+ * never logs in with them — it discards them once the tunnel is authorised.
40
+ */
41
+ username;
42
+ password;
43
+ /**
44
+ * What to name the host in the CredSSP service principal (`TERMSRV/...`).
45
+ *
46
+ * The agent dials whatever the node's service settings say, so this is
47
+ * never used for routing. It matters only because some hosts check the SPN,
48
+ * and the browser has no other way to learn the host's real address.
49
+ */
50
+ destination;
51
+ /** `fit` scales the desktop to the widget, `real` keeps 1:1 pixels. */
52
+ scale = 'fit';
53
+ onNodeIdChange(newValue, _oldValue) {
54
+ this.reset_session_state();
55
+ if (this.channel && this.channel.is_connected()) {
56
+ this.close_comms();
57
+ }
58
+ if (newValue) {
59
+ this.open_comms();
60
+ this.channel.connect();
61
+ }
62
+ }
63
+ serverId;
64
+ onServerIdChange(_newValue, _oldValue) {
65
+ this.onNodeIdChange(this.nodeId, this.nodeId);
66
+ }
67
+ connectionStateChanged;
68
+ create_web_socket_endpoint() {
69
+ const protocol = this.allowInsecure ? 'ws' : 'wss';
70
+ if (!this.allowInsecure && this.serverPort === 443) {
71
+ return `${protocol}://${this.serverHost}`;
72
+ }
73
+ if (this.allowInsecure && this.serverPort === 80) {
74
+ return `${protocol}://${this.serverHost}`;
75
+ }
76
+ return `${protocol}://${this.serverHost}:${this.serverPort}`;
77
+ }
78
+ async connectedCallback() {
79
+ await __wbg_init();
80
+ this.open_comms();
81
+ this.runtimeReady = true;
82
+ if (!this.nodeId) {
83
+ console.warn('Prop node_id is not set. Cannot connect to RDP.');
84
+ return;
85
+ }
86
+ this.try_connect();
87
+ }
88
+ componentDidLoad() {
89
+ this.domReady = true;
90
+ this.try_connect();
91
+ }
92
+ async disconnectedCallback() {
93
+ this.connected = false;
94
+ this.domReady = false;
95
+ this.runtimeReady = false;
96
+ this.close_comms();
97
+ }
98
+ try_connect() {
99
+ if (this.connected || !this.domReady || !this.runtimeReady) {
100
+ return;
101
+ }
102
+ if (!this.containerEl || !this.channel) {
103
+ return;
104
+ }
105
+ this.connect();
106
+ }
107
+ connect() {
108
+ this.connected = true;
109
+ this.channel.connect();
110
+ }
111
+ open_comms() {
112
+ if (this.serverId) {
113
+ this.channel = new Channel(`${this.create_web_socket_endpoint()}/api/web/ws`, this.nodeId, this.serverId);
114
+ }
115
+ else {
116
+ this.channel = new Channel(`${this.create_web_socket_endpoint()}/api/web/ws`, this.nodeId);
117
+ }
118
+ this.channel.on_connection_open(() => {
119
+ this.connectionStateChanged.emit([ConnectionState.Connected]);
120
+ this.channel.authenticate(this.token, this.nodeId);
121
+ });
122
+ this.channel.on_connection_close(() => {
123
+ this.connectionStateChanged.emit([ConnectionState.Disconnected]);
124
+ this.teardown_client();
125
+ });
126
+ this.channel.on_connection_error((err) => {
127
+ this.connectionStateChanged.emit([ConnectionState.Error, err]);
128
+ });
129
+ this.channel.on_connection_message((_raw_) => {
130
+ // raw frames are handled by on_protocol_message below
131
+ });
132
+ this.channel.on_protocol_message((msg) => {
133
+ const { web } = msg.data;
134
+ switch (web.type) {
135
+ case ProtocolMessageType.Error:
136
+ this.handle_error(web);
137
+ break;
138
+ case ProtocolMessageType.AuthSuccess:
139
+ this.handle_auth_success(web);
140
+ break;
141
+ case ProtocolMessageType.RDPAuthorized:
142
+ this.handle_rdp_authorized(web);
143
+ break;
144
+ case ProtocolMessageType.TunnelClosed:
145
+ this.handle_tunnel_closed(web);
146
+ break;
147
+ default:
148
+ console.warn('Unknown protocol message type:', web);
149
+ }
150
+ });
151
+ }
152
+ close_comms() {
153
+ this.teardown_client();
154
+ if (this.channel) {
155
+ this.channel.stop_heartbeat();
156
+ this.channel.disconnect();
157
+ }
158
+ }
159
+ reset_session_state() {
160
+ this.session_id = undefined;
161
+ this.credentials = undefined;
162
+ this.credentialsPrompt = false;
163
+ this.usernameBuffer = '';
164
+ this.passwordBuffer = '';
165
+ this.statusMessage = undefined;
166
+ }
167
+ /**
168
+ * The channel stays open for the whole session even though no RDP byte ever
169
+ * travels over it: it is what keeps the tunnel registered server-side, and
170
+ * it is where `TunnelClosed` and `Error` arrive.
171
+ */
172
+ handle_auth_success(_auth_) {
173
+ this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
174
+ if (this.username && this.password) {
175
+ this.credentials = { username: this.username, password: this.password };
176
+ this.request_tunnel();
177
+ return;
178
+ }
179
+ this.credentialsPrompt = true;
180
+ }
181
+ request_tunnel() {
182
+ if (!this.credentials) {
183
+ return;
184
+ }
185
+ this.statusMessage = undefined;
186
+ this.channel.open_rdp_tunnel(this.nodeId, this.serviceId, this.credentials.username, this.credentials.password);
187
+ }
188
+ /**
189
+ * The tunnel is authorised but nothing has been dialled yet: the agent only
190
+ * reserves `sid`. Handing the ticket to the RDP client is what triggers the
191
+ * TCP + x224 + TLS hop, and the ticket expires 60s from now.
192
+ */
193
+ async handle_rdp_authorized(web) {
194
+ this.session_id = web.sid;
195
+ this.statusMessage = 'Connecting…';
196
+ // Loaded on demand: the RDP client carries a multi-megabyte wasm
197
+ // payload that consumers embedding only the terminal or the SFTP client
198
+ // should never download.
199
+ const [backend] = await Promise.all([
200
+ import('@devolutions/iron-remote-desktop-rdp'),
201
+ // Registers the `iron-remote-desktop` element as a side effect.
202
+ import('@devolutions/iron-remote-desktop'),
203
+ ]);
204
+ // The element may have gone away while the modules were loading.
205
+ if (!this.containerEl || this.session_id !== web.sid) {
206
+ return;
207
+ }
208
+ await backend.init('info');
209
+ if (!this.containerEl || this.session_id !== web.sid) {
210
+ return;
211
+ }
212
+ // Built imperatively rather than in `render()` so `module` is set
213
+ // before the element upgrades — it reads its backend on connect.
214
+ const element = document.createElement('iron-remote-desktop');
215
+ element.module = backend.Backend;
216
+ element.scale = this.scale;
217
+ element.flexcenter = true;
218
+ element.verbose = false;
219
+ element.addEventListener('ready', (event) => {
220
+ const detail = event.detail;
221
+ void this.start_session(detail.irgUserInteraction, web.ticket, backend.enableCredssp(true));
222
+ });
223
+ this.ironEl = element;
224
+ this.containerEl.appendChild(element);
225
+ }
226
+ async start_session(userInteraction, ticket, credssp) {
227
+ this.userInteraction = userInteraction;
228
+ const config = userInteraction
229
+ .configBuilder()
230
+ .withUsername(this.credentials?.username ?? '')
231
+ .withPassword(this.credentials?.password ?? '')
232
+ .withDestination(this.destination ?? this.nodeId)
233
+ .withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`)
234
+ .withAuthToken(ticket)
235
+ .withExtension(credssp)
236
+ .build();
237
+ try {
238
+ const session = await userInteraction.connect(config);
239
+ userInteraction.setVisibility(true);
240
+ this.statusMessage = undefined;
241
+ const termination = await session.run();
242
+ this.statusMessage = termination.reason();
243
+ }
244
+ catch (err) {
245
+ const message = this.describe_error(err);
246
+ this.statusMessage = message;
247
+ this.connectionStateChanged.emit([ConnectionState.Error, err]);
248
+ }
249
+ }
250
+ /** IronRDP rejects with its own error shape rather than an `Error`. */
251
+ describe_error(err) {
252
+ const iron = err;
253
+ if (iron && typeof iron.backtrace === 'function') {
254
+ return iron.backtrace();
255
+ }
256
+ return err instanceof Error ? err.message : 'Connection failed.';
257
+ }
258
+ handle_tunnel_closed(_web_) {
259
+ this.session_id = undefined;
260
+ this.statusMessage = this.statusMessage ?? 'Connection closed.';
261
+ this.teardown_client();
262
+ this.close_comms();
263
+ }
264
+ handle_error(error) {
265
+ this.statusMessage = error.message;
266
+ this.connectionStateChanged.emit([ConnectionState.Error, error]);
267
+ }
268
+ teardown_client() {
269
+ if (this.userInteraction) {
270
+ try {
271
+ this.userInteraction.shutdown();
272
+ }
273
+ catch (err) {
274
+ console.warn('Failed to shut the RDP session down cleanly:', err);
275
+ }
276
+ this.userInteraction = undefined;
277
+ }
278
+ this.ironEl?.remove();
279
+ this.ironEl = undefined;
280
+ this.credentialsPrompt = false;
281
+ this.usernameBuffer = '';
282
+ this.passwordBuffer = '';
283
+ }
284
+ submit_credentials(event) {
285
+ event.preventDefault();
286
+ this.credentialsPrompt = false;
287
+ this.credentials = { username: this.usernameBuffer, password: this.passwordBuffer };
288
+ this.usernameBuffer = '';
289
+ this.passwordBuffer = '';
290
+ this.request_tunnel();
291
+ }
292
+ render() {
293
+ return (h(Host, { key: '97b198af30e4e4b7ae8cbd0d497dc4f4812615f8' }, h("div", { key: 'f7d01492909a0f3cb6c639345eb70a8e1fbf1b90', class: "screen", ref: (el) => (this.containerEl = el) }), this.credentialsPrompt && (h("form", { key: '1dcfeaa956999dc882943e0d0b49ead8d12840bc', class: "prompt", onSubmit: (event) => this.submit_credentials(event) }, h("label", { key: 'a62e96bfb6b947167f731020c7ab00a1d9a82652', htmlFor: "rdp-username" }, "Windows username"), h("input", { key: '3135d24b62b2b612a11d3cbfd2c19f3cf381e74b', id: "rdp-username", type: "text", autocomplete: "username", autofocus: true, onInput: (event) => (this.usernameBuffer = event.target.value) }), h("label", { key: 'd8b901e0fe81de30e6426f80179d5e8da542effc', htmlFor: "rdp-password" }, "Password"), h("input", { key: '0bfad07c7f5355a8693856b1e6b51df59944a339', id: "rdp-password", type: "password", autocomplete: "current-password", onInput: (event) => (this.passwordBuffer = event.target.value) }), h("button", { key: 'e1cbab525870c34fe85299a8ce883d7069cb4bb8', type: "submit" }, "Connect"))), this.statusMessage && !this.credentialsPrompt && (h("div", { key: '4144cff9e5d6fb637655203bf67a13adaa7feede', class: "status" }, this.statusMessage))));
294
+ }
295
+ static get watchers() { return {
296
+ "nodeId": [{
297
+ "onNodeIdChange": 0
298
+ }],
299
+ "serverId": [{
300
+ "onServerIdChange": 0
301
+ }]
302
+ }; }
303
+ };
304
+ PhirepassRdp.style = phirepassRdpCss();
305
+
306
+ export { PhirepassRdp as phirepass_rdp };
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-DovZQ7sb.js';
2
- import { _ as __wbg_init, E as ErrorType, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-BR2c80mW.js';
2
+ import { _ as __wbg_init, E as ErrorType, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-CWIhN33k.js';
3
3
 
4
4
  const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
5
5
 
@@ -924,18 +924,18 @@ const PhirepassSftpClient = class {
924
924
  return `${typeChar}${chars.join('')}`;
925
925
  }
926
926
  render() {
927
- return (h(Host, { key: '693cdfaab69be7ba55dd7333ac5f8ed5ccb0dbce', class: {
927
+ return (h(Host, { key: '682152b79b8d22bd7c81299225fb9d1bb0da72db', class: {
928
928
  'default': !this.max,
929
929
  'max': this.max,
930
- } }, h("section", { key: '504d57b244dd055f23b81807ef6a397032dcf088', class: "listing" }, !this.hideHeader &&
931
- h("header", { key: 'cef1e0a272851379e6d9ca07092b8078c94e2509' }, h("section", { key: '49fe94d69837676a46e3c92f54496c2ffa1e3ecd', class: "title" }, h("img", { key: 'cec6b64508c31904b34496cc34b26f81ae3e290e', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), h("div", { key: '3331b32275581f9bcf79b4b346e9820018868cbf', class: "text" }, h("div", { key: '289f2fef2e14c0a1954a99f6bbd920edbf66bf42', class: "name" }, this.name), h("div", { key: '8c88da9841dc39373f94cb313c7897cbc5a828a3', class: "description" }, this.description))), h("section", { key: 'f6f7ae566a225586c4a79ba31eecf998a1df010b', class: "actions" }, h("div", { key: 'd1a5e9c21e61320035eafe255213e883140815c4', class: "action", onClick: () => this.toggle_max() }, h("img", { key: '10f834c7a7846964bc84c2fd6eef39b09fa33e8f', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), h("main", { key: 'e17ee5827dc56cea9139697ce9024011a638e5ff' }, this.show_navigation && h("nav", { key: '277080aa09d738f21605d95d1bf70adc9156dfbb', class: "navigation" }, h("div", { key: '526b99f6b6c1161e41ee6dfcd13b48f8e52f85eb', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index, breadcrumbs) => (h("span", { key: index, class: "breadcrumb-container" }, h("span", { key: index, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index < breadcrumbs.length - 1 && h("img", { class: "arrow", src: phirepassSftpClientChevronSvg }))))), h("section", { key: '61a48831425637dc03662f6a8748619745a13b7b', class: "actions", "aria-label": "SFTP actions" }, h("button", { key: '53f150ed1579a653a6f843106ba14534156d46d2', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: 'dd9853885e3a18882ded99fb28e0e270a9e8bb2b', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), h("button", { key: '5a2a2f865b5169d2187cf5c8d5aa876163d708d3', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: '62752fa2e46faf222fedd7f5f8a6e7d81242a089', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), h("button", { key: '09fe21b04d27e7e1abd87b14789e6bd8faa68a98', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: '0b4ab6f686c7261844221835836e2dbee86866bf', src: phirepassSftpClientUploadSvg, alt: "Upload" })), h("button", { key: 'eab9cf7df64384db2cfb383ba2bc87ff84e9ef63', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '05609273cfc54c019f801768e560365845c38671', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: 'ed910c6b7c2d5ac17e13fef9fd4597b1406b7d85', class: "content" }, h("table", { key: 'c28ed3308bf01665e313e1f8b8fb482f2dc0303a' }, h("thead", { key: '187c2e34ed9cbe57ea13083645472f0dc6f2e957' }, h("tr", { key: 'd43d3d698ba06cc24bc9fba9946a0bcf382327a1' }, h("th", { key: '8128742b1975b1c655e5665256cceb8f63441450' }, "Name"), h("th", { key: '35f91f13e38b62dfa97c742f4f23d14495f71462' }, "Size"), h("th", { key: '89f10d37b9558aadfc1e10e6729ef0bc63f30216' }, "Permissions"), h("th", { key: '51905e8a7d3391119290b59fb0f36420b23b5331' }, "Owner"), h("th", { key: 'a2133c42789fb79ec0bfd91c1ffe4f869a8b0acf' }, "Modified"), h("th", { key: 'a3b72803212e5ba60249777cdad37341c101a4b5', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: 'e5ee4a1cd8943a4966d33a43ee04df5f355f21e0' }, this.listing.map((item, index) => (h("tr", { key: index, class: {
930
+ } }, h("section", { key: '5be263e7b380fc61ab70856c6650b5dfb0901795', class: "listing" }, !this.hideHeader &&
931
+ h("header", { key: 'fee0627ccb716ef560e8723496087e1b565f759f' }, h("section", { key: 'b112ebbe9ff73bc80ce84bb47e50769ae45a4ce2', class: "title" }, h("img", { key: '3a0ec7d30cf4cab69ec5f2e236b8e162ea4c2ce5', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), h("div", { key: '433b5063ca30b4cc04544ff6ef29d94e9dc0a703', class: "text" }, h("div", { key: 'dd354e0b38c4e3d8cc5f9588bbeb2cbb32d476fc', class: "name" }, this.name), h("div", { key: '523829c5a164d755211bc35caf8fdeb44ca8a15e', class: "description" }, this.description))), h("section", { key: '9dd9e2c1f7e43c72d284a67332320f736a81a809', class: "actions" }, h("div", { key: '40a2744abdfadf699cd631684e083ec0dc829a7d', class: "action", onClick: () => this.toggle_max() }, h("img", { key: '3ad551f84dbf56da3d47bd0045748a94c285bc72', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), h("main", { key: '770b9372cdb761efb233f73d70afb83f5d5d2c01' }, this.show_navigation && h("nav", { key: 'b9c318e991b2523497e1c6e1cc55d540215fa848', class: "navigation" }, h("div", { key: '9f9e8e06ba65e47979980fc52cdcc73ae494df24', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index, breadcrumbs) => (h("span", { key: index, class: "breadcrumb-container" }, h("span", { key: index, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index < breadcrumbs.length - 1 && h("img", { class: "arrow", src: phirepassSftpClientChevronSvg }))))), h("section", { key: '21eda2e694e98f40b40e0421c333e8fa582731ff', class: "actions", "aria-label": "SFTP actions" }, h("button", { key: 'e74fdf11191b0d80ba286c4d6a7f613bd7c9d5bb', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: '2785ac1d0ae7c33123fb924ad030efc4d5e03da0', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), h("button", { key: '08b3880df69db41a7bad0278971308e5bbdb5813', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: '2b00f26ae3b5fc3a923b337a7f2a0a6e641874fa', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), h("button", { key: '4b05f7d304f5a89642dccfa499ab1421890d67c8', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: 'a95624e723f28b04ab277b82650a2334bd2aa679', src: phirepassSftpClientUploadSvg, alt: "Upload" })), h("button", { key: '3277414b28f178d1ba3d6f147ed79bc951a5df29', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '5c248ba2c5c001aa2e0196f41f278f70412b5c1b', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: 'afff360eecca86b4c66a799e8938108a310ccbab', class: "content" }, h("table", { key: '31e9223fab1a5d6a3f797b44efbd6f735551757a' }, h("thead", { key: '16662bfc34dc06207c7d131f067ac257c27c4ed0' }, h("tr", { key: '8a6d2344ae8c71c6ef99fd7c19acf508d1b887d2' }, h("th", { key: 'f7f8759feb03389fe61b1d63394c8557c3d0b209' }, "Name"), h("th", { key: '1342f11d5132c84447f32099661d08723eb62ef7' }, "Size"), h("th", { key: '7e041ba0b6515d8c734ebddd418f17173f9361f1' }, "Permissions"), h("th", { key: '05921d3c7bf7e4dd320d1116f451730346a0a148' }, "Owner"), h("th", { key: '0e7b65094f59b7219f2ef4e9ac1ba87969c6078e' }, "Modified"), h("th", { key: '261be85a5ccbce865b09d0cf8276df408af49e14', class: "action-col", "aria-label": "Actions" }))), h("tbody", { key: '04043d8e6d3151d5d1dcf72b67208967dfcd9dfd' }, this.listing.map((item, index) => (h("tr", { key: index, class: {
932
932
  'selected': this.is_selected(item),
933
933
  }, onClick: () => this.list_directory(item) }, h("td", null, item.kind === 'Folder' ? h("img", { class: "kind", src: phirepassSftpClientFolderSvg, alt: "Folder" }) : h("img", { class: "kind", src: phirepassSftpClientFileSvg, alt: "File" }), h("span", { class: `name ${item.kind.toLowerCase()}` }, item.name)), h("td", null, this.format_size(item.attributes.size)), h("td", null, this.format_permissions(item.attributes.permissions, item.kind)), h("td", null, item.attributes.user ?? '-'), h("td", null, new Date(item.attributes.modified * 1000).toLocaleString()), h("td", { class: "action-col" }, item.kind === 'File' &&
934
- h("div", { class: "file-actions" }, h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("polyline", { points: "7 10 12 15 17 10" }), h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("polyline", { points: "3 6 5 6 21 6" }), h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && h("div", { key: '30777c73738f9c6a5199033428d9033d0cd05b99', class: "loader" }, "Loading..."), this.show_error && h("div", { key: '0a5bc583f268e00c1bf17661ea1f49bccaba6ab9', class: "error" }, this.error_message)), h("footer", { key: '94aff725f14e25d8c34719cbf2decdd5e17b8e22' }, h("section", { key: '6342e9ce4b7fe08e12d62406f203127a0c872055', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
935
- h("section", { key: '039eeae64731e54a5bf0982777815c8ad0df6b49', class: {
934
+ h("div", { class: "file-actions" }, h("button", { type: "button", class: "file-action", onClick: (event) => this.on_file_row_action(item, event), title: "Download", "aria-label": "Download" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), h("polyline", { points: "7 10 12 15 17 10" }), h("line", { x1: "12", x2: "12", y1: "15", y2: "3" }))), h("button", { type: "button", class: "file-action delete", onClick: (event) => this.on_file_delete_action(item, event), title: "Delete", "aria-label": "Delete" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" }, h("polyline", { points: "3 6 5 6 21 6" }), h("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }), h("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }), h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), h("line", { x1: "14", x2: "14", y1: "11", y2: "17" }))))))))))), this.show_loader && h("div", { key: 'a69008f418c1d9afa2e980ada402a80382ea7fec', class: "loader" }, "Loading..."), this.show_error && h("div", { key: '29875e65941130d5fe0f842ebec0685f69769ecf', class: "error" }, this.error_message)), h("footer", { key: '6dc5eff60f9b6acedff8996aa688b450dcaa2eeb' }, h("section", { key: 'cf1dadc5e03c3480b5c3d7c7fe0547ec087d1ce9', class: "version" }, this.version ? `Version: ${this.version}` : ''))), this.show_login_screen &&
935
+ h("section", { key: '0d8b86d8b48fee55504f65f3938fa81b59f8b18f', class: {
936
936
  'creds': true,
937
937
  'blurred': this.show_login_screen,
938
- } }, h("form", { key: '6670d05c61c412bbc1f8d26f317b4aea4614f428', class: "auth", onSubmit: (event) => {
938
+ } }, h("form", { key: 'a5e8c4a877b696edad3b4808c2d325c78d1ff169', class: "auth", onSubmit: (event) => {
939
939
  const formData = new FormData(event.target);
940
940
  let username = undefined;
941
941
  if (this.show_login_screen_username) {
@@ -952,28 +952,28 @@ const PhirepassSftpClient = class {
952
952
  this.show_loader = true;
953
953
  event.stopPropagation();
954
954
  event.preventDefault();
955
- } }, h("div", { key: 'c899712c9ee14f4490617a316d3bbc631d794fde', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
956
- h("div", { key: '8088ac918f3455ff6bf2e2d50eb4fa8c18b58a97' }, h("label", { key: '850f947b1639782b1d6f4011a809466f8a43e7de', htmlFor: "username" }, "Username"), h("input", { key: '7fb4f67d37d84d6329840525de602a5b74675580', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
957
- h("div", { key: '79633deeb5499a0fd120aba6a0875e7d78dc429a' }, h("label", { key: 'b911b56f1676d70e703c7fb318c6f48c52f08031', htmlFor: "password" }, "Password"), h("input", { key: '80ebcebc0a118f24c85f43a6bd89d5de0dbfec1c', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), h("div", { key: 'a1c8a2677ae4614e9cc11884aa226757bcccbcf3' }, h("button", { key: 'cfcd552766c53d63f8cc1cb46b328639fdad189f', type: "submit" }, "Connect")))), this.show_upload_modal &&
958
- h("section", { key: '98243073570a448b37137c4b9910e809defa80ca', class: {
955
+ } }, h("div", { key: '1d2790cefa333a230e01b564673d8d1ce76942ca', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
956
+ h("div", { key: 'a2a43e259b11a526cf288dd2ae49c532440d33b4' }, h("label", { key: '95165a92cb5246188fedce9ba20b0f670bd877e5', htmlFor: "username" }, "Username"), h("input", { key: 'ccf925451b36456f24cdbc13fac1b8575a23a804', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "username", name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
957
+ h("div", { key: '2a3c49b4f0b2a34b6585ef1cf9a4baa52ef7970c' }, h("label", { key: '4c581797a2d16396a1cf1ab2c65cb5a23572f876', htmlFor: "password" }, "Password"), h("input", { key: '757fa564b1097339c84259e1615f03e0511990a5', autocorrect: "off", autocapitalize: "none", autoComplete: "off", id: "password", name: "password", type: "password", placeholder: "" })), h("div", { key: '219ed5d8d9c13ec4c0e47218170528e8ae0e9b81' }, h("button", { key: 'ea52ade9fef73f167246c437f37e5ee44d8aa881', type: "submit" }, "Connect")))), this.show_upload_modal &&
958
+ h("section", { key: '91be9acc6c829b65a2cb602884a98add1847b915', class: {
959
959
  'upload-modal': true,
960
960
  'visible': this.show_upload_modal,
961
- } }, h("div", { key: '382070ac49b529b3bd395bd7bd74f4d3ef636a53', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: 'ab42477909654bd992d4261ff041cef1d5a139be', class: "title" }, "Uploading File"), h("div", { key: 'c17d2db8e7bf9ddb2e80e32d609ca5a9bf55ceba', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: 'e5d6c359b82093ded872c98e965902c7f628c052', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: '737c05d515f8163b24f0c5c7d44d978f0d80ebb8', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: '5ec3c4970d811aaf977d71e3f2ba84cc5410a490', class: "progress-meta" }, h("div", { key: '18d83a68b795db0028b0ef7a5cbd51b46b29c280', class: "progress-speed" }, this.upload_speed), h("div", { key: '65d7b3a0b1dd5e34e00501c838ac674e2f9bc5e1', class: "progress-value" }, this.format_percent(this.upload_progress))), h("button", { key: 'bf6c636c3851f6fed2b1592e0bdb443108215737', type: "button", class: {
961
+ } }, h("div", { key: '526462f6a166512cbcaeca9acdf02c7352abf720', class: "upload-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Upload progress" }, h("div", { key: '1093b566e4103d84c0537ad0a4eee820dff77d5e', class: "title" }, "Uploading File"), h("div", { key: '1f2c1fcaa97653693162073267db16363f578a5e', class: "file-name", title: this.upload_file_name }, this.upload_file_name), h("div", { key: 'c1ee1c778fda4336c462adce90bf194a021af91f', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.upload_progress }, h("div", { key: 'ab1a29dc9134eb917e34df41b38e0b936cd7a1dd', class: "progress-fill", style: { width: `${this.upload_progress}%` } })), h("div", { key: 'a84c897deec8cf324c3a29667989b8aaa3540266', class: "progress-meta" }, h("div", { key: '66447fa44ae2cb5995b3fc08c1411aaffd65102a', class: "progress-speed" }, this.upload_speed), h("div", { key: '66d5b6b40e67af836ff61955d46c63033a663305', class: "progress-value" }, this.format_percent(this.upload_progress))), h("button", { key: '1ea99f4cbd0ab4a9972180029865fc99975511fd', type: "button", class: {
962
962
  'cancel': true,
963
963
  'finished': this.upload_finished,
964
964
  }, onClick: () => this.cancel_upload() }, this.upload_finished ? 'Close' : 'Cancel'))), this.show_download_modal &&
965
- h("section", { key: '0e3228077c259748f738be9d0a8eb11a9d64c36d', class: {
965
+ h("section", { key: '0da9656501ff93d682a48a8ae58a72555aa6b713', class: {
966
966
  'download-modal': true,
967
967
  'visible': this.show_download_modal,
968
- } }, h("div", { key: '2ddabbc1c6c7490b9f99e267545f891d36b1a080', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: '64c1050634a226f7b04288b83a7b782ae0403c1f', class: "title" }, "Downloading File"), h("div", { key: '0e93810dfaaccec1f00ee89bba31fba8812f0640', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: '6a2959f17fe2f0fe1ce5f4f272886491f7fc8830', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: '71ca2cd68130d227c23817f97aa906df489ce350', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: '834133dc9640a086b1d2a38ac24bfa02567a333d', class: "progress-meta" }, h("div", { key: '186e4d8167c207152e3b4c449c261d3e456b6ec7', class: "progress-speed" }, this.download_speed), h("div", { key: '69266fdc80cebced89c140016252e8e88fb012f2', class: "progress-value" }, this.format_percent(this.download_progress))), h("button", { key: '28238539b683c475bb8f13920485b3a7d209ddde', type: "button", class: {
968
+ } }, h("div", { key: '17d3737bd24412e7bd6d35bfb97f53bb5849bb53', class: "download-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Download progress" }, h("div", { key: '991c82ce3f4fb403f0f308a66a93763df7c840d4', class: "title" }, "Downloading File"), h("div", { key: '0988219f6118e701570a4829e15f1547dd5df3fd', class: "file-name", title: this.download_file_name }, this.download_file_name), h("div", { key: 'afb70a6f0b2215975e21db7258aec3b7cabbbbde', class: "progress-track", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": this.download_progress }, h("div", { key: '4223ef43e1b92db4d9b0af4583f545239f8161ca', class: "progress-fill", style: { width: `${this.download_progress}%` } })), h("div", { key: 'e2fbb4ffe05614e3876e4d5ea7d93f677356f43f', class: "progress-meta" }, h("div", { key: 'b20cdf67680d6ecc7590455700506160e0c85cb9', class: "progress-speed" }, this.download_speed), h("div", { key: '7d174465abaf4f384cba6bfa3a5c10adbcc917b7', class: "progress-value" }, this.format_percent(this.download_progress))), h("button", { key: 'ce0c262e02e9295223308c962e923acff8027561', type: "button", class: {
969
969
  'cancel': true,
970
970
  'finished': this.download_finished,
971
971
  }, onClick: () => this.cancel_download() }, this.download_finished ? 'Close' : 'Cancel'))), this.show_delete_modal &&
972
- h("section", { key: '6ab3a87e386f08aa6cb5ee52de1a53d634411991', class: {
972
+ h("section", { key: '7adae3f5add735aad8ca7e53e4e4c423ad651b93', class: {
973
973
  'delete-modal': true,
974
974
  'visible': this.show_delete_modal,
975
- } }, h("div", { key: 'ccaed2c02103afda40b507d374836ff994f0540d', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, h("div", { key: '19edbb28e08b513aec244baf59c1ab6798b11a45', class: "title" }, "Delete File"), h("div", { key: 'b98b4a138129f18a395dd7700ce50621049e2cf3', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), h("div", { key: '3af3fffa9a5e2b3bc8bf8a2d3d302fcce119a246', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
976
- h("div", { key: '09a78a79af88cb055cbc6e160c59b44c2be43fab', class: "delete-loader", "aria-hidden": "true" }, h("span", { key: '40d4285d22b51c62b4bac87ae5201ccb45721406', class: "spinner" })), h("div", { key: 'c3a475f37d3912755b3a6845ce49569429fc9a13', class: "modal-actions" }, h("button", { key: '3da31bcd06554c7463dc82e3f895fbcfe2551486', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: '1eafd821e308588c87f334d1fdbb05b9a6ae70ef', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
975
+ } }, h("div", { key: '3c7bad705431130db785a5ea0589b046ee031a70', class: "delete-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Delete confirmation" }, h("div", { key: '0f1136b5fd29bb9708bbaed48d0ac1e5d19ee942', class: "title" }, "Delete File"), h("div", { key: 'f32cea38c0fdcbba6753598c2bca19fc1907b44b', class: "message" }, this.delete_loading ? 'Deleting file...' : 'Are you sure you want to delete this file?'), h("div", { key: '2c11182160f49406cdf8573d107e5e9cd7690e4c', class: "file-name", title: this.delete_file_name }, this.delete_file_name), this.delete_loading &&
976
+ h("div", { key: 'bb3e1fbafffce7ea4a1c1e43b32219973b220848', class: "delete-loader", "aria-hidden": "true" }, h("span", { key: '3521881d7325c02ca6624d1f09bc5e4ab05ecdbd', class: "spinner" })), h("div", { key: 'da492d943dbc6a88f58652c1590eb4095cecc833', class: "modal-actions" }, h("button", { key: '136255109de5cd76b8d3067605f1b2214122272d', type: "button", class: "btn secondary", onClick: () => this.cancel_delete(), disabled: this.delete_loading }, "Cancel"), h("button", { key: '750c19696695c581b08b466f19c07947b637b8bf', type: "button", class: "btn destructive", onClick: () => this.confirm_delete(), disabled: this.delete_loading }, this.delete_loading ? 'Deleting...' : 'Delete'))))));
977
977
  }
978
978
  static get watchers() { return {
979
979
  "nodeId": [{
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-DovZQ7sb.js';
2
- import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-BR2c80mW.js';
2
+ import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-CWIhN33k.js';
3
3
 
4
4
  /**
5
5
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
@@ -693,7 +693,7 @@ const PhirepassTerminal = class {
693
693
  this.usernameBuffer = "";
694
694
  }
695
695
  render() {
696
- return (h$1(Host, { key: '8bc2181d5ca26f6e6552591b7d399f81bece3efa' }, h$1("div", { key: '4c7085ba44cebb23f7712fbfe4ea52a9e8bde6d7', id: "ccc", ref: el => (this.containerEl = el) })));
696
+ return (h$1(Host, { key: '502a46c25541e7b9eea5b716f3806f6045b19049' }, h$1("div", { key: 'fae18cfb592bcc346e9203f2491fc661bd7bff5a', id: "ccc", ref: el => (this.containerEl = el) })));
697
697
  }
698
698
  static get watchers() { return {
699
699
  "nodeId": [{
@@ -17,5 +17,5 @@ var patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(async (options) => {
19
19
  await globalScripts();
20
- return bootstrapLazy([["phirepass-sftp-client",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-vnc",[[513,"phirepass-vnc",{"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"scaleViewport":[4,"scale-viewport"],"resizeSession":[4,"resize-session"],"serverId":[1,"server-id"],"passwordPrompt":[32],"statusMessage":[32]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
20
+ return bootstrapLazy([["phirepass-rdp",[[513,"phirepass-rdp",{"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"username":[1],"password":[1],"destination":[1],"scale":[1],"serverId":[1,"server-id"],"credentialsPrompt":[32],"statusMessage":[32]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-sftp-client",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"show_upload_modal":[32],"upload_progress":[32],"upload_file_name":[32],"upload_speed":[32],"upload_finished":[32],"show_download_modal":[32],"download_progress":[32],"download_file_name":[32],"download_speed":[32],"download_finished":[32],"show_delete_modal":[32],"delete_file_name":[32],"delete_loading":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"serviceId":[1,"service-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
21
21
  });
@@ -143,13 +143,22 @@ class Channel {
143
143
  wasm.channel_on_protocol_message_type(this.__wbg_ptr, ptr0, len0, isLikeNone(cb) ? 0 : addHeapObject(cb));
144
144
  }
145
145
  /**
146
+ * Requests an RDP tunnel. Credentials are validated by the agent but are
147
+ * not used to log in: CredSSP runs in the browser's own RDP client, inside
148
+ * the tunnel.
149
+ *
150
+ * Unlike the other protocols this does **not** yield a `TunnelOpened`.
151
+ * The answer is an `RDPAuthorized` frame carrying a `sid` and a single-use
152
+ * `ticket`; the RDP client then opens its own socket at
153
+ * `/api/web/rdp/{node_id}` and presents that ticket in its RDCleanPath
154
+ * request. No tunnel data for an RDP session ever crosses *this* channel.
146
155
  * @param {string} node_id
147
156
  * @param {string} service_id
148
157
  * @param {string | null} [username]
149
158
  * @param {string | null} [password]
150
159
  * @param {number | null} [msg_id]
151
160
  */
152
- open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
161
+ open_rdp_tunnel(node_id, service_id, username, password, msg_id) {
153
162
  const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
154
163
  const len0 = WASM_VECTOR_LEN;
155
164
  const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -158,7 +167,7 @@ class Channel {
158
167
  var len2 = WASM_VECTOR_LEN;
159
168
  var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
160
169
  var len3 = WASM_VECTOR_LEN;
161
- wasm.channel_open_sftp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
170
+ wasm.channel_open_rdp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
162
171
  }
163
172
  /**
164
173
  * @param {string} node_id
@@ -167,7 +176,7 @@ class Channel {
167
176
  * @param {string | null} [password]
168
177
  * @param {number | null} [msg_id]
169
178
  */
170
- open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
179
+ open_sftp_tunnel(node_id, service_id, username, password, msg_id) {
171
180
  const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
172
181
  const len0 = WASM_VECTOR_LEN;
173
182
  const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
@@ -176,21 +185,25 @@ class Channel {
176
185
  var len2 = WASM_VECTOR_LEN;
177
186
  var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
178
187
  var len3 = WASM_VECTOR_LEN;
179
- wasm.channel_open_ssh_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
188
+ wasm.channel_open_sftp_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
180
189
  }
181
190
  /**
182
- * VNC takes no credentials: the RFB password challenge is answered by the
183
- * browser's VNC client inside the tunnel itself.
184
191
  * @param {string} node_id
185
192
  * @param {string} service_id
193
+ * @param {string | null} [username]
194
+ * @param {string | null} [password]
186
195
  * @param {number | null} [msg_id]
187
196
  */
188
- open_vnc_tunnel(node_id, service_id, msg_id) {
197
+ open_ssh_tunnel(node_id, service_id, username, password, msg_id) {
189
198
  const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
190
199
  const len0 = WASM_VECTOR_LEN;
191
200
  const ptr1 = passStringToWasm0(service_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
192
201
  const len1 = WASM_VECTOR_LEN;
193
- wasm.channel_open_vnc_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
202
+ var ptr2 = isLikeNone(username) ? 0 : passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
203
+ var len2 = WASM_VECTOR_LEN;
204
+ var ptr3 = isLikeNone(password) ? 0 : passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
205
+ var len3 = WASM_VECTOR_LEN;
206
+ wasm.channel_open_ssh_tunnel(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(msg_id) ? Number.MAX_SAFE_INTEGER : (msg_id) >>> 0);
194
207
  }
195
208
  /**
196
209
  * @param {string} node_id
@@ -322,21 +335,6 @@ class Channel {
322
335
  const len1 = WASM_VECTOR_LEN;
323
336
  wasm.channel_send_ssh_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
324
337
  }
325
- /**
326
- * Takes bytes rather than a string (unlike [`Channel::send_ssh_tunnel_data`]):
327
- * RFB client messages are binary and would not survive a UTF-8 round trip.
328
- * `Vec<u8>` arrives from JS as a `Uint8Array` with no re-encoding.
329
- * @param {string} node_id
330
- * @param {number} sid
331
- * @param {Uint8Array} data
332
- */
333
- send_vnc_tunnel_data(node_id, sid, data) {
334
- const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
335
- const len0 = WASM_VECTOR_LEN;
336
- const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export);
337
- const len1 = WASM_VECTOR_LEN;
338
- wasm.channel_send_vnc_tunnel_data(this.__wbg_ptr, ptr0, len0, sid, ptr1, len1);
339
- }
340
338
  /**
341
339
  * @param {number} interval_as_millis
342
340
  */
@@ -462,7 +460,7 @@ function __wbg_get_imports() {
462
460
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
463
461
  return addHeapObject(ret);
464
462
  }, arguments); },
465
- __wbg_info_126a81f879b26b73: function(arg0, arg1) {
463
+ __wbg_info_e70a4ed57b90fedf: function(arg0, arg1) {
466
464
  console.info(getStringFromWasm0(arg0, arg1));
467
465
  },
468
466
  __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
@@ -534,7 +532,7 @@ function __wbg_get_imports() {
534
532
  __wbg_set_onopen_4f65470ae522a61a: function(arg0, arg1) {
535
533
  getObject(arg0).onopen = getObject(arg1);
536
534
  },
537
- __wbg_warn_a34cc328d5dc529a: function(arg0, arg1) {
535
+ __wbg_warn_5c89b14defca8e2c: function(arg0, arg1) {
538
536
  console.warn(getStringFromWasm0(arg0, arg1));
539
537
  },
540
538
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
@@ -924,6 +922,7 @@ var ProtocolMessageType;
924
922
  ProtocolMessageType["TunnelOpened"] = "TunnelOpened";
925
923
  ProtocolMessageType["TunnelClosed"] = "TunnelClosed";
926
924
  ProtocolMessageType["TunnelData"] = "TunnelData";
925
+ ProtocolMessageType["RDPAuthorized"] = "RDPAuthorized";
927
926
  ProtocolMessageType["SFTPListItems"] = "SFTPListItems";
928
927
  ProtocolMessageType["SFTPDownloadStartResponse"] = "SFTPDownloadStartResponse";
929
928
  ProtocolMessageType["SFTPDownloadChunk"] = "SFTPDownloadChunk";