phirepass-widgets 0.0.90 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-Dtiw2goq.js → index-BLYhwhwD.js} +35 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/phirepass-rdp.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
- package/dist/cjs/phirepass-widgets.cjs.js +2 -2
- package/dist/cjs/{protocol-6iRtl9NT.js → protocol-DB9k4E9f.js} +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/components/index.js +1 -1
- package/dist/{phirepass-widgets/p-BMaBl_t5.js → components/p-D_8OF2F8.js} +1 -1
- package/dist/components/phirepass-rdp.js +1 -1
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +1 -1
- package/dist/esm/{index-Buu-IaNK.js → index-T-yV-0EO.js} +35 -6
- package/dist/esm/loader.js +2 -2
- package/dist/esm/phirepass-rdp.entry.js +2 -2
- package/dist/esm/phirepass-sftp-client.entry.js +2 -2
- package/dist/esm/phirepass-terminal.entry.js +2 -2
- package/dist/esm/phirepass-widgets.js +3 -3
- package/dist/esm/{protocol-BMaBl_t5.js → protocol-D_8OF2F8.js} +2 -2
- package/dist/phirepass-widgets/{p-85dc1c9b.entry.js → p-324c767b.entry.js} +1 -1
- package/dist/phirepass-widgets/{p-1830eb5a.entry.js → p-6f5e5bc1.entry.js} +1 -1
- package/dist/{components/p-BMaBl_t5.js → phirepass-widgets/p-D_8OF2F8.js} +1 -1
- package/dist/phirepass-widgets/p-T-yV-0EO.js +3 -0
- package/dist/phirepass-widgets/{p-003c3d4b.entry.js → p-eea8f84b.entry.js} +1 -1
- package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +11 -0
- package/package.json +3 -3
- package/dist/phirepass-widgets/p-Buu-IaNK.js +0 -2
|
@@ -4,7 +4,7 @@ const NAMESPACE = 'phirepass-widgets';
|
|
|
4
4
|
const BUILD = /* phirepass-widgets */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
Stencil Client Platform v4.
|
|
7
|
+
Stencil Client Platform v4.44.0 | MIT Licensed | https://stenciljs.com
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
|
|
@@ -96,7 +96,9 @@ var consoleError = (e, el) => (0, console.error)(e, el);
|
|
|
96
96
|
|
|
97
97
|
// src/client/client-load-module.ts
|
|
98
98
|
var cmpModules = /* @__PURE__ */ new Map();
|
|
99
|
+
var failedLoadAttempts = /* @__PURE__ */ new Map();
|
|
99
100
|
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
101
|
+
var _a;
|
|
100
102
|
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
|
|
101
103
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
102
104
|
if (!bundleId) {
|
|
@@ -106,21 +108,28 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
106
108
|
if (module) {
|
|
107
109
|
return module[exportName];
|
|
108
110
|
}
|
|
111
|
+
const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
|
|
112
|
+
const cacheBustParams = [
|
|
113
|
+
retryCount > 0 ? `s-retry=${retryCount}` : "",
|
|
114
|
+
""
|
|
115
|
+
].filter(Boolean).join("&");
|
|
109
116
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
110
117
|
return import(
|
|
111
118
|
/* @vite-ignore */
|
|
112
119
|
/* webpackInclude: /\.entry\.js$/ */
|
|
113
120
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
114
121
|
/* webpackMode: "lazy" */
|
|
115
|
-
`./${bundleId}.entry.js${""}`
|
|
122
|
+
`./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
|
|
116
123
|
).then(
|
|
117
124
|
(importedModule) => {
|
|
118
125
|
{
|
|
126
|
+
failedLoadAttempts.delete(bundleId);
|
|
119
127
|
cmpModules.set(bundleId, importedModule);
|
|
120
128
|
}
|
|
121
129
|
return importedModule[exportName];
|
|
122
130
|
},
|
|
123
131
|
(e) => {
|
|
132
|
+
failedLoadAttempts.set(bundleId, retryCount + 1);
|
|
124
133
|
consoleError(e, hostRef.$hostElement$);
|
|
125
134
|
}
|
|
126
135
|
);
|
|
@@ -130,6 +139,8 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
130
139
|
var styles = /* @__PURE__ */ new Map();
|
|
131
140
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
132
141
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
142
|
+
var MAX_LAZY_LOAD_RETRIES = 3;
|
|
143
|
+
var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
|
|
133
144
|
var win = typeof window !== "undefined" ? window : {};
|
|
134
145
|
var plt = {
|
|
135
146
|
$flags$: 0,
|
|
@@ -156,6 +167,10 @@ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @_
|
|
|
156
167
|
var queuePending = false;
|
|
157
168
|
var queueDomReads = [];
|
|
158
169
|
var queueDomWrites = [];
|
|
170
|
+
var scheduleFlush = () => {
|
|
171
|
+
var _a;
|
|
172
|
+
return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
|
|
173
|
+
};
|
|
159
174
|
var queueTask = (queue, write) => (cb) => {
|
|
160
175
|
queue.push(cb);
|
|
161
176
|
if (!queuePending) {
|
|
@@ -163,7 +178,7 @@ var queueTask = (queue, write) => (cb) => {
|
|
|
163
178
|
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
164
179
|
nextTick(flush);
|
|
165
180
|
} else {
|
|
166
|
-
|
|
181
|
+
scheduleFlush();
|
|
167
182
|
}
|
|
168
183
|
}
|
|
169
184
|
};
|
|
@@ -182,7 +197,7 @@ var flush = () => {
|
|
|
182
197
|
{
|
|
183
198
|
consume(queueDomWrites);
|
|
184
199
|
if (queuePending = queueDomReads.length > 0) {
|
|
185
|
-
|
|
200
|
+
scheduleFlush();
|
|
186
201
|
}
|
|
187
202
|
}
|
|
188
203
|
};
|
|
@@ -374,6 +389,11 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
374
389
|
} else if (child != null && typeof child !== "boolean") {
|
|
375
390
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
376
391
|
child = String(child);
|
|
392
|
+
} else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
393
|
+
{
|
|
394
|
+
consoleError("Invalid vNode child");
|
|
395
|
+
}
|
|
396
|
+
continue;
|
|
377
397
|
}
|
|
378
398
|
if (simple && lastSimple) {
|
|
379
399
|
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
@@ -1337,10 +1357,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1337
1357
|
|
|
1338
1358
|
// src/runtime/initialize-component.ts
|
|
1339
1359
|
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1360
|
+
var _a;
|
|
1340
1361
|
let Cstr;
|
|
1341
1362
|
try {
|
|
1342
1363
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1343
1364
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1365
|
+
hostRef.$flags$ &= -1025 /* hasFailedLoad */;
|
|
1344
1366
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1345
1367
|
if (bundleId) {
|
|
1346
1368
|
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
@@ -1352,6 +1374,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1352
1374
|
Cstr = CstrImport;
|
|
1353
1375
|
}
|
|
1354
1376
|
if (!Cstr) {
|
|
1377
|
+
hostRef.$flags$ &= -33 /* hasInitializedComponent */;
|
|
1378
|
+
hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
|
|
1379
|
+
if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
|
|
1380
|
+
hostRef.$flags$ |= 1024 /* hasFailedLoad */;
|
|
1381
|
+
}
|
|
1355
1382
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
1356
1383
|
}
|
|
1357
1384
|
if (!Cstr.isProxied) {
|
|
@@ -1413,7 +1440,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1413
1440
|
hostRef.$onRenderResolve$();
|
|
1414
1441
|
hostRef.$onRenderResolve$ = void 0;
|
|
1415
1442
|
}
|
|
1416
|
-
if (hostRef.$onReadyResolve$) {
|
|
1443
|
+
if (hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
|
|
1417
1444
|
hostRef.$onReadyResolve$(elm);
|
|
1418
1445
|
}
|
|
1419
1446
|
}
|
|
@@ -1459,6 +1486,8 @@ var connectedCallback = (elm) => {
|
|
|
1459
1486
|
} else {
|
|
1460
1487
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1461
1488
|
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1489
|
+
} else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
|
|
1490
|
+
setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
|
|
1462
1491
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1463
1492
|
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1464
1493
|
}
|
|
@@ -1568,7 +1597,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1568
1597
|
}
|
|
1569
1598
|
disconnectedCallback() {
|
|
1570
1599
|
plt.jmp(() => disconnectedCallback(this));
|
|
1571
|
-
|
|
1600
|
+
nextTick(() => {
|
|
1572
1601
|
var _a3;
|
|
1573
1602
|
const hostRef = getHostRef(this);
|
|
1574
1603
|
if (!hostRef) {
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var protocol = require('./protocol-
|
|
3
|
+
var index = require('./index-BLYhwhwD.js');
|
|
4
|
+
var protocol = require('./protocol-DB9k4E9f.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* RDP's display-control PDU describes a monitor in whole, even pixels within
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var protocol = require('./protocol-
|
|
3
|
+
var index = require('./index-BLYhwhwD.js');
|
|
4
|
+
var protocol = require('./protocol-DB9k4E9f.js');
|
|
5
5
|
|
|
6
6
|
const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var protocol = require('./protocol-
|
|
3
|
+
var index = require('./index-BLYhwhwD.js');
|
|
4
|
+
var protocol = require('./protocol-DB9k4E9f.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-BLYhwhwD.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.
|
|
8
|
+
Stencil Client Patch Browser v4.44.0 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var patchBrowser = () => {
|
|
@@ -463,7 +463,7 @@ function __wbg_get_imports() {
|
|
|
463
463
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
464
464
|
return addHeapObject(ret);
|
|
465
465
|
}, arguments); },
|
|
466
|
-
|
|
466
|
+
__wbg_info_28496918efd7b637: function(arg0, arg1) {
|
|
467
467
|
console.info(getStringFromWasm0(arg0, arg1));
|
|
468
468
|
},
|
|
469
469
|
__wbg_instanceof_ArrayBuffer_993d02d2d254cad1: function(arg0) {
|
|
@@ -535,7 +535,7 @@ function __wbg_get_imports() {
|
|
|
535
535
|
__wbg_set_onopen_b28699f3431204cf: function(arg0, arg1) {
|
|
536
536
|
getObject(arg0).onopen = getObject(arg1);
|
|
537
537
|
},
|
|
538
|
-
|
|
538
|
+
__wbg_warn_27981501f203555e: function(arg0, arg1) {
|
|
539
539
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
540
540
|
},
|
|
541
541
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
@@ -909,7 +909,7 @@ async function __wbg_init(module_or_path) {
|
|
|
909
909
|
}
|
|
910
910
|
|
|
911
911
|
if (module_or_path === undefined) {
|
|
912
|
-
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-
|
|
912
|
+
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-DB9k4E9f.js', document.baseURI).href)));
|
|
913
913
|
}
|
|
914
914
|
const imports = __wbg_get_imports();
|
|
915
915
|
|
|
Binary file
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],s=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);s&&Object.defineProperty(e,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),a=!!u&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),p=!1,d=[],h=[],m=(t,e)=>n=>{t.push(n),p||(p=!0,e&&4&f.i?$(y):f.raf(y))},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},y=()=>{b(d),b(h),(p=d.length>0)&&f.raf(y)},$=t=>Promise.resolve(void 0).then(t),v=m(h,!0),g=t=>{const e=new URL(t,f.u);return e.origin!==r.location.origin?e.href:e.pathname},w=t=>f.u=t;function j(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var O,S=new WeakMap,k=t=>"sc-"+t.p,M=t=>"object"==(t=typeof t)||"function"===t,E=(t,e,...n)=>{let o=null,l=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof t&&!M(o))&&(o+=""),s&&i?r[r.length-1].h+=o:r.push(s?A(null,o):o),i=s)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const f=A(t,null);return f.m=e,r.length>0&&(f.$=r),f.v=l,f},A=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,$:null,m:null,v:null}),C={},x=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},L=(t,e)=>null==t||M(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,N=(t,e)=>{const n=t;return{emit:t=>_(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},_=(t,e,n)=>{const o=f.ce(e,n);return t.dispatchEvent(o),o},D=(t,e,n,s,i,c)=>{if(n===s)return;let u=l(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,o=P(n);let l=P(s);e.remove(...o.filter((t=>t&&!l.includes(t)))),e.add(...l.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&K(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let l;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(l=t[1])}}return l||(l=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const o=M(s);if((u||o&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const o=null==s?"":s;"list"===e?u=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==s||!1===s?!1===s&&""!==t.getAttribute(e)||t.removeAttribute(e):(!u||4&c||i)&&!o&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):l(r,a)?a.slice(2):a[2]+e.slice(3),n||s){const o=e.endsWith(R);e=e.replace(U,""),n&&f.rel(t,e,n,o),s&&f.ael(t,e,s,o)}},H=/\s/,P=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(H):[]),R="Capture",U=RegExp(R+"$"),W=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.m||{},s=e.m||{};for(const t of F(Object.keys(l)))t in s||D(o,t,l[t],void 0,n,e.i);for(const t of F(Object.keys(s)))D(o,t,l[t],s[t],n,e.i)};function F(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,q=!1,z=[],T=[],Y=(t,e,n)=>{const o=e.$[n];let l,s,i=0;if(null!=o.h)l=o.O=r.document.createTextNode(o.h);else{if(q||(q="svg"===o.j),!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=r.document.createElementNS(q?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.j),q&&"foreignObject"===o.j&&(q=!1),W(null,o,q),o.$){const e="template"===o.j?l.content:l;for(i=0;i<o.$.length;++i)s=Y(t,o,i),s&&e.appendChild(s)}"svg"===o.j?q=!1:"foreignObject"===l.tagName&&(q=!0)}return l["s-hn"]=O,l},Z=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===O&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);l<=s;++l)o[l]&&(i=Y(null,n,l),i&&(o[l].O=i,Q(r,i,e)))},B=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;J(e),t&&t.remove()}}},G=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.v&&e.v&&(t.v=e.v),!0):t.v===e.v),I=(t,e,n=!1)=>{const o=e.O=t.O,l=t.$,s=e.$,i=e.j,r=e.h;null==r?(q="svg"===i||"foreignObject"!==i&&q,"slot"!==i||V||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{f.i|=1;const e=t.closest(O.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(Q(e,t,null!=n?n:null),t["s-sh"]=void 0)}f.i&=-2})(e.O.parentElement)),W(t,e,q),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=e.length-1,p=e[0],d=e[a],h=o.length-1,m=o[0],b=o[h];const y="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==p)p=e[++r];else if(null==d)d=e[--a];else if(null==m)m=o[++c];else if(null==b)b=o[--h];else if(G(p,m,l))I(p,m,l),p=e[++r],m=o[++c];else if(G(d,b,l))I(d,b,l),d=e[--a],b=o[--h];else if(G(p,b,l))I(p,b,l),Q(y,p.O,d.O.nextSibling),p=e[++r],b=o[--h];else if(G(d,m,l))I(d,m,l),Q(y,d.O,p.O),d=e[--a],m=o[++c];else{for(f=-1,u=r;u<=a;++u)if(e[u]&&null!==e[u].v&&e[u].v===m.v){f=u;break}f>=0?(i=e[f],i.j!==m.j?s=Y(e&&e[c],n,f):(I(i,m,l),e[f]=void 0,s=i.O),m=o[++c]):(s=Y(e&&e[c],n,c),m=o[++c]),s&&Q(p.O.parentNode,s,p.O)}r>a?Z(t,null==o[h+1]?null:o[h+1].O,n,o,c,h):c>h&&B(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.h&&(o.textContent=""),Z(o,null,e,s,0,s.length-1)):!n&&null!==l&&B(l,0,l.length-1),q&&"svg"===i&&(q=!1)):t.h!==r&&(o.data=r)},J=t=>{t.m&&t.m.ref&&z.push((()=>t.m.ref(null))),t.$&&t.$.map(J)},K=(t,e)=>{T.push((()=>t(e)))},Q=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),X=(t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,s=t.k||A(null,null),i=(t=>t&&t.j===C)(e)?e:E(null,null,e);if(O=o.tagName,n&&i.m)for(const t of Object.keys(i.m))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=o[t]);i.j=null,i.i|=4,t.k=i,i.O=s.O=o.shadowRoot||o,V=!(!(1&l.i)||128&l.i),I(s,i,n),z.forEach((t=>t())),z.length=0,T.forEach((t=>t())),T.length=0},tt=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},et=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);tt(t,t.A);const n=()=>nt(t,e);if(!e)return v(n);queueMicrotask((()=>{n()}))},nt=(t,e)=>{const n=t.$hostElement$,o=n;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=ft(o,e?"componentWillLoad":"componentWillUpdate",void 0,n),l=ot(l,(()=>ft(o,"componentWillRender",void 0,n))),ot(l,(()=>st(t,o,e)))},ot=(t,e)=>lt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),lt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,st=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.i,l=((t,e)=>{var n,o,l;const s=k(e),c=i.get(s);if(!r.document)return s;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let l,i=S.get(t=t.head||t);if(i||S.set(t,i=new Set),!i.has(s)){l=r.document.createElement("style"),l.textContent=c;const p=null!=(n=f.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=p&&l.setAttribute("nonce",p),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(c),a?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=c+e.textContent:t.prepend(l)}else t.append(l);1&e.i&&t.insertBefore(l,null),4&e.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=S.get(t);if(e||S.set(t,e=new Set),!e.has(s)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(c.constructor===n.CSSStyleSheet)o=c;else{o=new n.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)o.insertRule(c.cssRules[t].cssText,t)}a?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);it(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>rt(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},it=(t,e,n,o)=>{try{e=e.render(),t.i&=-17,t.i|=2,X(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},rt=t=>{const e=t.$hostElement$,n=e,o=t.A;ft(n,"componentDidRender",void 0,e),64&t.i?ft(n,"componentDidUpdate",void 0,e):(t.i|=64,ut(e),ft(n,"componentDidLoad",void 0,e),t.L(e),o||ct()),t.M&&(t.M(),t.M=void 0),512&t.i&&$((()=>et(t,!1))),t.i&=-517},ct=()=>{$((()=>_(r,"appload",{detail:{namespace:"phirepass-widgets"}})))},ft=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,o)}},ut=t=>t.classList.add("hydrated"),at=(t,e,n,l)=>{const i=o(t);if(!i)return;const r=t,c=i.l.get(e),f=i.i,u=r;if(!((n=L(n,l.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.l.set(e,n),l.N){const t=l.N[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&f||1&l)&&(u?u[o](n,c,e):i._.push((()=>{i.D[o](n,c,e)})))}catch(t){s(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,c,e)&&!(16&f))return;16&f||et(i,!1)}}},pt=(e,n)=>{var l,s;const i=e.prototype;{e.watchers&&!n.N&&(n.N=x(e.watchers)),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.P&&(n.P=e.serializers);const r=Object.entries(null!=(l=n.t)?l:{});r.map((([e,[l]])=>{if(31&l||32&l){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>o(this).l.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=o(this);if(s){if(r)return void 0===(32&l?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),r.call(this,L(t,l)),void at(this,e,t=32&l?this[e]:s.$hostElement$[e],n);at(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,l,s){f.jmp((()=>{var c;const f=t.get(e),u=o(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==l){const o=this,i=null==(c=n.N)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=o[i]&&(128&t||1&r)&&o[i].call(o,s,l,e)}))}return}const a=r.find((([t])=>t===f)),p=a&&4&a[1][0],d=p&&null===s&&void 0===this[f];p&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);d||s==this[f]||h.get&&!h.set||(this[f]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.N)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},dt=(t,e)=>{const l={i:e[0],p:e[1]};try{l.t=e[2],l.N=x(t.N),l.H=t.H,l.P=t.P;const r=t.prototype.connectedCallback,c=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const o={i:0,$hostElement$:t,o:e,l:new Map,R:new Map};o.U=new Promise((t=>o.L=t)),t["s-p"]=[],t["s-rc"]=[];const l=o;t.__stencil__getHostRef=()=>l,512&e.i&&n(t,o)})(this,l)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!o(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.i)(null==e?void 0:e.D)||(null==e?void 0:e.U)&&e.U.then((()=>{}));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){tt(e,e.A=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.i)&&(e.i|=32,o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const e=k(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);u&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.i)),o()}}const l=e.A,s=()=>et(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),e.L&&e.L(t)}})(t,e,n)}l()}})(this),r&&r.call(this)},disconnectedCallback(){(async t=>{S.has(t)&&S.delete(t),t.shadowRoot&&S.has(t.shadowRoot)&&S.delete(t.shadowRoot)})(this),c&&c.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${l.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else j.call(this,l)}}),Object.defineProperty(t,"is",{value:l.p,configurable:!0}),pt(t,l)}catch(e){return s(e),t}},ht=t=>f.C=t,mt=t=>Object.assign(f,t),bt=new WeakMap;function yt(t,e){let n=bt.get(e);n||(n={i:0,o:{i:0,p:e.tagName},$hostElement$:e},bt.set(e,n)),X(n,t)}function $t(t){return t}export{c as H,C as a,N as c,g as getAssetPath,E as h,dt as p,yt as render,w as setAssetPath,ht as setNonce,mt as setPlatformOptions,$t as t}
|
|
1
|
+
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],s=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);s&&Object.defineProperty(e,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),a=!!u&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),d=!1,p=[],h=[],m=()=>{var t;return(null==(t=r.document)?void 0:t.hidden)?$(v):f.raf(v)},b=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&f.i?$(v):m())},y=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},v=()=>{y(p),y(h),(d=p.length>0)&&m()},$=t=>Promise.resolve(void 0).then(t),g=b(h,!0),w=t=>{const e=new URL(t,f.u);return e.origin!==r.location.origin?e.href:e.pathname},j=t=>f.u=t;function O(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var S,k=new WeakMap,M=t=>"sc-"+t.p,E=t=>"object"==(t=typeof t)||"function"===t,A=(t,e,...n)=>{let o=null,l=null,i=!1,r=!1;const c=[],f=e=>{for(let n=0;n<e.length;n++)if(o=e[n],Array.isArray(o))f(o);else if(null!=o&&"boolean"!=typeof o){if(i="function"!=typeof t&&!E(o))o+="";else if("function"!=typeof t&&void 0===o.i){s("Invalid vNode child");continue}i&&r?c[c.length-1].h+=o:c.push(i?C(null,o):o),r=i}};if(f(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=C(t,null);return u.m=e,c.length>0&&(u.v=c),u.$=l,u},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,v:null,m:null,$:null}),x={},N=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},L=(t,e)=>null==t||E(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,_=(t,e)=>{const n=t;return{emit:t=>D(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},D=(t,e,n)=>{const o=f.ce(e,n);return t.dispatchEvent(o),o},H=(t,e,n,s,i,c)=>{if(n===s)return;let u=l(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,o=R(n);let l=R(s);e.remove(...o.filter((t=>t&&!l.includes(t)))),e.add(...l.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&Q(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let l;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(l=t[1])}}return l||(l=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const o=E(s);if((u||o&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const o=null==s?"":s;"list"===e?u=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==s||!1===s?!1===s&&""!==t.getAttribute(e)||t.removeAttribute(e):(!u||4&c||i)&&!o&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):l(r,a)?a.slice(2):a[2]+e.slice(3),n||s){const o=e.endsWith(U);e=e.replace(W,""),n&&f.rel(t,e,n,o),s&&f.ael(t,e,s,o)}},P=/\s/,R=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(P):[]),U="Capture",W=RegExp(U+"$"),F=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.m||{},s=e.m||{};for(const t of T(Object.keys(l)))t in s||H(o,t,l[t],void 0,n,e.i);for(const t of T(Object.keys(s)))H(o,t,l[t],s[t],n,e.i)};function T(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,q=!1,z=[],I=[],Y=(t,e,n)=>{const o=e.v[n];let l,s,i=0;if(null!=o.h)l=o.O=r.document.createTextNode(o.h);else{if(q||(q="svg"===o.j),!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=r.document.createElementNS(q?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.j),q&&"foreignObject"===o.j&&(q=!1),F(null,o,q),o.v){const e="template"===o.j?l.content:l;for(i=0;i<o.v.length;++i)s=Y(t,o,i),s&&e.appendChild(s)}"svg"===o.j?q=!1:"foreignObject"===l.tagName&&(q=!0)}return l["s-hn"]=S,l},Z=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===S&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);l<=s;++l)o[l]&&(i=Y(null,n,l),i&&(o[l].O=i,X(r,i,e)))},B=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;K(e),t&&t.remove()}}},G=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),J=(t,e,n=!1)=>{const o=e.O=t.O,l=t.v,s=e.v,i=e.j,r=e.h;null==r?(q="svg"===i||"foreignObject"!==i&&q,"slot"!==i||V||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{f.i|=1;const e=t.closest(S.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(X(e,t,null!=n?n:null),t["s-sh"]=void 0)}f.i&=-2})(e.O.parentElement)),F(t,e,q),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=e.length-1,d=e[0],p=e[a],h=o.length-1,m=o[0],b=o[h];const y="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==m)m=o[++c];else if(null==b)b=o[--h];else if(G(d,m,l))J(d,m,l),d=e[++r],m=o[++c];else if(G(p,b,l))J(p,b,l),p=e[--a],b=o[--h];else if(G(d,b,l))J(d,b,l),X(y,d.O,p.O.nextSibling),d=e[++r],b=o[--h];else if(G(p,m,l))J(p,m,l),X(y,p.O,d.O),p=e[--a],m=o[++c];else{for(f=-1,u=r;u<=a;++u)if(e[u]&&null!==e[u].$&&e[u].$===m.$){f=u;break}f>=0?(i=e[f],i.j!==m.j?s=Y(e&&e[c],n,f):(J(i,m,l),e[f]=void 0,s=i.O),m=o[++c]):(s=Y(e&&e[c],n,c),m=o[++c]),s&&X(d.O.parentNode,s,d.O)}r>a?Z(t,null==o[h+1]?null:o[h+1].O,n,o,c,h):c>h&&B(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.h&&(o.textContent=""),Z(o,null,e,s,0,s.length-1)):!n&&null!==l&&B(l,0,l.length-1),q&&"svg"===i&&(q=!1)):t.h!==r&&(o.data=r)},K=t=>{t.m&&t.m.ref&&z.push((()=>t.m.ref(null))),t.v&&t.v.map(K)},Q=(t,e)=>{I.push((()=>t(e)))},X=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),tt=(t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,s=t.k||C(null,null),i=(t=>t&&t.j===x)(e)?e:A(null,null,e);if(S=o.tagName,n&&i.m)for(const t of Object.keys(i.m))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=o[t]);i.j=null,i.i|=4,t.k=i,i.O=s.O=o.shadowRoot||o,V=!(!(1&l.i)||128&l.i),J(s,i,n),z.forEach((t=>t())),z.length=0,I.forEach((t=>t())),I.length=0},et=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},nt=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);et(t,t.A);const n=()=>ot(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},ot=(t,e)=>{const n=t.$hostElement$,o=n;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=ut(o,e?"componentWillLoad":"componentWillUpdate",void 0,n),l=lt(l,(()=>ut(o,"componentWillRender",void 0,n))),lt(l,(()=>it(t,o,e)))},lt=(t,e)=>st(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),st=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,it=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.i,l=((t,e)=>{var n,o,l;const s=M(e),c=i.get(s);if(!r.document)return s;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let l,i=k.get(t=t.head||t);if(i||k.set(t,i=new Set),!i.has(s)){l=r.document.createElement("style"),l.textContent=c;const d=null!=(n=f.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=d&&l.setAttribute("nonce",d),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(c),a?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=c+e.textContent:t.prepend(l)}else t.append(l);1&e.i&&t.insertBefore(l,null),4&e.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=k.get(t);if(e||k.set(t,e=new Set),!e.has(s)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(c.constructor===n.CSSStyleSheet)o=c;else{o=new n.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)o.insertRule(c.cssRules[t].cssText,t)}a?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);rt(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ct(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},rt=(t,e,n,o)=>{try{e=e.render(),t.i&=-17,t.i|=2,tt(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},ct=t=>{const e=t.$hostElement$,n=e,o=t.A;ut(n,"componentDidRender",void 0,e),64&t.i?ut(n,"componentDidUpdate",void 0,e):(t.i|=64,at(e),ut(n,"componentDidLoad",void 0,e),t.N(e),o||ft()),t.M&&(t.M(),t.M=void 0),512&t.i&&$((()=>nt(t,!1))),t.i&=-517},ft=()=>{$((()=>D(r,"appload",{detail:{namespace:"phirepass-widgets"}})))},ut=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,o)}},at=t=>t.classList.add("hydrated"),dt=(t,e,n,l)=>{const i=o(t);if(!i)return;const r=t,c=i.l.get(e),f=i.i,u=r;if(!((n=L(n,l.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.l.set(e,n),l.L){const t=l.L[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&f||1&l)&&(u?u[o](n,c,e):i._.push((()=>{i.D[o](n,c,e)})))}catch(t){s(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,c,e)&&!(16&f))return;16&f||nt(i,!1)}}},pt=(e,n)=>{var l,s;const i=e.prototype;{e.watchers&&!n.L&&(n.L=N(e.watchers)),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.P&&(n.P=e.serializers);const r=Object.entries(null!=(l=n.t)?l:{});r.map((([e,[l]])=>{if(31&l||32&l){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>o(this).l.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=o(this);if(s){if(r)return void 0===(32&l?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),r.call(this,L(t,l)),void dt(this,e,t=32&l?this[e]:s.$hostElement$[e],n);dt(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,l,s){f.jmp((()=>{var c;const f=t.get(e),u=o(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==l){const o=this,i=null==(c=n.L)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=o[i]&&(128&t||1&r)&&o[i].call(o,s,l,e)}))}return}const a=r.find((([t])=>t===f)),d=a&&4&a[1][0],p=d&&null===s&&void 0===this[f];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);p||s==this[f]||h.get&&!h.set||(this[f]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.L)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},ht=async(t,e,n)=>{let o;try{if(!(32&e.i)&&(e.i|=32,e.i&=-1025,o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const e=M(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);u&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.i)),o()}}const l=e.A,s=()=>nt(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),!e.N||1024&e.i||e.N(t)}},mt=(t,e)=>{const l={i:e[0],p:e[1]};try{l.t=e[2],l.L=N(t.L),l.H=t.H,l.P=t.P;const s=t.prototype.connectedCallback,i=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const o={i:0,$hostElement$:t,o:e,l:new Map,R:new Map};o.U=new Promise((t=>o.N=t)),t["s-p"]=[],t["s-rc"]=[];const l=o;t.__stencil__getHostRef=()=>l,512&e.i&&n(t,o)})(this,l)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!o(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.i)(null==e?void 0:e.D)||(1024&e.i?setTimeout((()=>ht(t,e,n)),1e3):(null==e?void 0:e.U)&&e.U.then((()=>{})));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){et(e,e.A=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),ht(t,e,n)}l()}})(this),s&&s.call(this)},disconnectedCallback(){(async t=>{k.has(t)&&k.delete(t),t.shadowRoot&&k.has(t.shadowRoot)&&k.delete(t.shadowRoot)})(this),i&&i.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${l.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,l)}}),Object.defineProperty(t,"is",{value:l.p,configurable:!0}),pt(t,l)}catch(e){return s(e),t}},bt=t=>f.C=t,yt=t=>Object.assign(f,t),vt=new WeakMap;function $t(t,e){let n=vt.get(e);n||(n={i:0,o:{i:0,p:e.tagName},$hostElement$:e},vt.set(e,n)),tt(n,t)}function gt(t){return t}export{c as H,x as a,_ as c,w as getAssetPath,A as h,mt as p,$t as render,j as setAssetPath,bt as setNonce,yt as setPlatformOptions,gt as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,_.unregister(this),n}free(){const n=this.__destroy_into_raw();O.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(t,O.__wbindgen_export,O.__wbindgen_export2);O.channel_authenticate(this.__wbg_ptr,r,o,c,P,R(e)?Number.MAX_SAFE_INTEGER:e>>>0)}connect(){O.channel_connect(this.__wbg_ptr)}create_service(n,t,e,r,o,c,i,s,_,u){const a=S(n,O.__wbindgen_export,O.__wbindgen_export2),f=P,b=S(t,O.__wbindgen_export,O.__wbindgen_export2),l=P;var d=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2),w=P;const g=S(r,O.__wbindgen_export,O.__wbindgen_export2),h=P;var p=R(c)?0:S(c,O.__wbindgen_export,O.__wbindgen_export2),y=P,m=R(i)?0:S(i,O.__wbindgen_export,O.__wbindgen_export2),v=P,A=R(s)?0:S(s,O.__wbindgen_export,O.__wbindgen_export2),N=P,T=R(_)?0:S(_,O.__wbindgen_export,O.__wbindgen_export2);O.channel_create_service(this.__wbg_ptr,a,f,b,l,d,w,g,h,o,p,y,m,v,A,N,T,P,R(u)?Number.MAX_SAFE_INTEGER:u>>>0)}delete_service(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(t,O.__wbindgen_export,O.__wbindgen_export2);O.channel_delete_service(this.__wbg_ptr,r,o,c,P,R(e)?Number.MAX_SAFE_INTEGER:e>>>0)}disconnect(){O.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==O.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==O.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(t,O.__wbindgen_export,O.__wbindgen_export2),i=P;var s=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2);const u=O.channel_new(r,o,c,i,s,P);return this.__wbg_ptr=u,_.register(this,this.__wbg_ptr,this),this}on_connection_close(n){O.channel_on_connection_close(this.__wbg_ptr,R(n)?0:u(n))}on_connection_error(n){O.channel_on_connection_error(this.__wbg_ptr,R(n)?0:u(n))}on_connection_message(n){O.channel_on_connection_message(this.__wbg_ptr,R(n)?0:u(n))}on_connection_open(n){O.channel_on_connection_open(this.__wbg_ptr,R(n)?0:u(n))}on_protocol_message(n){O.channel_on_protocol_message(this.__wbg_ptr,R(n)?0:u(n))}on_protocol_message_type(n,t){const e=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_on_protocol_message_type(this.__wbg_ptr,e,P,R(t)?0:u(t))}open_rdp_tunnel(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(t,O.__wbindgen_export,O.__wbindgen_export2),_=P;var u=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_open_rdp_tunnel(this.__wbg_ptr,c,i,s,_,u,a,f,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}open_sftp_tunnel(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(t,O.__wbindgen_export,O.__wbindgen_export2),_=P;var u=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_open_sftp_tunnel(this.__wbg_ptr,c,i,s,_,u,a,f,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}open_ssh_tunnel(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(t,O.__wbindgen_export,O.__wbindgen_export2),_=P;var u=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_open_ssh_tunnel(this.__wbg_ptr,c,i,s,_,u,a,f,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_delete(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(e,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_delete(this.__wbg_ptr,c,i,t,s,_,u,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_ack(n,t,e,r){const o=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_ack(this.__wbg_ptr,o,P,t,e,r)}send_sftp_download_chunk(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_chunk(this.__wbg_ptr,c,P,t,e,r,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_start(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(e,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_start(this.__wbg_ptr,c,i,t,s,_,u,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_list_data(n,t,e,r){const o=S(n,O.__wbindgen_export,O.__wbindgen_export2),c=P,i=S(e,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_list_data(this.__wbg_ptr,o,c,t,i,P,R(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_upload_chunk(n,t,e,r,o,c,i){const s=S(n,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=function(n){const t=(0,O.__wbindgen_export)(1*n.length,1)>>>0;return h().set(n,t/1),P=n.length,t}(c);O.channel_send_sftp_upload_chunk(this.__wbg_ptr,s,_,t,e,r,o,u,P,R(i)?Number.MAX_SAFE_INTEGER:i>>>0)}send_sftp_upload_start(n,t,e,r,o,c,i){const s=S(n,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_upload_start(this.__wbg_ptr,s,_,t,u,a,f,P,o,c,R(i)?Number.MAX_SAFE_INTEGER:i>>>0)}send_ssh_terminal_resize(n,t,e,r,o,c){const i=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_ssh_terminal_resize(this.__wbg_ptr,i,P,t,e,r,o,c)}send_ssh_tunnel_data(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(e,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_ssh_tunnel_data(this.__wbg_ptr,r,o,t,c,P)}start_heartbeat(n){O.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){O.channel_stop_heartbeat(this.__wbg_ptr)}update_service(n,t,e,r,o,c,i,s,_,u,a){const f=S(n,O.__wbindgen_export,O.__wbindgen_export2),b=P,l=S(t,O.__wbindgen_export,O.__wbindgen_export2),d=P,w=S(e,O.__wbindgen_export,O.__wbindgen_export2),g=P;var h=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2),p=P;const y=S(o,O.__wbindgen_export,O.__wbindgen_export2),m=P;var v=R(i)?0:S(i,O.__wbindgen_export,O.__wbindgen_export2),A=P,N=R(s)?0:S(s,O.__wbindgen_export,O.__wbindgen_export2),T=P,U=R(_)?0:S(_,O.__wbindgen_export,O.__wbindgen_export2),j=P,F=R(u)?0:S(u,O.__wbindgen_export,O.__wbindgen_export2);O.channel_update_service(this.__wbg_ptr,f,b,l,d,w,g,h,p,y,m,c,v,A,N,T,U,j,F,P,R(a)?Number.MAX_SAFE_INTEGER:a>>>0)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(){const n={__proto__:null,__wbg_Error_408e67f47ca7b58b:function(n,t){return u(Error(w(n,t)))},__wbg_String_8564e559799eccda:function(n,t){const e=S(String(p(t)),O.__wbindgen_export,O.__wbindgen_export2),r=P;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_debug_string_a57024b9c6e4a48b:function(n,t){const e=S(f(p(t)),O.__wbindgen_export,O.__wbindgen_export2),r=P;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_string_get_d154f1e671052120:function(n,t){const e=p(t),r="string"==typeof e?e:void 0;var o=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2),c=P;d().setInt32(n+4,c,!0),d().setInt32(n+0,o,!0)},__wbg___wbindgen_throw_bb96b2010945f0bc:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_be22cc64ae6946a0:function(n){p(n)._wbg_cb_unref()},__wbg_call_0f2a9af232c18fd2:function(){return y((function(n,t,e,r){return u(p(n).call(p(t),p(e),p(r)))}),arguments)},__wbg_call_1c5886ab9c57d1c7:function(){return y((function(n,t){return u(p(n).call(p(t)))}),arguments)},__wbg_call_35dba3c747ad7521:function(){return y((function(n,t,e){return u(p(n).call(p(t),p(e)))}),arguments)},__wbg_clearInterval_26ba580547547579:function(n){return u(clearInterval(N(n)))},__wbg_close_b857478a8d4c1a16:function(){return y((function(n){p(n).close()}),arguments)},__wbg_data_57d8ce4eb5f0a433:function(n){return u(p(n).data)},__wbg_from_74f3d90e0ff11240:function(n){return u(Array.from(p(n)))},__wbg_getRandomValues_a608c4436c19407a:function(){return y((function(n,t){globalThis.crypto.getRandomValues(b(n,t))}),arguments)},__wbg_get_971a0c45d172643f:function(){return y((function(n,t){return u(Reflect.get(p(n),p(t)))}),arguments)},__wbg_info_3417add64a9fc991:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_993d02d2d254cad1:function(n){let t;try{t=p(n)instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_length_36bd29c6848c2144:function(n){return p(n).length},__wbg_new_116be93542d39019:function(){return u(new Array)},__wbg_new_77cc4f4f472aeb81:function(n){return u(new Uint8Array(p(n)))},__wbg_new_ebe3e0f6837f0879:function(){return u(new Object)},__wbg_new_with_str_sequence_d8aa2988e9c191ed:function(){return y((function(n,t,e){return u(new WebSocket(w(n,t),p(e)))}),arguments)},__wbg_prototypesetcall_de8e0d9553586985:function(n,t,e){Uint8Array.prototype.set.call(b(n,t),p(e))},__wbg_push_adb0107829f02d75:function(n,t){return p(n).push(p(t))},__wbg_readyState_fe79161592fd15ce:function(n){return p(n).readyState},__wbg_send_76be66dda8ee844c:function(){return y((function(n,t,e){p(n).send(b(t,e))}),arguments)},__wbg_setInterval_cbf1c35c6a692d37:function(){return y((function(n,t){return u(setInterval(p(n),t))}),arguments)},__wbg_set_6be42768c690e380:function(n,t,e){p(n)[N(t)]=N(e)},__wbg_set_a80955eb93b145c6:function(n,t,e){p(n)[t>>>0]=N(e)},__wbg_set_binaryType_b701908a03166a9f:function(n,t){p(n).binaryType=s[t]},__wbg_set_onclose_cb71fea4ad9056fc:function(n,t){p(n).onclose=p(t)},__wbg_set_onerror_f1491b13f0fea022:function(n,t){p(n).onerror=p(t)},__wbg_set_onmessage_065a797dafa9c437:function(n,t){p(n).onmessage=p(t)},__wbg_set_onopen_b28699f3431204cf:function(n,t){p(n).onopen=p(t)},__wbg_warn_2100e55333f7098c:function(n,t){console.warn(w(n,t))},__wbindgen_cast_0000000000000001:function(n,t){return u(A(n,t,o))},__wbindgen_cast_0000000000000002:function(n,t){return u(A(n,t,c))},__wbindgen_cast_0000000000000003:function(n,t){return u(A(n,t,i))},__wbindgen_cast_0000000000000004:function(n,t){return u(A(n,t,r))},__wbindgen_cast_0000000000000005:function(n){return u(n)},__wbindgen_cast_0000000000000006:function(n,t){return u(b(n,t))},__wbindgen_cast_0000000000000007:function(n,t){return u(w(n,t))},__wbindgen_cast_0000000000000008:function(n){return u(BigInt.asUintN(64,n))},__wbindgen_object_clone_ref:function(n){return u(p(n))},__wbindgen_object_drop_ref:function(n){N(n)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}function r(n,t){O.__wasm_bindgen_func_elem_63(n,t)}function o(n,t,e){O.__wasm_bindgen_func_elem_59(n,t,u(e))}function c(n,t,e){O.__wasm_bindgen_func_elem_59_1(n,t,u(e))}function i(n,t,e){O.__wasm_bindgen_func_elem_59_2(n,t,u(e))}const s=["blob","arraybuffer"],_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>O.__wbg_channel_free(n,1)));function u(n){v===m.length&&m.push(m.length+1);const t=v;return v=m[t],m[t]=n,t}const a="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>O.__wbindgen_export4(n.a,n.b)));function f(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return`${n}`;if("string"==t)return`"${n}"`;if("symbol"==t){const t=n.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=n.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(n)){const t=n.length;let e="[";t>0&&(e+=f(n[0]));for(let r=1;r<t;r++)e+=", "+f(n[r]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let r;if(!(e&&e.length>1))return toString.call(n);if(r=e[1],"Object"==r)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}function b(n,t){return n>>>=0,h().subarray(n/1,n/1+t)}let l=null;function d(){return(null===l||!0===l.buffer.detached||void 0===l.buffer.detached&&l.buffer!==O.memory.buffer)&&(l=new DataView(O.memory.buffer)),l}function w(n,t){return function(n,t){return j+=t,j>=U&&(T=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),T.decode(),j=t),T.decode(h().subarray(n,n+t))}(n>>>0,t)}let g=null;function h(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(O.memory.buffer)),g}function p(n){return m[n]}function y(n,t){try{return n.apply(this,t)}catch(n){O.__wbindgen_export3(u(n))}}let m=new Array(1024).fill(void 0);m.push(void 0,null,!0,!1);let v=m.length;function R(n){return null==n}function A(n,t,e){const r={a:n,b:t,cnt:1},o=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{0==--r.cnt&&(O.__wbindgen_export4(r.a,r.b),r.a=0,a.unregister(r))},a.register(o,r,r),o}function S(n,t,e){if(void 0===e){const e=F.encode(n),r=t(e.length,1)>>>0;return h().subarray(r,r+e.length).set(e),P=e.length,r}let r=n.length,o=t(r,1)>>>0;const c=h();let i=0;for(;i<r;i++){const t=n.charCodeAt(i);if(t>127)break;c[o+i]=t}if(i!==r){0!==i&&(n=n.slice(i)),o=e(o,r,r=i+3*n.length,1)>>>0;const t=h().subarray(o+i,o+r);i+=F.encodeInto(n,t).written,o=e(o,r,i,1)>>>0}return P=i,o}function N(n){const t=p(n);return function(n){n<1028||(m[n]=v,v=n)}(n),t}let T=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});T.decode();const U=2146435072;let j=0;const F=new TextEncoder;"encodeInto"in F||(F.encodeInto=function(n,t){const e=F.encode(n);return t.set(e),{read:n.length,written:e.length}});let O,P=0;async function W(n){if(void 0!==O)return O;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=e();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:r}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if(!n.ok)throw new Error(`failed to fetch Wasm: ${n.status} ${n.statusText} fetching '${n.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;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",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return O=n.exports,l=null,g=null,O}(r)}var $,k,q;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.RDPAuthorized="RDPAuthorized",n.SFTPListItems="SFTPListItems",n.SFTPDownloadStartResponse="SFTPDownloadStartResponse",n.SFTPDownloadChunk="SFTPDownloadChunk",n.SFTPUploadStartResponse="SFTPUploadStartResponse",n.SFTPUploadChunkAck="SFTPUploadChunkAck"}($||($={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(k||(k={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(q||(q={}));export{n as C,t as E,k as I,$ as P,W as _,q as a}
|
|
1
|
+
class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,_.unregister(this),n}free(){const n=this.__destroy_into_raw();O.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(t,O.__wbindgen_export,O.__wbindgen_export2);O.channel_authenticate(this.__wbg_ptr,r,o,c,P,R(e)?Number.MAX_SAFE_INTEGER:e>>>0)}connect(){O.channel_connect(this.__wbg_ptr)}create_service(n,t,e,r,o,c,i,s,_,u){const a=S(n,O.__wbindgen_export,O.__wbindgen_export2),f=P,b=S(t,O.__wbindgen_export,O.__wbindgen_export2),l=P;var d=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2),w=P;const g=S(r,O.__wbindgen_export,O.__wbindgen_export2),h=P;var p=R(c)?0:S(c,O.__wbindgen_export,O.__wbindgen_export2),y=P,m=R(i)?0:S(i,O.__wbindgen_export,O.__wbindgen_export2),v=P,A=R(s)?0:S(s,O.__wbindgen_export,O.__wbindgen_export2),N=P,T=R(_)?0:S(_,O.__wbindgen_export,O.__wbindgen_export2);O.channel_create_service(this.__wbg_ptr,a,f,b,l,d,w,g,h,o,p,y,m,v,A,N,T,P,R(u)?Number.MAX_SAFE_INTEGER:u>>>0)}delete_service(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(t,O.__wbindgen_export,O.__wbindgen_export2);O.channel_delete_service(this.__wbg_ptr,r,o,c,P,R(e)?Number.MAX_SAFE_INTEGER:e>>>0)}disconnect(){O.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==O.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==O.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(t,O.__wbindgen_export,O.__wbindgen_export2),i=P;var s=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2);const u=O.channel_new(r,o,c,i,s,P);return this.__wbg_ptr=u,_.register(this,this.__wbg_ptr,this),this}on_connection_close(n){O.channel_on_connection_close(this.__wbg_ptr,R(n)?0:u(n))}on_connection_error(n){O.channel_on_connection_error(this.__wbg_ptr,R(n)?0:u(n))}on_connection_message(n){O.channel_on_connection_message(this.__wbg_ptr,R(n)?0:u(n))}on_connection_open(n){O.channel_on_connection_open(this.__wbg_ptr,R(n)?0:u(n))}on_protocol_message(n){O.channel_on_protocol_message(this.__wbg_ptr,R(n)?0:u(n))}on_protocol_message_type(n,t){const e=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_on_protocol_message_type(this.__wbg_ptr,e,P,R(t)?0:u(t))}open_rdp_tunnel(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(t,O.__wbindgen_export,O.__wbindgen_export2),_=P;var u=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_open_rdp_tunnel(this.__wbg_ptr,c,i,s,_,u,a,f,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}open_sftp_tunnel(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(t,O.__wbindgen_export,O.__wbindgen_export2),_=P;var u=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_open_sftp_tunnel(this.__wbg_ptr,c,i,s,_,u,a,f,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}open_ssh_tunnel(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(t,O.__wbindgen_export,O.__wbindgen_export2),_=P;var u=R(e)?0:S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_open_ssh_tunnel(this.__wbg_ptr,c,i,s,_,u,a,f,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_delete(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(e,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_delete(this.__wbg_ptr,c,i,t,s,_,u,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_ack(n,t,e,r){const o=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_ack(this.__wbg_ptr,o,P,t,e,r)}send_sftp_download_chunk(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_chunk(this.__wbg_ptr,c,P,t,e,r,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_download_start(n,t,e,r,o){const c=S(n,O.__wbindgen_export,O.__wbindgen_export2),i=P,s=S(e,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_download_start(this.__wbg_ptr,c,i,t,s,_,u,P,R(o)?Number.MAX_SAFE_INTEGER:o>>>0)}send_sftp_list_data(n,t,e,r){const o=S(n,O.__wbindgen_export,O.__wbindgen_export2),c=P,i=S(e,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_list_data(this.__wbg_ptr,o,c,t,i,P,R(r)?Number.MAX_SAFE_INTEGER:r>>>0)}send_sftp_upload_chunk(n,t,e,r,o,c,i){const s=S(n,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=function(n){const t=(0,O.__wbindgen_export)(1*n.length,1)>>>0;return h().set(n,t/1),P=n.length,t}(c);O.channel_send_sftp_upload_chunk(this.__wbg_ptr,s,_,t,e,r,o,u,P,R(i)?Number.MAX_SAFE_INTEGER:i>>>0)}send_sftp_upload_start(n,t,e,r,o,c,i){const s=S(n,O.__wbindgen_export,O.__wbindgen_export2),_=P,u=S(e,O.__wbindgen_export,O.__wbindgen_export2),a=P,f=S(r,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_sftp_upload_start(this.__wbg_ptr,s,_,t,u,a,f,P,o,c,R(i)?Number.MAX_SAFE_INTEGER:i>>>0)}send_ssh_terminal_resize(n,t,e,r,o,c){const i=S(n,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_ssh_terminal_resize(this.__wbg_ptr,i,P,t,e,r,o,c)}send_ssh_tunnel_data(n,t,e){const r=S(n,O.__wbindgen_export,O.__wbindgen_export2),o=P,c=S(e,O.__wbindgen_export,O.__wbindgen_export2);O.channel_send_ssh_tunnel_data(this.__wbg_ptr,r,o,t,c,P)}start_heartbeat(n){O.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){O.channel_stop_heartbeat(this.__wbg_ptr)}update_service(n,t,e,r,o,c,i,s,_,u,a){const f=S(n,O.__wbindgen_export,O.__wbindgen_export2),b=P,l=S(t,O.__wbindgen_export,O.__wbindgen_export2),d=P,w=S(e,O.__wbindgen_export,O.__wbindgen_export2),g=P;var h=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2),p=P;const y=S(o,O.__wbindgen_export,O.__wbindgen_export2),m=P;var v=R(i)?0:S(i,O.__wbindgen_export,O.__wbindgen_export2),A=P,N=R(s)?0:S(s,O.__wbindgen_export,O.__wbindgen_export2),T=P,U=R(_)?0:S(_,O.__wbindgen_export,O.__wbindgen_export2),j=P,F=R(u)?0:S(u,O.__wbindgen_export,O.__wbindgen_export2);O.channel_update_service(this.__wbg_ptr,f,b,l,d,w,g,h,p,y,m,c,v,A,N,T,U,j,F,P,R(a)?Number.MAX_SAFE_INTEGER:a>>>0)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(){const n={__proto__:null,__wbg_Error_408e67f47ca7b58b:function(n,t){return u(Error(w(n,t)))},__wbg_String_8564e559799eccda:function(n,t){const e=S(String(p(t)),O.__wbindgen_export,O.__wbindgen_export2),r=P;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_debug_string_a57024b9c6e4a48b:function(n,t){const e=S(f(p(t)),O.__wbindgen_export,O.__wbindgen_export2),r=P;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_string_get_d154f1e671052120:function(n,t){const e=p(t),r="string"==typeof e?e:void 0;var o=R(r)?0:S(r,O.__wbindgen_export,O.__wbindgen_export2),c=P;d().setInt32(n+4,c,!0),d().setInt32(n+0,o,!0)},__wbg___wbindgen_throw_bb96b2010945f0bc:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_be22cc64ae6946a0:function(n){p(n)._wbg_cb_unref()},__wbg_call_0f2a9af232c18fd2:function(){return y((function(n,t,e,r){return u(p(n).call(p(t),p(e),p(r)))}),arguments)},__wbg_call_1c5886ab9c57d1c7:function(){return y((function(n,t){return u(p(n).call(p(t)))}),arguments)},__wbg_call_35dba3c747ad7521:function(){return y((function(n,t,e){return u(p(n).call(p(t),p(e)))}),arguments)},__wbg_clearInterval_26ba580547547579:function(n){return u(clearInterval(N(n)))},__wbg_close_b857478a8d4c1a16:function(){return y((function(n){p(n).close()}),arguments)},__wbg_data_57d8ce4eb5f0a433:function(n){return u(p(n).data)},__wbg_from_74f3d90e0ff11240:function(n){return u(Array.from(p(n)))},__wbg_getRandomValues_a608c4436c19407a:function(){return y((function(n,t){globalThis.crypto.getRandomValues(b(n,t))}),arguments)},__wbg_get_971a0c45d172643f:function(){return y((function(n,t){return u(Reflect.get(p(n),p(t)))}),arguments)},__wbg_info_28496918efd7b637:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_993d02d2d254cad1:function(n){let t;try{t=p(n)instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_length_36bd29c6848c2144:function(n){return p(n).length},__wbg_new_116be93542d39019:function(){return u(new Array)},__wbg_new_77cc4f4f472aeb81:function(n){return u(new Uint8Array(p(n)))},__wbg_new_ebe3e0f6837f0879:function(){return u(new Object)},__wbg_new_with_str_sequence_d8aa2988e9c191ed:function(){return y((function(n,t,e){return u(new WebSocket(w(n,t),p(e)))}),arguments)},__wbg_prototypesetcall_de8e0d9553586985:function(n,t,e){Uint8Array.prototype.set.call(b(n,t),p(e))},__wbg_push_adb0107829f02d75:function(n,t){return p(n).push(p(t))},__wbg_readyState_fe79161592fd15ce:function(n){return p(n).readyState},__wbg_send_76be66dda8ee844c:function(){return y((function(n,t,e){p(n).send(b(t,e))}),arguments)},__wbg_setInterval_cbf1c35c6a692d37:function(){return y((function(n,t){return u(setInterval(p(n),t))}),arguments)},__wbg_set_6be42768c690e380:function(n,t,e){p(n)[N(t)]=N(e)},__wbg_set_a80955eb93b145c6:function(n,t,e){p(n)[t>>>0]=N(e)},__wbg_set_binaryType_b701908a03166a9f:function(n,t){p(n).binaryType=s[t]},__wbg_set_onclose_cb71fea4ad9056fc:function(n,t){p(n).onclose=p(t)},__wbg_set_onerror_f1491b13f0fea022:function(n,t){p(n).onerror=p(t)},__wbg_set_onmessage_065a797dafa9c437:function(n,t){p(n).onmessage=p(t)},__wbg_set_onopen_b28699f3431204cf:function(n,t){p(n).onopen=p(t)},__wbg_warn_27981501f203555e:function(n,t){console.warn(w(n,t))},__wbindgen_cast_0000000000000001:function(n,t){return u(A(n,t,o))},__wbindgen_cast_0000000000000002:function(n,t){return u(A(n,t,c))},__wbindgen_cast_0000000000000003:function(n,t){return u(A(n,t,i))},__wbindgen_cast_0000000000000004:function(n,t){return u(A(n,t,r))},__wbindgen_cast_0000000000000005:function(n){return u(n)},__wbindgen_cast_0000000000000006:function(n,t){return u(b(n,t))},__wbindgen_cast_0000000000000007:function(n,t){return u(w(n,t))},__wbindgen_cast_0000000000000008:function(n){return u(BigInt.asUintN(64,n))},__wbindgen_object_clone_ref:function(n){return u(p(n))},__wbindgen_object_drop_ref:function(n){N(n)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}function r(n,t){O.__wasm_bindgen_func_elem_63(n,t)}function o(n,t,e){O.__wasm_bindgen_func_elem_59(n,t,u(e))}function c(n,t,e){O.__wasm_bindgen_func_elem_59_1(n,t,u(e))}function i(n,t,e){O.__wasm_bindgen_func_elem_59_2(n,t,u(e))}const s=["blob","arraybuffer"],_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>O.__wbg_channel_free(n,1)));function u(n){v===m.length&&m.push(m.length+1);const t=v;return v=m[t],m[t]=n,t}const a="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>O.__wbindgen_export4(n.a,n.b)));function f(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return`${n}`;if("string"==t)return`"${n}"`;if("symbol"==t){const t=n.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=n.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(n)){const t=n.length;let e="[";t>0&&(e+=f(n[0]));for(let r=1;r<t;r++)e+=", "+f(n[r]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let r;if(!(e&&e.length>1))return toString.call(n);if(r=e[1],"Object"==r)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}function b(n,t){return n>>>=0,h().subarray(n/1,n/1+t)}let l=null;function d(){return(null===l||!0===l.buffer.detached||void 0===l.buffer.detached&&l.buffer!==O.memory.buffer)&&(l=new DataView(O.memory.buffer)),l}function w(n,t){return function(n,t){return j+=t,j>=U&&(T=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),T.decode(),j=t),T.decode(h().subarray(n,n+t))}(n>>>0,t)}let g=null;function h(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(O.memory.buffer)),g}function p(n){return m[n]}function y(n,t){try{return n.apply(this,t)}catch(n){O.__wbindgen_export3(u(n))}}let m=new Array(1024).fill(void 0);m.push(void 0,null,!0,!1);let v=m.length;function R(n){return null==n}function A(n,t,e){const r={a:n,b:t,cnt:1},o=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{0==--r.cnt&&(O.__wbindgen_export4(r.a,r.b),r.a=0,a.unregister(r))},a.register(o,r,r),o}function S(n,t,e){if(void 0===e){const e=F.encode(n),r=t(e.length,1)>>>0;return h().subarray(r,r+e.length).set(e),P=e.length,r}let r=n.length,o=t(r,1)>>>0;const c=h();let i=0;for(;i<r;i++){const t=n.charCodeAt(i);if(t>127)break;c[o+i]=t}if(i!==r){0!==i&&(n=n.slice(i)),o=e(o,r,r=i+3*n.length,1)>>>0;const t=h().subarray(o+i,o+r);i+=F.encodeInto(n,t).written,o=e(o,r,i,1)>>>0}return P=i,o}function N(n){const t=p(n);return function(n){n<1028||(m[n]=v,v=n)}(n),t}let T=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});T.decode();const U=2146435072;let j=0;const F=new TextEncoder;"encodeInto"in F||(F.encodeInto=function(n,t){const e=F.encode(n);return t.set(e),{read:n.length,written:e.length}});let O,P=0;async function W(n){if(void 0!==O)return O;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=e();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:r}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if(!n.ok)throw new Error(`failed to fetch Wasm: ${n.status} ${n.statusText} fetching '${n.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;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",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return O=n.exports,l=null,g=null,O}(r)}var $,k,q;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.RDPAuthorized="RDPAuthorized",n.SFTPListItems="SFTPListItems",n.SFTPDownloadStartResponse="SFTPDownloadStartResponse",n.SFTPDownloadChunk="SFTPDownloadChunk",n.SFTPUploadStartResponse="SFTPUploadStartResponse",n.SFTPUploadChunkAck="SFTPUploadChunkAck"}($||($={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(k||(k={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(q||(q={}));export{n as C,t as E,k as I,$ as P,W as _,q as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as s,c as i,h as o,a as n}from"./index.js";import{_ as r,C as h,a,P as c}from"./p-BMaBl_t5.js";const d=200;function u(t){return!Number.isFinite(t)||t<=0?d:Math.min(8192,Math.max(d,Math.floor(t)))}function l(t){return t-t%2}function p(t){const e=t.getBoundingClientRect();return function(t,e){return{width:l(u(t)),height:l(u(e))}}(e.width,e.height)}class f{onResize;debounceMs;observer;handle;reported;constructor(t,e=250){this.onResize=t,this.debounceMs=e}observe(t){this.disconnect(),this.report(p(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(p(t))),this.debounceMs)})),this.observer.observe(t))}disconnect(){clearTimeout(this.handle),this.handle=void 0,this.observer?.disconnect(),this.observer=void 0,this.reported=void 0}report(t){(function(t,e){return!!t&&!!e&&t.width===e.width&&t.height===e.height})(t,this.reported)||(this.reported=t,this.onResize(t))}}function m(){return navigator.keyboard}function b(){return"function"==typeof m()?.lock}function y(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function v(){if(b())try{m().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const g=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;containerEl;ironEl;userInteraction;viewport;domReady=!1;runtimeReady=!1;connected=!1;disposed=!1;session_id;onFullscreenChange=()=>this.sync_keyboard_lock();credentials;credentialsPrompt=!1;statusMessage;usernameBuffer="";passwordBuffer="";get el(){return this}serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;username;password;destination;scale="fit";dynamicResize=!0;captureKeyboard=!0;onNodeIdChange(t,e){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),t&&(this.open_comms(),this.channel.connect())}serverId;onServerIdChange(t,e){this.onNodeIdChange(this.nodeId,this.nodeId)}connectionStateChanged;create_web_socket_endpoint(){const t=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${t}://${this.serverHost}`:`${t}://${this.serverHost}:${this.serverPort}`:`${t}://${this.serverHost}`}async connectedCallback(){document.addEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!1,await r(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to RDP.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!0,this.session_id=void 0,this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}async toggleFullscreen(){const t=await async function(t){try{return y(t)?(await document.exitFullscreen(),!1):(await t.requestFullscreen({navigationUI:"hide"}),!0)}catch(e){return console.warn("Failed to change the fullscreen state of the RDP session:",e),y(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return b()}async focusDesktop(){this.focus_desktop()}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.containerEl&&this.channel&&this.connect()}connect(){this.connected=!0,this.channel.connect()}open_comms(){this.channel=this.serverId?new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId):new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([a.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([a.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([a.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case c.Error:this.handle_error(e);break;case c.AuthSuccess:this.handle_auth_success(e);break;case c.RDPAuthorized:this.handle_rdp_authorized(e);break;case c.TunnelClosed:this.handle_tunnel_closed(e);break;default:console.warn("Unknown protocol message type:",e)}}))}close_comms(){this.teardown_client(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}reset_session_state(){this.session_id=void 0,this.credentials=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer="",this.statusMessage=void 0}handle_auth_success(t){if(this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.username&&this.password)return this.credentials={username:this.username,password:this.password},void this.request_tunnel();this.credentialsPrompt=!0}request_tunnel(){this.credentials&&(this.statusMessage=void 0,this.channel.open_rdp_tunnel(this.nodeId,this.serviceId,this.credentials.username,this.credentials.password))}async handle_rdp_authorized(t){this.session_id=t.sid,this.statusMessage="Connecting…";const[e]=await Promise.all([import("@devolutions/iron-remote-desktop-rdp"),import("@devolutions/iron-remote-desktop")]);if(this.disposed||!this.containerEl||this.session_id!==t.sid)return;if(await e.init("info"),this.disposed||!this.containerEl||this.session_id!==t.sid)return;const s=document.createElement("iron-remote-desktop");s.module=e.Backend,s.scale=this.scale,s.flexcenter=!0,s.verbose=!1,s.addEventListener("ready",(s=>{this.start_session(s.detail.irgUserInteraction,t.ticket,e.enableCredssp(!0))})),this.ironEl=s,this.mount_client(s)}mount_client(t){this.el.appendChild(t)}async start_session(t,e,s){this.userInteraction=t;const i=t.configBuilder().withUsername(this.credentials?.username??"").withPassword(this.credentials?.password??"").withDestination(this.destination??this.nodeId).withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`).withAuthToken(e).withExtension(s);if(this.dynamicResize){const t=function(t){const e=t.getBoundingClientRect();if(Number.isFinite(e.width)&&Number.isFinite(e.height)&&!(e.width<d||e.height<d))return{width:l(Math.min(Math.floor(e.width),4096)),height:l(Math.min(Math.floor(e.height),4096))}}(this.el);t&&i.withDesktopSize(t)}try{const e=await t.connect(i.build());if(this.disposed)return this.shutdown_session(t),void await e.run();t.setVisibility(!0),this.statusMessage=void 0,this.focus_desktop(),this.start_viewport_sync(),this.sync_keyboard_lock();const s=await e.run();this.statusMessage=s.reason()}catch(t){const e=this.describe_error(t);this.statusMessage=e,this.connectionStateChanged.emit([a.Error,t])}}start_viewport_sync(){this.dynamicResize&&(this.viewport=new f((t=>this.resize_desktop(t))),this.viewport.observe(this.el))}stop_viewport_sync(){this.viewport?.disconnect(),this.viewport=void 0}resize_desktop(t){try{this.userInteraction?.resize(t.width,t.height)}catch(t){console.warn("The remote host would not resize its desktop:",t)}}focus_desktop(){!function(t){t?.focus({preventScroll:!0})}(this.ironEl)}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(b()&&w(t))try{await m().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):v()}describe_error(t){return t&&"function"==typeof t.backtrace?t.backtrace():t instanceof Error?t.message:"Connection failed."}handle_tunnel_closed(t){this.session_id=void 0,this.statusMessage=this.statusMessage??"Connection closed.",this.teardown_client(),this.close_comms()}handle_error(t){this.statusMessage=t.message,this.connectionStateChanged.emit([a.Error,t])}shutdown_session(t){try{t.shutdown()}catch(t){console.warn("Failed to shut the RDP session down cleanly:",t)}}teardown_client(){this.stop_viewport_sync(),v(),this.userInteraction&&(this.shutdown_session(this.userInteraction),this.userInteraction=void 0),this.ironEl?.remove(),this.ironEl=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer=""}submit_credentials(t){t.preventDefault(),this.credentialsPrompt=!1,this.credentials={username:this.usernameBuffer,password:this.passwordBuffer},this.usernameBuffer="",this.passwordBuffer="",this.request_tunnel()}render(){return o(n,{key:"892fd55fb84abf180866dd7af4e44adc9c23f338"},o("div",{key:"fd6ac08295b6ce9e3bd3932abea271c9c6fc8a00",class:"screen",ref:t=>this.containerEl=t},o("slot",{key:"b9240f804177898f29598b0c7ec7b4f4d2e8d6c6"})),this.credentialsPrompt&&o("form",{key:"49ce099f575a30c0bb326a64de74d30cf599418f",class:"prompt",onSubmit:t=>this.submit_credentials(t)},o("label",{key:"1a12eb01993f858bbbc2498cc8d896b1dd1dbf88",htmlFor:"rdp-username"},"Username"),o("input",{key:"1530953f30c68d5fe6b3a438bfa91603c18d3de8",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),o("label",{key:"5066a95159ce5237ad4bb70fe4ef4860853b128a",htmlFor:"rdp-password"},"Password"),o("input",{key:"841ace9bfe01ae5bf55829782a047538344ee189",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),o("button",{key:"977d63f9c0e0d25b3e710f2c650d22f2382d01c6",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&o("div",{key:"7cf443d2a6fab96cfc87590e145e53325321b5d9",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}static get style(){return':host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.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}'}},[769,"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],dynamicResize:[4,"dynamic-resize"],captureKeyboard:[4,"capture-keyboard"],serverId:[1,"server-id"],credentialsPrompt:[32],statusMessage:[32],toggleFullscreen:[64],keyboardLockSupported:[64],focusDesktop:[64]},void 0,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]);function k(){"undefined"!=typeof customElements&&["phirepass-rdp"].forEach((e=>{"phirepass-rdp"===e&&(customElements.get(t(e))||customElements.define(t(e),g))}))}k();const _=g,I=k;export{_ as PhirepassRdp,I as defineCustomElement}
|
|
1
|
+
import{t,p as e,H as s,c as i,h as o,a as n}from"./index.js";import{_ as r,C as h,a,P as c}from"./p-D_8OF2F8.js";const d=200;function u(t){return!Number.isFinite(t)||t<=0?d:Math.min(8192,Math.max(d,Math.floor(t)))}function l(t){return t-t%2}function p(t){const e=t.getBoundingClientRect();return function(t,e){return{width:l(u(t)),height:l(u(e))}}(e.width,e.height)}class f{onResize;debounceMs;observer;handle;reported;constructor(t,e=250){this.onResize=t,this.debounceMs=e}observe(t){this.disconnect(),this.report(p(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(p(t))),this.debounceMs)})),this.observer.observe(t))}disconnect(){clearTimeout(this.handle),this.handle=void 0,this.observer?.disconnect(),this.observer=void 0,this.reported=void 0}report(t){(function(t,e){return!!t&&!!e&&t.width===e.width&&t.height===e.height})(t,this.reported)||(this.reported=t,this.onResize(t))}}function m(){return navigator.keyboard}function b(){return"function"==typeof m()?.lock}function y(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function v(){if(b())try{m().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const g=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;containerEl;ironEl;userInteraction;viewport;domReady=!1;runtimeReady=!1;connected=!1;disposed=!1;session_id;onFullscreenChange=()=>this.sync_keyboard_lock();credentials;credentialsPrompt=!1;statusMessage;usernameBuffer="";passwordBuffer="";get el(){return this}serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;username;password;destination;scale="fit";dynamicResize=!0;captureKeyboard=!0;onNodeIdChange(t,e){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),t&&(this.open_comms(),this.channel.connect())}serverId;onServerIdChange(t,e){this.onNodeIdChange(this.nodeId,this.nodeId)}connectionStateChanged;create_web_socket_endpoint(){const t=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${t}://${this.serverHost}`:`${t}://${this.serverHost}:${this.serverPort}`:`${t}://${this.serverHost}`}async connectedCallback(){document.addEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!1,await r(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to RDP.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!0,this.session_id=void 0,this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}async toggleFullscreen(){const t=await async function(t){try{return y(t)?(await document.exitFullscreen(),!1):(await t.requestFullscreen({navigationUI:"hide"}),!0)}catch(e){return console.warn("Failed to change the fullscreen state of the RDP session:",e),y(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return b()}async focusDesktop(){this.focus_desktop()}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.containerEl&&this.channel&&this.connect()}connect(){this.connected=!0,this.channel.connect()}open_comms(){this.channel=this.serverId?new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId):new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([a.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([a.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([a.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case c.Error:this.handle_error(e);break;case c.AuthSuccess:this.handle_auth_success(e);break;case c.RDPAuthorized:this.handle_rdp_authorized(e);break;case c.TunnelClosed:this.handle_tunnel_closed(e);break;default:console.warn("Unknown protocol message type:",e)}}))}close_comms(){this.teardown_client(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}reset_session_state(){this.session_id=void 0,this.credentials=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer="",this.statusMessage=void 0}handle_auth_success(t){if(this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.username&&this.password)return this.credentials={username:this.username,password:this.password},void this.request_tunnel();this.credentialsPrompt=!0}request_tunnel(){this.credentials&&(this.statusMessage=void 0,this.channel.open_rdp_tunnel(this.nodeId,this.serviceId,this.credentials.username,this.credentials.password))}async handle_rdp_authorized(t){this.session_id=t.sid,this.statusMessage="Connecting…";const[e]=await Promise.all([import("@devolutions/iron-remote-desktop-rdp"),import("@devolutions/iron-remote-desktop")]);if(this.disposed||!this.containerEl||this.session_id!==t.sid)return;if(await e.init("info"),this.disposed||!this.containerEl||this.session_id!==t.sid)return;const s=document.createElement("iron-remote-desktop");s.module=e.Backend,s.scale=this.scale,s.flexcenter=!0,s.verbose=!1,s.addEventListener("ready",(s=>{this.start_session(s.detail.irgUserInteraction,t.ticket,e.enableCredssp(!0))})),this.ironEl=s,this.mount_client(s)}mount_client(t){this.el.appendChild(t)}async start_session(t,e,s){this.userInteraction=t;const i=t.configBuilder().withUsername(this.credentials?.username??"").withPassword(this.credentials?.password??"").withDestination(this.destination??this.nodeId).withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`).withAuthToken(e).withExtension(s);if(this.dynamicResize){const t=function(t){const e=t.getBoundingClientRect();if(Number.isFinite(e.width)&&Number.isFinite(e.height)&&!(e.width<d||e.height<d))return{width:l(Math.min(Math.floor(e.width),4096)),height:l(Math.min(Math.floor(e.height),4096))}}(this.el);t&&i.withDesktopSize(t)}try{const e=await t.connect(i.build());if(this.disposed)return this.shutdown_session(t),void await e.run();t.setVisibility(!0),this.statusMessage=void 0,this.focus_desktop(),this.start_viewport_sync(),this.sync_keyboard_lock();const s=await e.run();this.statusMessage=s.reason()}catch(t){const e=this.describe_error(t);this.statusMessage=e,this.connectionStateChanged.emit([a.Error,t])}}start_viewport_sync(){this.dynamicResize&&(this.viewport=new f((t=>this.resize_desktop(t))),this.viewport.observe(this.el))}stop_viewport_sync(){this.viewport?.disconnect(),this.viewport=void 0}resize_desktop(t){try{this.userInteraction?.resize(t.width,t.height)}catch(t){console.warn("The remote host would not resize its desktop:",t)}}focus_desktop(){!function(t){t?.focus({preventScroll:!0})}(this.ironEl)}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(b()&&w(t))try{await m().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):v()}describe_error(t){return t&&"function"==typeof t.backtrace?t.backtrace():t instanceof Error?t.message:"Connection failed."}handle_tunnel_closed(t){this.session_id=void 0,this.statusMessage=this.statusMessage??"Connection closed.",this.teardown_client(),this.close_comms()}handle_error(t){this.statusMessage=t.message,this.connectionStateChanged.emit([a.Error,t])}shutdown_session(t){try{t.shutdown()}catch(t){console.warn("Failed to shut the RDP session down cleanly:",t)}}teardown_client(){this.stop_viewport_sync(),v(),this.userInteraction&&(this.shutdown_session(this.userInteraction),this.userInteraction=void 0),this.ironEl?.remove(),this.ironEl=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer=""}submit_credentials(t){t.preventDefault(),this.credentialsPrompt=!1,this.credentials={username:this.usernameBuffer,password:this.passwordBuffer},this.usernameBuffer="",this.passwordBuffer="",this.request_tunnel()}render(){return o(n,{key:"892fd55fb84abf180866dd7af4e44adc9c23f338"},o("div",{key:"fd6ac08295b6ce9e3bd3932abea271c9c6fc8a00",class:"screen",ref:t=>this.containerEl=t},o("slot",{key:"b9240f804177898f29598b0c7ec7b4f4d2e8d6c6"})),this.credentialsPrompt&&o("form",{key:"49ce099f575a30c0bb326a64de74d30cf599418f",class:"prompt",onSubmit:t=>this.submit_credentials(t)},o("label",{key:"1a12eb01993f858bbbc2498cc8d896b1dd1dbf88",htmlFor:"rdp-username"},"Username"),o("input",{key:"1530953f30c68d5fe6b3a438bfa91603c18d3de8",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),o("label",{key:"5066a95159ce5237ad4bb70fe4ef4860853b128a",htmlFor:"rdp-password"},"Password"),o("input",{key:"841ace9bfe01ae5bf55829782a047538344ee189",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),o("button",{key:"977d63f9c0e0d25b3e710f2c650d22f2382d01c6",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&o("div",{key:"7cf443d2a6fab96cfc87590e145e53325321b5d9",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}static get style(){return':host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.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}'}},[769,"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],dynamicResize:[4,"dynamic-resize"],captureKeyboard:[4,"capture-keyboard"],serverId:[1,"server-id"],credentialsPrompt:[32],statusMessage:[32],toggleFullscreen:[64],keyboardLockSupported:[64],focusDesktop:[64]},void 0,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]);function k(){"undefined"!=typeof customElements&&["phirepass-rdp"].forEach((e=>{"phirepass-rdp"===e&&(customElements.get(t(e))||customElements.define(t(e),g))}))}k();const _=g,I=k;export{_ as PhirepassRdp,I as defineCustomElement}
|