phirepass-widgets 0.0.41 → 0.0.43
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-Rxdu9QG2.js → index-DTAHGGCM.js} +111 -44
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +225 -3
- package/dist/cjs/phirepass-terminal.cjs.entry.js +31 -815
- package/dist/cjs/phirepass-widgets.cjs.js +3 -3
- package/dist/cjs/protocol-C4R_gGQV.js +801 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/common/protocol.js +20 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +142 -1
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +509 -1
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.logo.svg +6 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.max.svg +8 -0
- package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +13 -21
- package/dist/collection/phirepass-channel_bg.wasm +0 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-DgZMmpg7.js +1 -0
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +5 -5
- package/dist/esm/{index-C8ZFkLEv.js → index-D6RLmr6w.js} +111 -44
- package/dist/esm/loader.js +3 -3
- package/dist/esm/phirepass-sftp-client.entry.js +225 -3
- package/dist/esm/phirepass-terminal.entry.js +10 -793
- package/dist/esm/phirepass-widgets.js +4 -4
- package/dist/esm/protocol-DgZMmpg7.js +796 -0
- package/dist/phirepass-widgets/p-4e32fef4.entry.js +49 -0
- package/dist/phirepass-widgets/p-79a71767.entry.js +1 -0
- package/dist/phirepass-widgets/p-D6RLmr6w.js +2 -0
- package/dist/phirepass-widgets/p-DgZMmpg7.js +1 -0
- package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/common/protocol.d.ts +17 -0
- package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +42 -0
- package/dist/types/components/phirepass-terminal/phirepass-terminal.d.ts +1 -6
- package/dist/types/components.d.ts +97 -1
- package/package.json +5 -5
- package/dist/phirepass-widgets/p-2f3f0b69.entry.js +0 -49
- package/dist/phirepass-widgets/p-376ef3af.entry.js +0 -1
- package/dist/phirepass-widgets/p-C8ZFkLEv.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as i,h as a,H as s}from"./p-D6RLmr6w.js";import{_ as t,C as c,a as d,P as o}from"./p-DgZMmpg7.js";const r=class{constructor(a){e(this,a),this.maximizeEvent=i(this,"maximize"),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;domReady=!1;runtimeReady=!1;connected=!1;name="SFTP";description="Client";hideHeader=!1;serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;token;onNodeIdChange(e,i){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),e&&(this.open_comms(),this.channel.connect())}serverId;onServerIdChange(e,i){this.onNodeIdChange(this.nodeId,this.nodeId)}maximizeEvent;async maximize(){this.max=!this.max}async minimize(){this.max=!1}connectionStateChanged;max=!1;show_login_screen=!1;show_login_screen_username=!1;show_login_screen_password=!1;toggle_max(){this.maximizeEvent?.emit(!this.max)}async connectedCallback(){await t(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to terminal.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}connect(){this.connected=!0,this.channel.connect()}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.channel&&this.connect()}create_web_socket_endpoint(){const e=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${e}://${this.serverHost}`:`${e}://${this.serverHost}:${this.serverPort}`:`${e}://${this.serverHost}`}handle_error(e){}handle_auth_success(e){this.clear_creds_buffer(),this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.channel.open_sftp_tunnel(this.nodeId)}handle_tunnel_opened(e){}handle_tunnel_data(e){}handle_tunnel_closed(e){this.clear_creds_buffer(),this.close_comms()}open_comms(){this.channel=this.serverId?new c(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId):new c(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([d.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([d.Disconnected])})),this.channel.on_connection_error((e=>{this.connectionStateChanged.emit([d.Error,e])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((e=>{const{web:i}=e.data;switch(i.type){case o.Error:this.handle_error(i);break;case o.AuthSuccess:this.handle_auth_success(i);break;case o.TunnelOpened:this.handle_tunnel_opened(i);break;case o.TunnelClosed:this.handle_tunnel_closed(i);break;case o.TunnelData:this.handle_tunnel_data(i);break;default:console.warn("Unknown protocol message type:",i)}}))}close_comms(){this.channel.stop_heartbeat(),this.channel.disconnect()}clear_creds_buffer(){}reset_session_state(){this.clear_creds_buffer()}render(){return a(s,{key:"ac63e2c701cd09a605d0aaa7396eaec16ff9c3bc",class:{default:!this.max,max:this.max}},a("section",{key:"253dfc510c62ee57a96d574af993e8017475a0c2",class:"listing"},!this.hideHeader&&a("header",{key:"215ddf76ba55641892fc9a758077ba8d1f3a6671"},a("section",{key:"49541a8d31d8c61e2df84c60348f7426fddec67c",class:"title"},a("img",{key:"1a86ba6b3de92b35cbd5b1bacfdfee2da6fa6766",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==",alt:"SFTP Client"}),a("div",{key:"38d90384978acc8b323ca4c396db7bda54320059",class:"text"},a("div",{key:"a94b3fd21025000b620b2bb85aec87198e575bfa",class:"name"},this.name),a("div",{key:"072c41dc8d05faf77929f8c128bb97b64d8835bf",class:"description"},this.description))),a("section",{key:"46e575f4ce5f2da0913d2f3aebe025540f1f3688",class:"actions"},a("div",{key:"f92d66ab7ab5e9c25a29037c60709c54623194be",class:"action",onClick:()=>this.toggle_max()},a("img",{key:"e115204a83336fc4b49a30551208b727c3f33be9",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K",alt:"Maximize"})))),a("main",{key:"c6bf5ab4e5aa46dcba8e50ec1a9c2feb1f55ea02"}),a("footer",{key:"ac67a3e0966e3f04bee019162f8174aae58cbf1a"})),a("section",{key:"07e83117470f7f226328703b18f836bd4358cfe9",class:{creds:!0,blurred:this.show_login_screen}},this.show_login_screen&&a("form",{key:"808209eaba50f10a8ef96163972ad36ea9e3d3e2",class:"form"},a("div",{key:"9e26efeac2f17d6b4168e1a77da6ef61d325f6e3"},"SFTP Connection"),a("div",{key:"f9badb92d4434a16916429a2bedb6e38d2ae647c"},a("div",{key:"9fb267ba7828cd950b327a17e0ee803dc399c80b"},"Username"),a("input",{key:"65b34c14292b0bde408861e791f3baa99c4c9a02",type:"text",placeholder:""})),a("div",{key:"f1f9def8290dfcde9beff0f61092f6020580b72c"},a("div",{key:"1c89b71c4126299b7e8e421b05761d2b0424d4ed"},"Password"),a("input",{key:"17364976158ddaacbb55ed17ee09ec242bcbdce7",type:"password",placeholder:""})),a("div",{key:"9362acdf153ceeba3c8e8cee0518cf2baeec27e0"},a("button",{key:"ebf6c205276a7c3ff34c13e148978be61044ff7a"},"Connect")))))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};r.style=":host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--muted-foreground:220 10% 50%;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;height:100%;width:100%;border:1px solid hsl(var(--border));background-color:hsl(var(--card));border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;position:relative;.listing{flex:1;display:flex;flex-direction:column;justify-content:space-between;header{height:30px;background:rgba(28, 31, 38, 0.6);border-bottom:1px solid hsl(var(--border));display:flex;align-items:center;justify-content:space-between;.actions{display:flex;align-items:center;.action{cursor:pointer;padding:4px;display:flex;align-items:center;z-index:1;img{height:14px;padding:4px;border-radius:4px}&:hover{background-color:hsl(var(--border) / 0.6)}}}.title{color:hsl(var(--primary));height:14px;padding:0 12px;display:flex;align-items:center;font-size:0.75rem;line-height:1rem;img{height:14px;margin-right:5px}.text{display:flex;flex-direction:row;justify-content:center;margin-top:2px;.name{margin-right:10px}.description{color:hsl(var(--muted-foreground))}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border))}}.creds{position:absolute;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;&.blurred{background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.form{display:flex;flex-direction:column;background:hsl(var(--card));width:200px;position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:20px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px}}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}";export{r as phirepass_sftp_client}
|
|
@@ -0,0 +1,2 @@
|
|
|
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&&(t.__stencil__getHostRef=()=>e,e.i=t,512&e.o.u&&n(t,e))},s=(t,e)=>e in t,i=(t,e)=>(0,console.error)(t,e),r=new Map,c=new Map,u="undefined"!=typeof window?window:{},f={u:0,p:"",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)},a=t=>Promise.resolve(t),d=(()=>{try{return!!u.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),p=!!d&&(()=>!!u.document&&Object.getOwnPropertyDescriptor(u.document.adoptedStyleSheets,"length").writable)(),h=!1,m=[],v=[],b=(t,e)=>n=>{t.push(n),h||(h=!0,e&&4&f.u?w($):f.raf($))},y=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){i(t)}t.length=0},$=()=>{y(m),y(v),(h=m.length>0)&&f.raf($)},w=t=>a().then(t),g=b(v,!0);function j(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(p?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}function O(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var S,k=new WeakMap,E=t=>"sc-"+t.h,M=t=>"object"==(t=typeof t)||"function"===t,C=(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].m+=o:r.push(s?x(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 u=x(t,null);return u.v=e,r.length>0&&(u.$=r),u.j=l,u},x=(t,e)=>({u:0,O:t,m:null!=e?e:null,S:null,$:null,v:null,j:null}),L={},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},P=(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,R=t=>{var e;return null==(e=o(t))?void 0:e.$hostElement$},D=(t,e)=>{const n=R(t);return{emit:t=>H(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},H=(t,e,n)=>{const o=f.ce(e,n);return t.dispatchEvent(o),o},T=(t,e,n,l,i,r)=>{if(n===l)return;let c=s(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,o=U(n);let s=U(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("key"===e);else if("ref"===e)l&&Q(l,t);else if(c||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let s;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(s=t[1])}}return s||(s=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(s)||t.removeAttribute(s):t.setAttribute(s,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const o=M(l);if((c||o&&null!==l)&&!i)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const o=null==l?"":l;"list"===e?c=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!c||4&r||i)&&!o&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}else if(e="-"===e[2]?e.slice(3):s(u,a)?a.slice(2):a[2]+e.slice(3),n||l){const o=e.endsWith(W);e=e.replace(z,""),n&&f.rel(t,e,n,o),l&&f.ael(t,e,l,o)}},A=/\s/,U=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(A):[]),W="Capture",z=RegExp(W+"$"),F=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.v||{},s=e.v||{};for(const t of V(Object.keys(l)))t in s||T(o,t,l[t],void 0,n,e.u);for(const t of V(Object.keys(s)))T(o,t,l[t],s[t],n,e.u)};function V(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var q=!1,G=[],Y=[],Z=(t,e,n)=>{const o=e.$[n];let l,s,i=0;if(null!=o.m)l=o.S=u.document.createTextNode(o.m);else{if(!u.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.S=u.document.createElement(o.O),F(null,o,q),o.$){const e="template"===o.O?l.content:l;for(i=0;i<o.$.length;++i)s=Z(t,o,i),s&&e.appendChild(s)}}return l["s-hn"]=S,l},_=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===S&&(r=r.shadowRoot),"template"===n.O&&(r=r.content);l<=s;++l)o[l]&&(i=Z(null,n,l),i&&(o[l].S=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.S;K(e),t&&t.remove()}}},I=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),J=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,s=e.$,i=e.m;null==i?(F(t,e,q),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],p=e[a],h=o.length-1,m=o[0],v=o[h];const b="template"===n.O?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==v)v=o[--h];else if(I(d,m,l))J(d,m,l),d=e[++r],m=o[++c];else if(I(p,v,l))J(p,v,l),p=e[--a],v=o[--h];else if(I(d,v,l))J(d,v,l),X(b,d.S,p.S.nextSibling),d=e[++r],v=o[--h];else if(I(p,m,l))J(p,m,l),X(b,p.S,d.S),p=e[--a],m=o[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].j&&e[f].j===m.j){u=f;break}u>=0?(i=e[u],i.O!==m.O?s=Z(e&&e[c],n,u):(J(i,m,l),e[u]=void 0,s=i.S),m=o[++c]):(s=Z(e&&e[c],n,c),m=o[++c]),s&&X(d.S.parentNode,s,d.S)}r>a?_(t,null==o[h+1]?null:o[h+1].S,n,o,c,h):c>h&&B(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.m&&(o.textContent=""),_(o,null,e,s,0,s.length-1)):!n&&null!==l&&B(l,0,l.length-1)):t.m!==i&&(o.data=i)},K=t=>{t.v&&t.v.ref&&G.push((()=>t.v.ref(null))),t.$&&t.$.map(K)},Q=(t,e)=>{Y.push((()=>t(e)))},X=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),tt=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.k=()=>{e["s-p"].splice(n-1,1),o()})))}},et=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);tt(t,t.M);const n=()=>nt(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},nt=(t,e)=>{const n=t.$hostElement$,o=t.i;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 e?(t.C.length&&t.C.forEach((t=>t(n))),l=ut(o,"componentWillLoad",void 0,n)):l=ut(o,"componentWillUpdate",void 0,n),l=ot(l,(()=>ut(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.u,l=((t,e)=>{var n,o,l;const s=E(e),i=c.get(s);if(!u.document)return s;if(t=11===t.nodeType?t:u.document,i)if("string"==typeof i){let l,r=k.get(t=t.head||t);if(r||k.set(t,r=new Set),!r.has(s)){l=u.document.createElement("style"),l.textContent=i;const c=null!=(n=f.L)?n:O(u.document);if(null!=c&&l.setAttribute("nonce",c),!(1&e.u))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(d){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(i),p?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=i+e.textContent:t.prepend(l)}else t.append(l);1&e.u&&t.insertBefore(l,null),4&e.u&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),r&&r.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(i.constructor===n.CSSStyleSheet)o=i;else{o=new n.CSSStyleSheet;for(let t=0;t<i.cssRules.length;t++)o.insertRule(i.cssRules[t].cssText,t)}p?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.u|=4,e.length=0)}},it=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.N||x(null,null),s=(t=>t&&t.O===L)(e)?e:C(null,null,e);if(S=o.tagName,n&&s.v)for(const t of Object.keys(s.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.v[t]=o[t]);s.O=null,s.u|=4,t.N=s,s.S=l.S=o.shadowRoot||o,J(l,s,n),G.forEach((t=>t())),G.length=0,Y.forEach((t=>t())),Y.length=0})(t,e,o)}catch(e){i(e,t.$hostElement$)}return null},rt=t=>{const e=t.$hostElement$,n=t.i,o=t.M;ut(n,"componentDidRender",void 0,e),64&t.u?ut(n,"componentDidUpdate",void 0,e):(t.u|=64,ft(e),ut(n,"componentDidLoad",void 0,e),t.P(e),o||ct()),t.R(e),t.k&&(t.k(),t.k=void 0),512&t.u&&w((()=>et(t,!1))),t.u&=-517},ct=()=>{w((()=>H(u,"appload",{detail:{namespace:"phirepass-widgets"}})))},ut=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){i(t,o)}},ft=t=>t.classList.add("hydrated"),at=(t,e,n,l)=>{const s=o(t);if(!s)return;if(!s)throw Error(`Couldn't find host element for "${l.h}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,c=s.l.get(e),u=s.u,f=s.i;if(n=P(n,l.t[e][0]),!(8&u&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n))){if(s.l.set(e,n),l.D){const t=l.D[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(f?f[o](n,c,e):s.C.push((()=>{s.i[o](n,c,e)})))}catch(t){i(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||et(s,!1)}}},dt=(e,n,l)=>{var s,i;const r=e.prototype;{e.watchers&&!n.D&&(n.D=N(e.watchers)),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.T&&(n.T=e.serializers);const c=Object.entries(null!=(s=n.t)?s:{});if(c.map((([e,[s]])=>{if(31&s||2&l&&32&s){const{get:i,set:c}=t(r,e)||{};i&&(n.t[e][0]|=2048),c&&(n.t[e][0]|=4096),(1&l||!i)&&Object.defineProperty(r,e,{get(){{if(!(2048&n.t[e][0]))return((t,e)=>o(this).l.get(e))(0,e);const t=o(this),l=t?t.i:r;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const i=o(this);if(i){if(c)return void 0===(32&s?this[e]:i.$hostElement$[e])&&i.l.get(e)&&(t=i.l.get(e)),c.call(this,P(t,s)),void at(this,e,t=32&s?this[e]:i.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return at(this,e,t,n),void(1&l&&!i.i&&i.C.push((()=>{4096&n.t[e][0]&&i.i[e]!==i.l.get(e)&&(i.i[e]=t)})));const o=()=>{const o=i.i[e];!i.l.get(e)&&o&&i.l.set(e,o),i.i[e]=P(t,s),at(this,e,i.i[e],n)};i.i?o():i.C.push((()=>{o()}))}}}})}else 1&l&&64&s&&Object.defineProperty(r,e,{value(...t){var n;const l=o(this);return null==(n=null==l?void 0:l.A)?void 0:n.then((()=>{var n;return null==(n=l.i)?void 0:n[e](...t)}))}})})),1&l){const t=new Map;r.attributeChangedCallback=function(e,l,s){f.jmp((()=>{var i;const u=t.get(e),f=o(this);if(this.hasOwnProperty(u)&&(s=this[u],delete this[u]),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==f?void 0:f.u;if(f&&t&&!(8&t)&&s!==l){const o=f.i,r=null==(i=n.D)?void 0:i[e];null==r||r.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=c.find((([t])=>t===u)),d=a&&4&a[1][0],p=d&&null===s&&void 0===this[u];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(r,u);p||s==this[u]||h.get&&!h.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=n.D)?i:{}),...c.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},pt=(t,e)=>{ut(t,"connectedCallback",void 0,e)},ht=(t,e)=>{ut(t,"disconnectedCallback",void 0,e||t)},mt=(t,e={})=>{var n;if(!u.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const l=[],s=e.exclude||[],a=u.customElements,p=u.document.head,h=p.querySelector("meta[charset]"),m=u.document.createElement("style"),v=[];let b,y=!0;if(Object.assign(f,e),f.p=new URL(e.resourcesUrl||"./",u.document.baseURI).href,t.map((t=>{t[1].map((e=>{var n,u;const p={u:e[0],h:e[1],t:e[2],U:e[3]};p.t=e[2],p.D=N(e[4]),p.T=null!=(n=e[5])?n:{},p.H=null!=(u=e[6])?u:{};const h=p.h,m=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){if(super(t),((t,e)=>{const n={u:0,$hostElement$:t,o:e,l:new Map,W:new Map};n.A=new Promise((t=>n.R=t)),n.F=new Promise((t=>n.P=t)),t["s-p"]=[],t["s-rc"]=[],n.C=[];const o=n;t.__stencil__getHostRef=()=>o})(t=this,p),1&p.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${p.h}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else j.call(t,p)}connectedCallback(){o(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),y?v.push(this):f.jmp((()=>(t=>{if(!(1&f.u)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.u)(null==e?void 0:e.i)?pt(e.i,t):(null==e?void 0:e.F)&&e.F.then((()=>pt(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){tt(e,e.M=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.u)){if(e.u|=32,n.V){const l=((t,e)=>{const n=t.h.replace(/-/g,"_"),o=t.V;if(!o)return;const l=r.get(o);return l?l[n]:import(`./${o}.entry.js`).then((t=>(r.set(o,t),t[n])),(t=>{i(t,e.$hostElement$)}))
|
|
2
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(l&&"then"in l){const t=()=>{};o=await l,t()}else o=l;if(!o)throw Error(`Constructor for "${n.h}#${e.q}" was not found`);o.isProxied||(n.D=N(o.watchers),n.T=o.serializers,n.H=o.deserializers,dt(o,n,2),o.isProxied=!0);const s=()=>{};e.u|=8;try{new o(e)}catch(e){i(e,t)}e.u&=-9,e.u|=128,s(),pt(e.i,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.u|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=E(n);if(!c.has(e)){const o=()=>{};((t,e,n)=>{let o=c.get(t);d&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,c.set(t,o)})(e,t,!!(1&n.u)),o()}}}const l=e.M,s=()=>et(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()}catch(n){i(n,t),e.k&&(e.k(),e.k=void 0),e.P&&e.P(t)}})(t,e,n)}l()}})(this))))}disconnectedCallback(){f.jmp((()=>(async t=>{if(!(1&f.u)){const e=o(t);(null==e?void 0:e.i)?ht(e.i,t):(null==e?void 0:e.F)&&e.F.then((()=>ht(e.i,t)))}k.has(t)&&k.delete(t),t.shadowRoot&&k.has(t.shadowRoot)&&k.delete(t.shadowRoot)})(this))),f.raf((()=>{var t;const e=o(this);if(!e)return;const n=v.findIndex((t=>t===this));n>-1&&v.splice(n,1),(null==(t=null==e?void 0:e.N)?void 0:t.S)instanceof Node&&!e.N.S.isConnected&&delete e.N.S}))}componentOnReady(){var t;return null==(t=o(this))?void 0:t.F}};p.V=t[0],s.includes(h)||a.get(h)||(l.push(h),a.define(h,dt(m,p,1)))}))})),l.length>0&&(m.textContent+=l.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",m.innerHTML.length)){m.setAttribute("data-styles","");const t=null!=(n=f.L)?n:O(u.document);null!=t&&m.setAttribute("nonce",t),p.insertBefore(m,h?h.nextSibling:p.firstChild)}y=!1,v.length?v.map((t=>t.connectedCallback())):f.jmp((()=>b=setTimeout(ct,30)))},vt=t=>f.L=t;export{L as H,mt as b,D as c,R as g,C as h,a as p,l as r,vt as s}
|
|
@@ -0,0 +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();E.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=S(n,E.__wbindgen_export,E.__wbindgen_export2),o=I,c=S(t,E.__wbindgen_export,E.__wbindgen_export2);E.channel_authenticate(this.__wbg_ptr,r,o,c,I,A(e)?4294967297:e>>>0)}connect(){E.channel_connect(this.__wbg_ptr)}disconnect(){E.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==E.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==E.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){const r=S(n,E.__wbindgen_export,E.__wbindgen_export2),o=I,c=S(t,E.__wbindgen_export,E.__wbindgen_export2),i=I;var s=A(e)?0:S(e,E.__wbindgen_export,E.__wbindgen_export2);const u=E.channel_new(r,o,c,i,s,I);return this.__wbg_ptr=u>>>0,_.register(this,this.__wbg_ptr,this),this}on_connection_close(n){E.channel_on_connection_close(this.__wbg_ptr,A(n)?0:u(n))}on_connection_error(n){E.channel_on_connection_error(this.__wbg_ptr,A(n)?0:u(n))}on_connection_message(n){E.channel_on_connection_message(this.__wbg_ptr,A(n)?0:u(n))}on_connection_open(n){E.channel_on_connection_open(this.__wbg_ptr,A(n)?0:u(n))}on_protocol_message(n){E.channel_on_protocol_message(this.__wbg_ptr,A(n)?0:u(n))}open_sftp_tunnel(n,t,e,r){const o=S(n,E.__wbindgen_export,E.__wbindgen_export2),c=I;var i=A(t)?0:S(t,E.__wbindgen_export,E.__wbindgen_export2),s=I,_=A(e)?0:S(e,E.__wbindgen_export,E.__wbindgen_export2);E.channel_open_sftp_tunnel(this.__wbg_ptr,o,c,i,s,_,I,A(r)?4294967297:r>>>0)}open_ssh_tunnel(n,t,e,r){const o=S(n,E.__wbindgen_export,E.__wbindgen_export2),c=I;var i=A(t)?0:S(t,E.__wbindgen_export,E.__wbindgen_export2),s=I,_=A(e)?0:S(e,E.__wbindgen_export,E.__wbindgen_export2);E.channel_open_ssh_tunnel(this.__wbg_ptr,o,c,i,s,_,I,A(r)?4294967297:r>>>0)}send_sftp_delete(n,t,e,r,o){const c=S(n,E.__wbindgen_export,E.__wbindgen_export2),i=I,s=S(e,E.__wbindgen_export,E.__wbindgen_export2),_=I,u=S(r,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_delete(this.__wbg_ptr,c,i,t,s,_,u,I,A(o)?4294967297:o>>>0)}send_sftp_download_chunk(n,t,e,r,o){const c=S(n,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_download_chunk(this.__wbg_ptr,c,I,t,e,r,A(o)?4294967297:o>>>0)}send_sftp_download_start(n,t,e,r,o){const c=S(n,E.__wbindgen_export,E.__wbindgen_export2),i=I,s=S(e,E.__wbindgen_export,E.__wbindgen_export2),_=I,u=S(r,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_download_start(this.__wbg_ptr,c,i,t,s,_,u,I,A(o)?4294967297:o>>>0)}send_sftp_list_data(n,t,e,r){const o=S(n,E.__wbindgen_export,E.__wbindgen_export2),c=I,i=S(e,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_list_data(this.__wbg_ptr,o,c,t,i,I,A(r)?4294967297:r>>>0)}send_sftp_upload_chunk(n,t,e,r,o,c,i){const s=S(n,E.__wbindgen_export,E.__wbindgen_export2),_=I,u=function(n){const t=(0,E.__wbindgen_export)(1*n.length,1)>>>0;return h().set(n,t/1),I=n.length,t}(c);E.channel_send_sftp_upload_chunk(this.__wbg_ptr,s,_,t,e,r,o,u,I,A(i)?4294967297:i>>>0)}send_sftp_upload_start(n,t,e,r,o,c,i){const s=S(n,E.__wbindgen_export,E.__wbindgen_export2),_=I,u=S(e,E.__wbindgen_export,E.__wbindgen_export2),a=I,f=S(r,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_upload_start(this.__wbg_ptr,s,_,t,u,a,f,I,o,c,A(i)?4294967297:i>>>0)}send_ssh_terminal_resize(n,t,e,r,o,c){const i=S(n,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_ssh_terminal_resize(this.__wbg_ptr,i,I,t,e,r,o,c)}send_ssh_tunnel_data(n,t,e){const r=S(n,E.__wbindgen_export,E.__wbindgen_export2),o=I,c=S(e,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_ssh_tunnel_data(this.__wbg_ptr,r,o,t,c,I)}start_heartbeat(n){E.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){E.channel_stop_heartbeat(this.__wbg_ptr)}}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_960c155d3d49e4c2:function(n,t){return u(Error(w(n,t)))},__wbg_String_8564e559799eccda:function(n,t){const e=S(String(y(t)),E.__wbindgen_export,E.__wbindgen_export2),r=I;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_debug_string_ab4b34d23d6778bd:function(n,t){const e=S(f(y(t)),E.__wbindgen_export,E.__wbindgen_export2),r=I;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_string_get_7ed5322991caaec5:function(n,t){const e=y(t),r="string"==typeof e?e:void 0;var o=A(r)?0:S(r,E.__wbindgen_export,E.__wbindgen_export2),c=I;d().setInt32(n+4,c,!0),d().setInt32(n+0,o,!0)},__wbg___wbindgen_throw_6b64449b9b9ed33c:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_b46c9b5a9f08ec37:function(n){y(n)._wbg_cb_unref()},__wbg_call_14b169f759b26747:function(){return p((function(n,t){return u(y(n).call(y(t)))}),arguments)},__wbg_call_a24592a6f349a97e:function(){return p((function(n,t,e){return u(y(n).call(y(t),y(e)))}),arguments)},__wbg_clearInterval_26ba580547547579:function(n){return u(clearInterval(j(n)))},__wbg_close_88106990eea7f544:function(){return p((function(n){y(n).close()}),arguments)},__wbg_data_bb9dffdd1e99cf2d:function(n){return u(y(n).data)},__wbg_from_0dbf29f09e7fb200:function(n){return u(Array.from(y(n)))},__wbg_info_28c8c91558eab232:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3:function(n){let t;try{t=y(n)instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_length_9f1775224cf1d815:function(n){return y(n).length},__wbg_new_0c7403db6e782f19:function(n){return u(new Uint8Array(y(n)))},__wbg_new_682678e2f47e32bc:function(){return u(new Array)},__wbg_new_aa8d0fa9762c29bd:function(){return u(new Object)},__wbg_new_with_str_sequence_6453b755acdcc2e7:function(){return p((function(n,t,e){return u(new WebSocket(w(n,t),y(e)))}),arguments)},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(n,t,e){Uint8Array.prototype.set.call(b(n,t),y(e))},__wbg_push_471a5b068a5295f6:function(n,t){return y(n).push(y(t))},__wbg_readyState_c78e609c7de3b381:function(n){return y(n).readyState},__wbg_send_186c85704c7f2d00:function(){return p((function(n,t,e){y(n).send(b(t,e))}),arguments)},__wbg_setInterval_cbf1c35c6a692d37:function(){return p((function(n,t){return u(setInterval(y(n),t))}),arguments)},__wbg_set_3bf1de9fab0cd644:function(n,t,e){y(n)[t>>>0]=j(e)},__wbg_set_6be42768c690e380:function(n,t,e){y(n)[j(t)]=j(e)},__wbg_set_binaryType_770e68648ca5e83d:function(n,t){y(n).binaryType=s[t]},__wbg_set_onclose_17fa3bbcc4ba3541:function(n,t){y(n).onclose=y(t)},__wbg_set_onerror_da99c4232662a084:function(n,t){y(n).onerror=y(t)},__wbg_set_onmessage_c1db358b9c38e3f1:function(n,t){y(n).onmessage=y(t)},__wbg_set_onopen_cd47b8fb1d92dee9:function(n,t){y(n).onopen=y(t)},__wbg_warn_7b0e6adca8922a5f:function(n,t){console.warn(w(n,t))},__wbindgen_cast_0000000000000001:function(n,t){return u(R(n,t,o))},__wbindgen_cast_0000000000000002:function(n,t){return u(R(n,t,c))},__wbindgen_cast_0000000000000003:function(n,t){return u(R(n,t,i))},__wbindgen_cast_0000000000000004:function(n,t){return u(R(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(y(n))},__wbindgen_object_drop_ref:function(n){j(n)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}function r(n,t){E.__wasm_bindgen_func_elem_39(n,t)}function o(n,t,e){E.__wasm_bindgen_func_elem_41(n,t,u(e))}function c(n,t,e){E.__wasm_bindgen_func_elem_41_1(n,t,u(e))}function i(n,t,e){E.__wasm_bindgen_func_elem_41_2(n,t,u(e))}const s=["blob","arraybuffer"],_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>E.__wbg_channel_free(n>>>0,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=>E.__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!==E.memory.buffer)&&(l=new DataView(E.memory.buffer)),l}function w(n,t){return function(n,t){return q+=t,q>=U&&(O=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),O.decode(),q=t),O.decode(h().subarray(n,n+t))}(n>>>=0,t)}let g=null;function h(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(E.memory.buffer)),g}function y(n){return m[n]}function p(n,t){try{return n.apply(this,t)}catch(n){E.__wbindgen_export3(u(n))}}let m=new Array(1024).fill(void 0);m.push(void 0,null,!0,!1);let v=m.length;function A(n){return null==n}function R(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&&(E.__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=W.encode(n),r=t(e.length,1)>>>0;return h().subarray(r,r+e.length).set(e),I=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+=W.encodeInto(n,t).written,o=e(o,r,i,1)>>>0}return I=i,o}function j(n){const t=y(n);return function(n){n<1028||(m[n]=v,v=n)}(n),t}let O=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});O.decode();const U=2146435072;let q=0;const W=new TextEncoder;"encodeInto"in W||(W.encodeInto=function(n,t){const e=W.encode(n);return t.set(e),{read:n.length,written:e.length}});let E,I=0;async function T(n){if(void 0!==E)return E;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("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!n.ok||!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 E=n.exports,l=null,g=null,E}(r)}var F,$,z;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData"}(F||(F={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}($||($={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(z||(z={}));export{n as C,t as E,$ as I,F as P,T as _,z as a}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as r}from"./p-
|
|
1
|
+
import{p as e,b as r}from"./p-D6RLmr6w.js";export{s as setNonce}from"./p-D6RLmr6w.js";import{g as n}from"./p-DQuL1Twl.js";(()=>{const r=import.meta.url,s={};return""!==r&&(s.resourcesUrl=new URL(".",r).href),e(s)})().then((async e=>(await n(),r([["p-79a71767",[[513,"phirepass-sftp-client",{name:[1],description:[1],hideHeader:[4,"hide-header"],serverHost:[1,"server-host"],serverPort:[2,"server-port"],allowInsecure:[4,"allow-insecure"],heartbeatInterval:[2,"heartbeat-interval"],nodeId:[1,"node-id"],token:[1],serverId:[1,"server-id"],max:[32],show_login_screen:[32],show_login_screen_username:[32],show_login_screen_password:[32],maximize:[64],minimize:[64]},null,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]]],["p-4e32fef4",[[513,"phirepass-terminal",{terminalOptions:[16],serverHost:[1,"server-host"],serverPort:[2,"server-port"],allowInsecure:[4,"allow-insecure"],heartbeatInterval:[2,"heartbeat-interval"],nodeId:[1,"node-id"],token:[1],serverId:[1,"server-id"]},null,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]]]],e))));
|
|
@@ -34,4 +34,21 @@ export type ProtocolMessage = {
|
|
|
34
34
|
web: ProtocolMessageWebError | ProtocolMessageWebAuthSuccess | ProtocolMessageWebTunnelOpened | ProtocolMessageWebTunnelData | ProtocolMessageWebTunnelClosed;
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
+
export declare enum ProtocolMessageType {
|
|
38
|
+
Error = "Error",
|
|
39
|
+
AuthSuccess = "AuthSuccess",
|
|
40
|
+
TunnelOpened = "TunnelOpened",
|
|
41
|
+
TunnelClosed = "TunnelClosed",
|
|
42
|
+
TunnelData = "TunnelData"
|
|
43
|
+
}
|
|
44
|
+
export declare enum InputMode {
|
|
45
|
+
Username = 0,
|
|
46
|
+
Password = 1,
|
|
47
|
+
Default = 2
|
|
48
|
+
}
|
|
49
|
+
export declare enum ConnectionState {
|
|
50
|
+
Disconnected = "disconnected",
|
|
51
|
+
Connected = "connected",
|
|
52
|
+
Error = "error"
|
|
53
|
+
}
|
|
37
54
|
export { ErrorType as ProtocolMessageError };
|
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { ConnectionState } from '../../common/protocol';
|
|
1
3
|
export declare class PhirepassSftpClient {
|
|
4
|
+
private channel;
|
|
5
|
+
private domReady;
|
|
6
|
+
private runtimeReady;
|
|
7
|
+
private connected;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
hideHeader: boolean;
|
|
11
|
+
serverHost: string;
|
|
12
|
+
serverPort: number;
|
|
13
|
+
allowInsecure: boolean;
|
|
14
|
+
heartbeatInterval: number;
|
|
15
|
+
nodeId: string;
|
|
16
|
+
token: string;
|
|
17
|
+
onNodeIdChange(newValue?: string, _oldValue?: string): void;
|
|
18
|
+
serverId?: string;
|
|
19
|
+
onServerIdChange(_newValue?: string, _oldValue?: string): void;
|
|
20
|
+
maximizeEvent: EventEmitter<boolean> | undefined;
|
|
21
|
+
maximize(): Promise<void>;
|
|
22
|
+
minimize(): Promise<void>;
|
|
23
|
+
connectionStateChanged: EventEmitter<[ConnectionState, unknown?]>;
|
|
24
|
+
max: boolean;
|
|
25
|
+
show_login_screen: boolean;
|
|
26
|
+
show_login_screen_username: boolean;
|
|
27
|
+
show_login_screen_password: boolean;
|
|
28
|
+
private toggle_max;
|
|
29
|
+
connectedCallback(): Promise<void>;
|
|
30
|
+
componentDidLoad(): void;
|
|
31
|
+
disconnectedCallback(): Promise<void>;
|
|
32
|
+
private connect;
|
|
33
|
+
private try_connect;
|
|
34
|
+
private create_web_socket_endpoint;
|
|
35
|
+
private handle_error;
|
|
36
|
+
private handle_auth_success;
|
|
37
|
+
private handle_tunnel_opened;
|
|
38
|
+
private handle_tunnel_data;
|
|
39
|
+
private handle_tunnel_closed;
|
|
40
|
+
private open_comms;
|
|
41
|
+
private close_comms;
|
|
42
|
+
private clear_creds_buffer;
|
|
43
|
+
private reset_session_state;
|
|
2
44
|
render(): any;
|
|
3
45
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
|
|
3
|
-
Disconnected = "disconnected",
|
|
4
|
-
Connected = "connected",
|
|
5
|
-
Error = "error"
|
|
6
|
-
}
|
|
2
|
+
import { ConnectionState } from '../../common/protocol';
|
|
7
3
|
export declare class PhirepassTerminal {
|
|
8
4
|
private terminal;
|
|
9
5
|
private fitAddon;
|
|
@@ -94,4 +90,3 @@ export declare class PhirepassTerminal {
|
|
|
94
90
|
private submit_password;
|
|
95
91
|
render(): any;
|
|
96
92
|
}
|
|
97
|
-
export {};
|
|
@@ -5,8 +5,43 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
import { ConnectionState } from "./common/protocol";
|
|
9
|
+
export { ConnectionState } from "./common/protocol";
|
|
8
10
|
export namespace Components {
|
|
9
11
|
interface PhirepassSftpClient {
|
|
12
|
+
/**
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
"allowInsecure": boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @default 'Client'
|
|
18
|
+
*/
|
|
19
|
+
"description": string;
|
|
20
|
+
/**
|
|
21
|
+
* @default 30_000
|
|
22
|
+
*/
|
|
23
|
+
"heartbeatInterval": number;
|
|
24
|
+
/**
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
"hideHeader": boolean;
|
|
28
|
+
"maximize": () => Promise<void>;
|
|
29
|
+
"minimize": () => Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* @default 'SFTP'
|
|
32
|
+
*/
|
|
33
|
+
"name": string;
|
|
34
|
+
"nodeId": string;
|
|
35
|
+
/**
|
|
36
|
+
* @default "phirepass.com"
|
|
37
|
+
*/
|
|
38
|
+
"serverHost": string;
|
|
39
|
+
"serverId"?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @default 443
|
|
42
|
+
*/
|
|
43
|
+
"serverPort": number;
|
|
44
|
+
"token": string;
|
|
10
45
|
}
|
|
11
46
|
interface PhirepassTerminal {
|
|
12
47
|
/**
|
|
@@ -34,12 +69,28 @@ export namespace Components {
|
|
|
34
69
|
"token": string;
|
|
35
70
|
}
|
|
36
71
|
}
|
|
72
|
+
export interface PhirepassSftpClientCustomEvent<T> extends CustomEvent<T> {
|
|
73
|
+
detail: T;
|
|
74
|
+
target: HTMLPhirepassSftpClientElement;
|
|
75
|
+
}
|
|
37
76
|
export interface PhirepassTerminalCustomEvent<T> extends CustomEvent<T> {
|
|
38
77
|
detail: T;
|
|
39
78
|
target: HTMLPhirepassTerminalElement;
|
|
40
79
|
}
|
|
41
80
|
declare global {
|
|
81
|
+
interface HTMLPhirepassSftpClientElementEventMap {
|
|
82
|
+
"maximize": any;
|
|
83
|
+
"connectionStateChanged": [ConnectionState, unknown?];
|
|
84
|
+
}
|
|
42
85
|
interface HTMLPhirepassSftpClientElement extends Components.PhirepassSftpClient, HTMLStencilElement {
|
|
86
|
+
addEventListener<K extends keyof HTMLPhirepassSftpClientElementEventMap>(type: K, listener: (this: HTMLPhirepassSftpClientElement, ev: PhirepassSftpClientCustomEvent<HTMLPhirepassSftpClientElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
87
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
88
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
89
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
90
|
+
removeEventListener<K extends keyof HTMLPhirepassSftpClientElementEventMap>(type: K, listener: (this: HTMLPhirepassSftpClientElement, ev: PhirepassSftpClientCustomEvent<HTMLPhirepassSftpClientElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
91
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
92
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
93
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
43
94
|
}
|
|
44
95
|
var HTMLPhirepassSftpClientElement: {
|
|
45
96
|
prototype: HTMLPhirepassSftpClientElement;
|
|
@@ -71,6 +122,39 @@ declare namespace LocalJSX {
|
|
|
71
122
|
type OneOf<K extends string, PropT, AttrT = PropT> = { [P in K]: PropT } & { [P in `attr:${K}` | `prop:${K}`]?: never } | { [P in `attr:${K}`]: AttrT } & { [P in K | `prop:${K}`]?: never } | { [P in `prop:${K}`]: PropT } & { [P in K | `attr:${K}`]?: never };
|
|
72
123
|
|
|
73
124
|
interface PhirepassSftpClient {
|
|
125
|
+
/**
|
|
126
|
+
* @default false
|
|
127
|
+
*/
|
|
128
|
+
"allowInsecure"?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* @default 'Client'
|
|
131
|
+
*/
|
|
132
|
+
"description"?: string;
|
|
133
|
+
/**
|
|
134
|
+
* @default 30_000
|
|
135
|
+
*/
|
|
136
|
+
"heartbeatInterval"?: number;
|
|
137
|
+
/**
|
|
138
|
+
* @default false
|
|
139
|
+
*/
|
|
140
|
+
"hideHeader"?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* @default 'SFTP'
|
|
143
|
+
*/
|
|
144
|
+
"name"?: string;
|
|
145
|
+
"nodeId": string;
|
|
146
|
+
"onConnectionStateChanged"?: (event: PhirepassSftpClientCustomEvent<[ConnectionState, unknown?]>) => void;
|
|
147
|
+
"onMaximize"?: (event: PhirepassSftpClientCustomEvent<any>) => void;
|
|
148
|
+
/**
|
|
149
|
+
* @default "phirepass.com"
|
|
150
|
+
*/
|
|
151
|
+
"serverHost"?: string;
|
|
152
|
+
"serverId"?: string;
|
|
153
|
+
/**
|
|
154
|
+
* @default 443
|
|
155
|
+
*/
|
|
156
|
+
"serverPort"?: number;
|
|
157
|
+
"token": string;
|
|
74
158
|
}
|
|
75
159
|
interface PhirepassTerminal {
|
|
76
160
|
/**
|
|
@@ -99,6 +183,18 @@ declare namespace LocalJSX {
|
|
|
99
183
|
"token": string;
|
|
100
184
|
}
|
|
101
185
|
|
|
186
|
+
interface PhirepassSftpClientAttributes {
|
|
187
|
+
"name": string;
|
|
188
|
+
"description": string;
|
|
189
|
+
"hideHeader": boolean;
|
|
190
|
+
"serverHost": string;
|
|
191
|
+
"serverPort": number;
|
|
192
|
+
"allowInsecure": boolean;
|
|
193
|
+
"heartbeatInterval": number;
|
|
194
|
+
"nodeId": string;
|
|
195
|
+
"token": string;
|
|
196
|
+
"serverId": string;
|
|
197
|
+
}
|
|
102
198
|
interface PhirepassTerminalAttributes {
|
|
103
199
|
"serverHost": string;
|
|
104
200
|
"serverPort": number;
|
|
@@ -110,7 +206,7 @@ declare namespace LocalJSX {
|
|
|
110
206
|
}
|
|
111
207
|
|
|
112
208
|
interface IntrinsicElements {
|
|
113
|
-
"phirepass-sftp-client": PhirepassSftpClient
|
|
209
|
+
"phirepass-sftp-client": Omit<PhirepassSftpClient, keyof PhirepassSftpClientAttributes> & { [K in keyof PhirepassSftpClient & keyof PhirepassSftpClientAttributes]?: PhirepassSftpClient[K] } & { [K in keyof PhirepassSftpClient & keyof PhirepassSftpClientAttributes as `attr:${K}`]?: PhirepassSftpClientAttributes[K] } & { [K in keyof PhirepassSftpClient & keyof PhirepassSftpClientAttributes as `prop:${K}`]?: PhirepassSftpClient[K] } & OneOf<"nodeId", PhirepassSftpClient["nodeId"], PhirepassSftpClientAttributes["nodeId"]> & OneOf<"token", PhirepassSftpClient["token"], PhirepassSftpClientAttributes["token"]>;
|
|
114
210
|
"phirepass-terminal": Omit<PhirepassTerminal, keyof PhirepassTerminalAttributes> & { [K in keyof PhirepassTerminal & keyof PhirepassTerminalAttributes]?: PhirepassTerminal[K] } & { [K in keyof PhirepassTerminal & keyof PhirepassTerminalAttributes as `attr:${K}`]?: PhirepassTerminalAttributes[K] } & { [K in keyof PhirepassTerminal & keyof PhirepassTerminalAttributes as `prop:${K}`]?: PhirepassTerminal[K] } & OneOf<"nodeId", PhirepassTerminal["nodeId"], PhirepassTerminalAttributes["nodeId"]> & OneOf<"token", PhirepassTerminal["token"], PhirepassTerminalAttributes["token"]>;
|
|
115
211
|
}
|
|
116
212
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phirepass-widgets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
4
|
"description": "Phirepass widgets for the web application",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"generate": "stencil generate"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@stencil/core": "^4.43.
|
|
44
|
+
"@stencil/core": "^4.43.4",
|
|
45
45
|
"@types/jest": "^29",
|
|
46
|
-
"@types/node": "^25.
|
|
46
|
+
"@types/node": "^25.6.0",
|
|
47
47
|
"jest": "^29",
|
|
48
48
|
"jest-cli": "^29",
|
|
49
|
-
"puppeteer": "^24.
|
|
49
|
+
"puppeteer": "^24.41.0"
|
|
50
50
|
},
|
|
51
51
|
"license": "AGPL-3.0-or-later",
|
|
52
52
|
"dependencies": {
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"@xterm/addon-web-links": "^0.12.0",
|
|
58
58
|
"@xterm/addon-webgl": "^0.19.0",
|
|
59
59
|
"@xterm/xterm": "^6.0.0",
|
|
60
|
-
"phirepass-channel": "^0.1.
|
|
60
|
+
"phirepass-channel": "^0.1.208"
|
|
61
61
|
}
|
|
62
62
|
}
|