phirepass-widgets 0.0.47 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/cjs/{index-BiurVooY.js → index-DqslB2R4.js} +27 -2
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +28 -12
  4. package/dist/cjs/phirepass-terminal.cjs.entry.js +2 -2
  5. package/dist/cjs/phirepass-widgets.cjs.js +1 -1
  6. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +61 -0
  7. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.download.svg +7 -0
  8. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +26 -10
  9. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +1 -1
  10. package/dist/components/index.js +1 -1
  11. package/dist/components/phirepass-sftp-client.js +1 -1
  12. package/dist/components/phirepass-terminal.js +1 -1
  13. package/dist/esm/{index-zZMsduaU.js → index-jdexunMF.js} +27 -2
  14. package/dist/esm/loader.js +2 -2
  15. package/dist/esm/phirepass-sftp-client.entry.js +28 -12
  16. package/dist/esm/phirepass-terminal.entry.js +2 -2
  17. package/dist/esm/phirepass-widgets.js +2 -2
  18. package/dist/phirepass-widgets/p-764392dc.entry.js +1 -0
  19. package/dist/phirepass-widgets/{p-5b21bc31.entry.js → p-d8e588a3.entry.js} +5 -5
  20. package/dist/phirepass-widgets/p-jdexunMF.js +2 -0
  21. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  22. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +1 -0
  23. package/package.json +1 -1
  24. package/dist/phirepass-widgets/p-32ca8ca5.entry.js +0 -1
  25. package/dist/phirepass-widgets/p-zZMsduaU.js +0 -2
@@ -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=[],y=(t,e)=>n=>{t.push(n),h||(h=!0,e&&4&f.u?$(w):f.raf(w))},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){i(t)}t.length=0},w=()=>{b(m),b(v),(h=m.length>0)&&f.raf(w)},$=t=>a().then(t),g=y(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(" "))}}if("function"==typeof t)return t(null===e?{}:e,r,N);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={forEach:(t,e)=>t.map(P).forEach(e),map:(t,e)=>t.map(P).map(e).map(R)},P=t=>({vattrs:t.v,vchildren:t.$,vkey:t.j,vname:t.k,vtag:t.O,vtext:t.m}),R=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),C(t.vtag,e,...t.vchildren||[])}const e=x(t.vtag,t.vtext);return e.v=t.vattrs,e.$=t.vchildren,e.j=t.vkey,e.k=t.vname,e},D=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},H=(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,T=t=>{var e;return null==(e=o(t))?void 0:e.$hostElement$},A=(t,e)=>{const n=T(t);return{emit:t=>U(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},U=(t,e,n)=>{const o=f.ce(e,n);return t.dispatchEvent(o),o},W=(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=F(n);let s=F(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("key"===e);else if("ref"===e)l&&et(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(V);e=e.replace(q,""),n&&f.rel(t,e,n,o),l&&f.ael(t,e,l,o)}},z=/\s/,F=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(z):[]),V="Capture",q=RegExp(V+"$"),G=(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 Y(Object.keys(l)))t in s||W(o,t,l[t],void 0,n,e.u);for(const t of Y(Object.keys(s)))W(o,t,l[t],s[t],n,e.u)};function Y(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var Z=!1,_=[],B=[],I=(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(Z||(Z="svg"===o.O),!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.createElementNS(Z?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.O),Z&&"foreignObject"===o.O&&(Z=!1),G(null,o,Z),o.$){const e="template"===o.O?l.content:l;for(i=0;i<o.$.length;++i)s=I(t,o,i),s&&e.appendChild(s)}"svg"===o.O?Z=!1:"foreignObject"===l.tagName&&(Z=!0)}return l["s-hn"]=S,l},J=(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=I(null,n,l),i&&(o[l].S=i,nt(r,i,e)))},K=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;tt(e),t&&t.remove()}}},Q=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),X=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,s=e.$,i=e.O,r=e.m;null==r?(G(t,e,Z="svg"===i||"foreignObject"!==i&&Z),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 y="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(Q(d,m,l))X(d,m,l),d=e[++r],m=o[++c];else if(Q(p,v,l))X(p,v,l),p=e[--a],v=o[--h];else if(Q(d,v,l))X(d,v,l),nt(y,d.S,p.S.nextSibling),d=e[++r],v=o[--h];else if(Q(p,m,l))X(p,m,l),nt(y,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=I(e&&e[c],n,u):(X(i,m,l),e[u]=void 0,s=i.S),m=o[++c]):(s=I(e&&e[c],n,c),m=o[++c]),s&&nt(d.S.parentNode,s,d.S)}r>a?J(t,null==o[h+1]?null:o[h+1].S,n,o,c,h):c>h&&K(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.m&&(o.textContent=""),J(o,null,e,s,0,s.length-1)):!n&&null!==l&&K(l,0,l.length-1),Z&&"svg"===i&&(Z=!1)):t.m!==r&&(o.data=r)},tt=t=>{t.v&&t.v.ref&&_.push((()=>t.v.ref(null))),t.$&&t.$.map(tt)},et=(t,e)=>{B.push((()=>t(e)))},nt=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),ot=(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()})))}},lt=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);ot(t,t.C);const n=()=>st(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},st=(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.L.length&&t.L.forEach((t=>t(n))),l=dt(o,"componentWillLoad",void 0,n)):l=dt(o,"componentWillUpdate",void 0,n),l=it(l,(()=>dt(o,"componentWillRender",void 0,n))),it(l,(()=>ct(t,o,e)))},it=(t,e)=>rt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),rt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,ct=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.N)?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);ut(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ft(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},ut=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.P||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.P=s,s.S=l.S=o.shadowRoot||o,X(l,s,n),_.forEach((t=>t())),_.length=0,B.forEach((t=>t())),B.length=0})(t,e,o)}catch(e){i(e,t.$hostElement$)}return null},ft=t=>{const e=t.$hostElement$,n=t.i,o=t.C;dt(n,"componentDidRender",void 0,e),64&t.u?dt(n,"componentDidUpdate",void 0,e):(t.u|=64,pt(e),dt(n,"componentDidLoad",void 0,e),t.R(e),o||at()),t.D(e),t.M&&(t.M(),t.M=void 0),512&t.u&&$((()=>lt(t,!1))),t.u&=-517},at=()=>{$((()=>U(u,"appload",{detail:{namespace:"phirepass-widgets"}})))},dt=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){i(t,o)}},pt=t=>t.classList.add("hydrated"),ht=(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=H(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.H){const t=l.H[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(f?f[o](n,c,e):s.L.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||lt(s,!1)}}},mt=(e,n,l)=>{var s,i;const r=e.prototype;{e.watchers&&!n.H&&(n.H=D(e.watchers)),e.deserializers&&!n.T&&(n.T=e.deserializers),e.serializers&&!n.A&&(n.A=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,H(t,s)),void ht(this,e,t=32&s?this[e]:i.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return ht(this,e,t,n),void(1&l&&!i.i&&i.L.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]=H(t,s),ht(this,e,i.i[e],n)};i.i?o():i.L.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.U)?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.H)?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.H)?i:{}),...c.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},vt=(t,e)=>{dt(t,"connectedCallback",void 0,e)},yt=(t,e)=>{dt(t,"disconnectedCallback",void 0,e||t)},bt=(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 y,b=!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],W:e[3]};p.t=e[2],p.H=D(e[4]),p.A=null!=(n=e[5])?n:{},p.T=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,F:new Map};n.U=new Promise((t=>n.D=t)),n.V=new Promise((t=>n.R=t)),t["s-p"]=[],t["s-rc"]=[],n.L=[];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),y&&(clearTimeout(y),y=null),b?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)?vt(e.i,t):(null==e?void 0:e.V)&&e.V.then((()=>vt(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){ot(e,e.C=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.q){const l=((t,e)=>{const n=t.h.replace(/-/g,"_"),o=t.q;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.G}" was not found`);o.isProxied||(n.H=D(o.watchers),n.A=o.serializers,n.T=o.deserializers,mt(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(),vt(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.C,s=()=>lt(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()}catch(n){i(n,t),e.M&&(e.M(),e.M=void 0),e.R&&e.R(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)?yt(e.i,t):(null==e?void 0:e.V)&&e.V.then((()=>yt(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.P)?void 0:t.S)instanceof Node&&!e.P.S.isConnected&&delete e.P.S}))}componentOnReady(){var t;return null==(t=o(this))?void 0:t.V}};p.q=t[0],s.includes(h)||a.get(h)||(l.push(h),a.define(h,mt(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.N)?n:O(u.document);null!=t&&m.setAttribute("nonce",t),p.insertBefore(m,h?h.nextSibling:p.firstChild)}b=!1,v.length?v.map((t=>t.connectedCallback())):f.jmp((()=>y=setTimeout(at,30)))},wt=t=>f.N=t;export{L as H,bt as b,A as c,T as g,C as h,a as p,l as r,wt as s}
@@ -1 +1 @@
1
- import{p as e,b as r}from"./p-zZMsduaU.js";export{s as setNonce}from"./p-zZMsduaU.js";import{g as o}from"./p-DQuL1Twl.js";(()=>{const r=import.meta.url,s={};return""!==r&&(s.resourcesUrl=new URL(".",r).href),e(s)})().then((async e=>(await o(),r([["p-32ca8ca5",[[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_error:[32],error_message:[32],show_login_screen_password:[32],show_navigation:[32],breadcrumbs:[32],current_dir:[32],listing:[32],show_content:[32],show_loader:[32],version:[32],status:[32],selected_item:[32],maximize:[64],minimize:[64]},null,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]]],["p-5b21bc31",[[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))));
1
+ import{p as e,b as r}from"./p-jdexunMF.js";export{s as setNonce}from"./p-jdexunMF.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-764392dc",[[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_error:[32],error_message:[32],show_login_screen_password:[32],show_navigation:[32],breadcrumbs:[32],current_dir:[32],listing:[32],show_content:[32],show_loader:[32],version:[32],status:[32],selected_item:[32],maximize:[64],minimize:[64]},null,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]]],["p-d8e588a3",[[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))));
@@ -62,6 +62,7 @@ export declare class PhirepassSftpClient {
62
62
  private go_to_parent_directory;
63
63
  private refresh_directory;
64
64
  private disconnect_session;
65
+ private on_file_row_action;
65
66
  private open_upload_picker;
66
67
  private on_upload_selected;
67
68
  private is_selected;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phirepass-widgets",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "Phirepass widgets for the web application",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as e,c as i,h as t,H as a}from"./p-zZMsduaU.js";import{_ as s,E as o,C as r,a as c,P as d}from"./p-BcIhGXR0.js";const l=class{constructor(t){e(this,t),this.maximizeEvent=i(this,"maximize"),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;domReady=!1;runtimeReady=!1;connected=!1;uploadInputEl;session_id;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(),this.status="Connecting...")}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_error=!1;error_message="";show_login_screen_password=!1;show_navigation=!1;breadcrumbs=[];current_dir=".";listing=[];show_content=!1;show_loader=!1;version="";status="Disconnected";selected_item=null;toggle_max(){this.maximizeEvent?.emit(!this.max)}async connectedCallback(){await s(),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(),this.status="Connecting..."}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){switch(e.kind){case o.Generic:case o.Authentication:this.error_message=e.message||"An unknown error occurred.";break;case o.RequiresUsername:this.show_login_screen_username=!0,this.show_login_screen_password=!1,this.show_login_screen=!0;break;case o.RequiresPassword:this.show_login_screen_username=!1,this.show_login_screen_password=!0,this.show_login_screen=!0;break;case o.RequiresUsernamePassword:this.show_login_screen_username=!0,this.show_login_screen_password=!0,this.show_login_screen=!0}setTimeout((()=>{this.show_loader=!1}),1e3)}handle_auth_success(e){this.clear_creds_buffer(),this.version=e.version,this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.channel.open_sftp_tunnel(this.nodeId),this.status="Connected"}handle_tunnel_opened(e){this.session_id=e.sid,this.channel.send_sftp_list_data(this.nodeId,this.session_id,this.current_dir)}handle_sftp_list_items(e){setTimeout((()=>{this.show_loader=!1}),500),this.listing=e.dir.items,this.current_dir=e.path,this.breadcrumbs=e.path.split("/").map(((e,i,t)=>""===e&&0===i?{label:"/",path:"/"}:{label:e,path:t.slice(0,i+1).join("/")})),this.show_content=!0,this.show_navigation=!0}handle_tunnel_data(e){console.log("received tunnel data:",e)}handle_tunnel_closed(e){this.clear_creds_buffer(),this.close_comms()}open_comms(){this.channel=this.serverId?new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId):new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([c.Connected]),this.channel.authenticate(this.token,this.nodeId),this.status="Authenticating..."})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([c.Disconnected]),this.status="Disconnected"})),this.channel.on_connection_error((e=>{this.connectionStateChanged.emit([c.Error,e]),this.status="Error "+e.message})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((e=>{const{web:i}=e.data;switch(i.type){case d.Error:this.handle_error(i);break;case d.AuthSuccess:this.handle_auth_success(i);break;case d.TunnelOpened:this.handle_tunnel_opened(i);break;case d.TunnelClosed:this.handle_tunnel_closed(i);break;case d.TunnelData:this.handle_tunnel_data(i);break;case d.SFTPListItems:this.handle_sftp_list_items(i);break;default:console.warn("Unhandled protocol message type:",i)}}))}close_comms(){this.channel.stop_heartbeat(),this.channel.disconnect()}clear_creds_buffer(){}reset_session_state(){this.clear_creds_buffer()}list_breadcrumb(e){this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,e)}go_to_parent_directory(){this.session_id&&"/"!==this.current_dir&&this.list_breadcrumb(this.breadcrumbs[this.breadcrumbs.length-2]?.path||"/")}refresh_directory(){this.session_id&&this.list_breadcrumb(this.current_dir)}disconnect_session(){this.close_comms(),this.session_id=void 0,this.status="Disconnected",this.show_loader=!1}open_upload_picker(){this.uploadInputEl?.click()}on_upload_selected(e){const i=e.target,t=i.files?.[0];t&&(this.show_error=!0,this.error_message="Upload is not available yet in this widget.",setTimeout((()=>{this.show_error=!1}),2e3),i.value="")}is_selected(e){return!!this.selected_item&&this.selected_item.path===e.path&&this.selected_item.name===e.name}list_directory(e){if(!this.session_id)return void console.warn("No active session. Cannot list directory.");if("File"===e.kind)return console.warn("Cannot list directory of a file. Ignoring click."),void(this.selected_item=e);const i=[e.path,e.name].join("/");i!==this.current_dir?(this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,i)):console.warn("Already in this directory. Ignoring click.")}get_full_path(e){return[e.path,e.name].join("/")}render(){return t(a,{key:"c19b87e943347cc55424450e7e4f10bc3447e828",class:{default:!this.max,max:this.max}},t("section",{key:"88ecbc0d1a1460dd262150706216f7f758fb7981",class:"listing"},!this.hideHeader&&t("header",{key:"dd28677d023aeaf431cb3b99449751f6385c767d"},t("section",{key:"ad56b31550d096cb59e92bc6167be11b76a9c368",class:"title"},t("img",{key:"00ce4e832edfb672b0eadb0462a5a132cfa67e09",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==",alt:"SFTP Client"}),t("div",{key:"ee186cc2c643afefa425bb6ce862686dce5ba6ab",class:"text"},t("div",{key:"29c5922bf9826930ac33fe6c200bf47fce1e183e",class:"name"},this.name),t("div",{key:"76d6bba6cb51b9907db533395c258ee7458cf5ce",class:"description"},this.description))),t("section",{key:"d3bfbf402aed51cba973830b14b9d4f276011535",class:"actions"},t("div",{key:"87eb4484d8552a582c35e4960a82003f7570bf26",class:"action",onClick:()=>this.toggle_max()},t("img",{key:"3ff40a471fc54a1d97a4aa5c4746dc837082307d",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K",alt:"Maximize"})))),t("main",{key:"a441806676df938682df422acce7b640e452eece"},this.show_navigation&&t("nav",{key:"d7fe91b30ecd998985301c2f0ac5064ee4bfc9fa",class:"navigation"},t("div",{key:"17bd0d958fb55b8a89b6af7becbeb1cd892066a5",class:"breadcrumbs"},this.breadcrumbs.map(((e,i,a)=>t(t.Fragment,null,t("span",{key:i,onClick:()=>this.list_breadcrumb(e.path),class:"breadcrumb"},e.label),i<a.length-1&&t("img",{class:"arrow",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogICAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIKICAgIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQgdy0zIGgtMyB0ZXh0LW11dGVkLWZvcmVncm91bmQvNTAgc2hyaW5rLTAiPgogICAgPHBhdGggZD0ibTkgMTggNi02LTYtNiI+PC9wYXRoPgo8L3N2Zz4K"}))))),t("section",{key:"0f65ff3c51a3aeba3bf046445fc858b05e1e5106",class:"actions","aria-label":"SFTP actions"},t("button",{key:"5184ea48385f5b1f235e7fe0a01eed0171782e76",type:"button",class:"action",onClick:()=>this.go_to_parent_directory(),title:"Go to parent directory","aria-label":"Go to parent directory"},t("img",{key:"345aa00fe17569c8d9037e9304b381868effe862",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtYXJyb3ctdXAgdy0zLjUgaC0zLjUiPgogICAgPHBhdGggZD0ibTUgMTIgNy03IDcgNyI+PC9wYXRoPgogICAgPHBhdGggZD0iTTEyIDE5VjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Go up"})),t("button",{key:"eec7a682ed944746eabf939dfff1073bb85dfae6",type:"button",class:"action",onClick:()=>this.refresh_directory(),title:"Refresh","aria-label":"Refresh"},t("img",{key:"ab1faf4dc27ca0a85b152c559b2f4953c7fddb15",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtcmVmcmVzaC1jdyB3LTMuNSBoLTMuNSI+CiAgICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAwIDEgOS05IDkuNzUgOS43NSAwIDAgMSA2Ljc0IDIuNzRMMjEgOCI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDN2NWgtNSI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDEyYTkgOSAwIDAgMS05IDkgOS43NSA5Ljc1IDAgMCAxLTYuNzQtMi43NEwzIDE2Ij48L3BhdGg+CiAgICA8cGF0aCBkPSJNOCAxNkgzdjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Refresh"})),t("button",{key:"529ad0cd6e000978294be16aedb9ec8f2b6d699e",type:"button",class:"action",onClick:()=>this.open_upload_picker(),title:"Upload","aria-label":"Upload"},t("img",{key:"669ceed59555391014ea531e4398517a1c4bc77a",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==",alt:"Upload"})),t("button",{key:"3b0602bd52a1ed066e76f136ba18e67a2e923f05",type:"button",class:"action disconnect",onClick:()=>this.disconnect_session(),title:"Disconnect","aria-label":"Disconnect"},"DISCONNECT"))),t("input",{key:"272d2fe2f2d61b02c4d2e5c8624f2c0ccc7daa92",type:"file",ref:e=>this.uploadInputEl=e,onChange:e=>this.on_upload_selected(e),style:{display:"none"}}),this.show_content&&t("div",{key:"2f080688bfa4c95663c278d875eceebbda78094a",class:"content"},t("table",{key:"3c10b9615ba21dce3aaa47850d03f083d0ef0107"},t("thead",{key:"366af5b1b875d394450b78b6490c813ac930f0fa"},t("tr",{key:"d3116485a0f02953c96e309f1c44d5e47cea9dcd"},t("th",{key:"6af47d08c0bac5dd887ceda7b3f75101caeaebc3"},"Name"),t("th",{key:"3c8c72711429b988e24118810ef3ea30eb779bb7"},"Size"),t("th",{key:"8dd16c387287e4dd3bf29dbea304f6dd8871686a"},"Permissions"),t("th",{key:"7b2c6ca49d8dd4150895307a4499d3e083cc8900"},"Owner"),t("th",{key:"1723d32cf185dbaeea6d3bd9dbe3f72fc055c5a2"},"Modified"))),t("tbody",{key:"685d9eae4f0ac61e07b44710be235bafaaefa7df"},this.listing.map(((e,i)=>t("tr",{key:i,class:{selected:this.is_selected(e)},onClick:()=>this.list_directory(e)},t("td",null,t("img","Folder"===e.kind?{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1mb2xkZXIgdy0zLjUgaC0zLjUgdGV4dC1wcmltYXJ5IHNocmluay0wIj4KICAgIDxwYXRoCiAgICAgICAgZD0iTTIwIDIwYTIgMiAwIDAgMCAyLTJWOGEyIDIgMCAwIDAtMi0yaC03LjlhMiAyIDAgMCAxLTEuNjktLjlMOS42IDMuOUEyIDIgMCAwIDAgNy45MyAzSDRhMiAyIDAgMCAwLTIgMnYxM2EyIDIgMCAwIDAgMiAyWiI+PC9wYXRoPgo8L3N2Zz4K",alt:"Folder"}:{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtZmlsZSB3LTMuNSBoLTMuNSB0ZXh0LW11dGVkLWZvcmVncm91bmQgc2hyaW5rLTAiPgogICAgPHBhdGggZD0iTTE1IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY3WiI+PC9wYXRoPgogICAgPHBhdGggZD0iTTE0IDJ2NGEyIDIgMCAwIDAgMiAyaDQiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"File"}),t("span",{class:`name ${e.kind.toLowerCase()}`},e.name)),t("td",null,e.attributes.size),t("td",null,e.attributes.permissions??"-"),t("td",null,e.attributes.user??"-"),t("td",null,new Date(1e3*e.attributes.mtime).toLocaleString()))))))),this.show_loader&&t("div",{key:"8337354a4cd9ca456d7845ff4934ceebb36f7dc6",class:"loader"},"Loading..."),this.show_error&&t("div",{key:"c547ad1c0f24de427a77129f77402830910e98b4",class:"error"},this.error_message)),t("footer",{key:"e452f0e2f7982049df57498ef9ed1cf63c70e9eb"},t("section",{key:"00111d90943b2bfb21392dede79af5e009d43524",class:"status"},t("span",{key:"1c10ae5cb21118059fe61625f9fc4d0aa18be448"},this.status),this.selected_item&&t("span",{key:"82939fb59d72ca3823e8c580578a6f13ce4079b0",class:"selected-item"},this.get_full_path(this.selected_item))),t("section",{key:"38380847cf818eb024ec5743ffd92e3369b2cc40",class:"version"},"Version: ",this.version))),this.show_login_screen&&t("section",{key:"1840f9bae95e8906c38dade1e15f6c52f360829b",class:{creds:!0,blurred:this.show_login_screen}},t("form",{key:"b7b7c3494329a93aafc6c948c879ba8ecd8bd42a",class:"auth",onSubmit:e=>{const i=new FormData(e.target);let t,a;this.show_login_screen_username&&(t=i.get("username")),this.show_login_screen_password&&(a=i.get("password")),this.channel.open_sftp_tunnel(this.nodeId,t,a),this.show_login_screen_username=!1,this.show_login_screen_password=!1,this.show_login_screen=!1,this.show_loader=!0,e.stopPropagation(),e.preventDefault()}},t("div",{key:"25a15115fb41d65d59750a176d46a7e844286e00",class:"title"},"SFTP Connection"),this.show_login_screen_username&&t("div",{key:"13f5053dbf65445220551f554df5ab03fb7fb7c0"},t("label",{key:"5016afe8eb38c54800697fbe2d4602269966edc9",htmlFor:"username"},"Username"),t("input",{key:"48e7e3029b0369e06f5d1bafcf4bc9bc3fccfb1a",id:"username",autoComplete:"off",name:"username",type:"text",placeholder:""})),this.show_login_screen_password&&t("div",{key:"cd06fc73813094a57899c3be077f3dba0a5ca133"},t("label",{key:"f64e3145d4df56d4654dedb0188c2a33db09634b",htmlFor:"password"},"Password"),t("input",{key:"6e22d7cfbf40b8d2e77a23730d55df2e900d5da7",id:"password",autoComplete:"off",name:"password",type:"password",placeholder:""})),t("div",{key:"9405dbf23cb588db9b2368c3155a9230ab046438"},t("button",{key:"b8087e7b9a828db3d6b36f8fe06d564c76d01402",type:"submit"},"Connect")))))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};l.style=":host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--radius:0.375rem;--destructive:0 70% 50%;--muted:220 15% 13%;--muted-foreground:220 10% 50%;--primary-foreground:220 20% 7%;--scroll-track:220 16% 12%;--scroll-thumb:220 12% 34%;--scroll-thumb-hover:160 45% 44%;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;min-height:0;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))}}}}main{flex:1;display:flex;flex-direction:column;position:relative;min-height:0;overflow:hidden;.loader{color:hsl(var(--muted-foreground));font-size:13px;animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;text-align:center;display:flex;align-items:center;justify-content:center;position:absolute;height:100%;width:100%;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.error{font-size:13px;text-align:center;color:hsl(var(--destructive));height:100%;display:flex;align-items:center;justify-content:center}.navigation{height:25px;padding:10px;font-size:0.75rem;line-height:1rem;background-color:hsl(var(--card));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));position:sticky;top:0;z-index:3;.breadcrumbs{display:flex;align-items:center;margin-right:10px;.breadcrumb{color:hsl(var(--primary));margin-right:4px;cursor:pointer;&:after{margin-left:4px}&:hover{color:rgb(189, 219, 209)}&:last-child{margin-right:0;color:rgb(189, 219, 209);cursor:default}}.arrow{height:12px;width:12px;opacity:0.6;top:2px;margin-right:4px;position:relative}}.actions{display:flex;align-items:center;gap:8px}.action{border:none;background:transparent;color:rgb(189, 219, 209);font-size:1.1rem;line-height:1;padding:2px 4px;border-radius:4px;cursor:pointer;&:hover{background-color:hsl(var(--border) / 0.6)}img{height:14px;width:14px;display:block}}.action.disconnect{color:#ff4d5f;font-size:0.65rem;letter-spacing:0.08em;padding:4px 8px;&:hover{color:#ff6b7a;background-color:hsl(var(--destructive) / 0.12)}}}.content{flex:1;min-height:0;overflow:auto;font-size:0.75rem;line-height:1rem;scrollbar-width:thin;scrollbar-color:hsl(var(--scroll-thumb)) hsl(var(--scroll-track));&::-webkit-scrollbar{width:10px;height:10px}&::-webkit-scrollbar-track{background:hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb{background:hsl(var(--scroll-thumb));border-radius:999px;border:2px solid hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb:hover{background:hsl(var(--scroll-thumb-hover))}table{width:100%;border-collapse:separate;border-spacing:0;thead{background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));th{padding:8px 10px;text-align:left;color:hsl(var(--muted-foreground));position:sticky;top:0;z-index:2;background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));line-height:0.95rem}}tbody{padding:10px 10px;tr{border-bottom:1px solid hsl(var(--border) / 0.4);td{padding:10px 10px 9px;color:hsl(var(--muted-foreground));.name{&.file{color:rgb(189, 219, 209)}&.folder{color:hsl(var(--primary))}}.kind{height:14px;width:14px;margin-right:5px;top:3px;position:relative}}&:hover{cursor:pointer;background-color:hsl(var(--muted) / 0.4)}&.selected{background-color:hsl(var(--primary) / 0.3);&:hover{background-color:hsl(var(--primary) / 0.4)}}}}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border));font-size:0.75rem;line-height:1rem;display:flex;align-items:center;justify-content:space-between;padding:0 10px;.status{font-size:0.65rem;color:hsl(var(--muted-foreground));.selected-item{margin-left:10px;color:hsl(var(--primary))}}.version{font-size:0.65rem;color:hsl(var(--muted-foreground))}}}.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)}.auth{display:flex;flex-direction:column;background:hsl(var(--card));position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:30px;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;border-radius:var(--radius);.title{margin-bottom:12px;color:hsl(var(--primary))}label{font-size:0.75rem;line-height:1rem;margin-bottom:1rem;color:hsl(var(--muted-foreground))}input{font-size:0.875rem;line-height:1.25rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;background-color:rgb(28, 31, 38);border-color:rgb(39, 44, 53);border-width:1px;border-radius:calc(var(--radius) - 2px);width:100%;margin-bottom:12px;color:rgb(189, 219, 209);box-sizing:border-box;&:focus{outline:none;border-color:hsl(var(--primary));box-shadow:0 0 0 1px hsl(var(--primary))}}button[type='submit']{margin-top:12px;width:100%;background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));letter-spacing:0.05em;font-size:13px;font-weight:500;padding:0.5rem 1rem;border-radius:calc(var(--radius) - 2px);height:2rem;cursor:pointer;border:none;&:hover{background-color:hsl(var(--primary) / 0.9)}}}}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}";export{l as phirepass_sftp_client}
@@ -1,2 +0,0 @@
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],i=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);i&&Object.defineProperty(e,o,{get(){return i.get.call(this)},set(t){i.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))},i=(t,e)=>e in t,s=(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=[],y=(t,e)=>n=>{t.push(n),h||(h=!0,e&&4&f.u?w($):f.raf($))},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},$=()=>{b(m),b(v),(h=m.length>0)&&f.raf($)},w=t=>a().then(t),g=y(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,i=!1,s=!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&&((i="function"!=typeof t&&!M(o))&&(o+=""),i&&s?r[r.length-1].m+=o:r.push(i?x(null,o):o),s=i)};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(" "))}}if("function"==typeof t)return t(null===e?{}:e,r,N);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={forEach:(t,e)=>t.map(P).forEach(e),map:(t,e)=>t.map(P).map(e).map(R)},P=t=>({vattrs:t.v,vchildren:t.$,vkey:t.j,vname:t.k,vtag:t.O,vtext:t.m}),R=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),C(t.vtag,e,...t.vchildren||[])}const e=x(t.vtag,t.vtext);return e.v=t.vattrs,e.$=t.vchildren,e.j=t.vkey,e.k=t.vname,e},D=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},H=(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,T=t=>{var e;return null==(e=o(t))?void 0:e.$hostElement$},A=(t,e)=>{const n=T(t);return{emit:t=>U(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},U=(t,e,n)=>{const o=f.ce(e,n);return t.dispatchEvent(o),o},W=(t,e,n,l,s,r)=>{if(n===l)return;let c=i(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,o=F(n);let i=F(l);e.remove(...o.filter((t=>t&&!i.includes(t)))),e.add(...i.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)l&&null!=l[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in l)n&&l[e]===n[e]||(e.includes("-")?t.style.setProperty(e,l[e]):t.style[e]=l[e])}else if("key"===e);else if("ref"===e)l&&et(l,t);else if(c||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let i;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(i=t[1])}}return i||(i=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(i)||t.removeAttribute(i):t.setAttribute(i,!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)&&!s)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||s)&&!o&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}else if(e="-"===e[2]?e.slice(3):i(u,a)?a.slice(2):a[2]+e.slice(3),n||l){const o=e.endsWith(V);e=e.replace(q,""),n&&f.rel(t,e,n,o),l&&f.ael(t,e,l,o)}},z=/\s/,F=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(z):[]),V="Capture",q=RegExp(V+"$"),G=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.v||{},i=e.v||{};for(const t of Y(Object.keys(l)))t in i||W(o,t,l[t],void 0,n,e.u);for(const t of Y(Object.keys(i)))W(o,t,l[t],i[t],n,e.u)};function Y(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var Z=!1,_=[],B=[],I=(t,e,n)=>{const o=e.$[n];let l,i,s=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),G(null,o,Z),o.$){const e="template"===o.O?l.content:l;for(s=0;s<o.$.length;++s)i=I(t,o,s),i&&e.appendChild(i)}}return l["s-hn"]=S,l},J=(t,e,n,o,l,i)=>{let s,r=t;for(r.shadowRoot&&r.tagName===S&&(r=r.shadowRoot),"template"===n.O&&(r=r.content);l<=i;++l)o[l]&&(s=I(null,n,l),s&&(o[l].S=s,nt(r,s,e)))},K=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;tt(e),t&&t.remove()}}},Q=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.j&&e.j&&(t.j=e.j),!0):t.j===e.j),X=(t,e,n=!1)=>{const o=e.S=t.S,l=t.$,i=e.$,s=e.m;null==s?(G(t,e,Z),null!==l&&null!==i?((t,e,n,o,l=!1)=>{let i,s,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 y="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(Q(d,m,l))X(d,m,l),d=e[++r],m=o[++c];else if(Q(p,v,l))X(p,v,l),p=e[--a],v=o[--h];else if(Q(d,v,l))X(d,v,l),nt(y,d.S,p.S.nextSibling),d=e[++r],v=o[--h];else if(Q(p,m,l))X(p,m,l),nt(y,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?(s=e[u],s.O!==m.O?i=I(e&&e[c],n,u):(X(s,m,l),e[u]=void 0,i=s.S),m=o[++c]):(i=I(e&&e[c],n,c),m=o[++c]),i&&nt(d.S.parentNode,i,d.S)}r>a?J(t,null==o[h+1]?null:o[h+1].S,n,o,c,h):c>h&&K(e,r,a)})(o,l,e,i,n):null!==i?(null!==t.m&&(o.textContent=""),J(o,null,e,i,0,i.length-1)):!n&&null!==l&&K(l,0,l.length-1)):t.m!==s&&(o.data=s)},tt=t=>{t.v&&t.v.ref&&_.push((()=>t.v.ref(null))),t.$&&t.$.map(tt)},et=(t,e)=>{B.push((()=>t(e)))},nt=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),ot=(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()})))}},lt=(t,e)=>{if(t.u|=16,4&t.u)return void(t.u|=512);ot(t,t.C);const n=()=>it(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},it=(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.L.length&&t.L.forEach((t=>t(n))),l=dt(o,"componentWillLoad",void 0,n)):l=dt(o,"componentWillUpdate",void 0,n),l=st(l,(()=>dt(o,"componentWillRender",void 0,n))),st(l,(()=>ct(t,o,e)))},st=(t,e)=>rt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),rt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,ct=async(t,e,n)=>{var o;const l=t.$hostElement$,i=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n,o,l;const i=E(e),s=c.get(i);if(!u.document)return i;if(t=11===t.nodeType?t:u.document,s)if("string"==typeof s){let l,r=k.get(t=t.head||t);if(r||k.set(t,r=new Set),!r.has(i)){l=u.document.createElement("style"),l.textContent=s;const c=null!=(n=f.N)?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(s),p?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=s+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(i)}}else{let e=k.get(t);if(e||k.set(t,e=new Set),!e.has(i)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(s.constructor===n.CSSStyleSheet)o=s;else{o=new n.CSSStyleSheet;for(let t=0;t<s.cssRules.length;t++)o.insertRule(s.cssRules[t].cssText,t)}p?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(i)}}return i})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);ut(t,e,l,n),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ft(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.u|=4,e.length=0)}},ut=(t,e,n,o)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.P||x(null,null),i=(t=>t&&t.O===L)(e)?e:C(null,null,e);if(S=o.tagName,n&&i.v)for(const t of Object.keys(i.v))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.v[t]=o[t]);i.O=null,i.u|=4,t.P=i,i.S=l.S=o.shadowRoot||o,X(l,i,n),_.forEach((t=>t())),_.length=0,B.forEach((t=>t())),B.length=0})(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},ft=t=>{const e=t.$hostElement$,n=t.i,o=t.C;dt(n,"componentDidRender",void 0,e),64&t.u?dt(n,"componentDidUpdate",void 0,e):(t.u|=64,pt(e),dt(n,"componentDidLoad",void 0,e),t.R(e),o||at()),t.D(e),t.M&&(t.M(),t.M=void 0),512&t.u&&w((()=>lt(t,!1))),t.u&=-517},at=()=>{w((()=>U(u,"appload",{detail:{namespace:"phirepass-widgets"}})))},dt=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,o)}},pt=t=>t.classList.add("hydrated"),ht=(t,e,n,l)=>{const i=o(t);if(!i)return;if(!i)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=i.$hostElement$,c=i.l.get(e),u=i.u,f=i.i;if(n=H(n,l.t[e][0]),!(8&u&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.l.set(e,n),l.H){const t=l.H[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&u||1&l)&&(f?f[o](n,c,e):i.L.push((()=>{i.i[o](n,c,e)})))}catch(t){s(t,r)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||lt(i,!1)}}},mt=(e,n,l)=>{var i,s;const r=e.prototype;{e.watchers&&!n.H&&(n.H=D(e.watchers)),e.deserializers&&!n.T&&(n.T=e.deserializers),e.serializers&&!n.A&&(n.A=e.serializers);const c=Object.entries(null!=(i=n.t)?i:{});if(c.map((([e,[i]])=>{if(31&i||2&l&&32&i){const{get:s,set:c}=t(r,e)||{};s&&(n.t[e][0]|=2048),c&&(n.t[e][0]|=4096),(1&l||!s)&&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 s=o(this);if(s){if(c)return void 0===(32&i?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),c.call(this,H(t,i)),void ht(this,e,t=32&i?this[e]:s.$hostElement$[e],n);{if(!(1&l&&4096&n.t[e][0]))return ht(this,e,t,n),void(1&l&&!s.i&&s.L.push((()=>{4096&n.t[e][0]&&s.i[e]!==s.l.get(e)&&(s.i[e]=t)})));const o=()=>{const o=s.i[e];!s.l.get(e)&&o&&s.l.set(e,o),s.i[e]=H(t,i),ht(this,e,s.i[e],n)};s.i?o():s.L.push((()=>{o()}))}}}})}else 1&l&&64&i&&Object.defineProperty(r,e,{value(...t){var n;const l=o(this);return null==(n=null==l?void 0:l.U)?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,i){f.jmp((()=>{var s;const u=t.get(e),f=o(this);if(this.hasOwnProperty(u)&&(i=this[u],delete this[u]),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==i)return;if(null==u){const t=null==f?void 0:f.u;if(f&&t&&!(8&t)&&i!==l){const o=f.i,r=null==(s=n.H)?void 0:s[e];null==r||r.forEach((n=>{const[[s,r]]=Object.entries(n);null!=o[s]&&(128&t||1&r)&&o[s].call(o,i,l,e)}))}return}const a=c.find((([t])=>t===u)),d=a&&4&a[1][0],p=d&&null===i&&void 0===this[u];d&&(i=null!==i&&"false"!==i);const h=Object.getOwnPropertyDescriptor(r,u);p||i==this[u]||h.get&&!h.set||(this[u]=i)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.H)?s:{}),...c.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},vt=(t,e)=>{dt(t,"connectedCallback",void 0,e)},yt=(t,e)=>{dt(t,"disconnectedCallback",void 0,e||t)},bt=(t,e={})=>{var n;if(!u.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const l=[],i=e.exclude||[],a=u.customElements,p=u.document.head,h=p.querySelector("meta[charset]"),m=u.document.createElement("style"),v=[];let y,b=!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],W:e[3]};p.t=e[2],p.H=D(e[4]),p.A=null!=(n=e[5])?n:{},p.T=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,F:new Map};n.U=new Promise((t=>n.D=t)),n.V=new Promise((t=>n.R=t)),t["s-p"]=[],t["s-rc"]=[],n.L=[];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),y&&(clearTimeout(y),y=null),b?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)?vt(e.i,t):(null==e?void 0:e.V)&&e.V.then((()=>vt(e.i,t)));else{e.u|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){ot(e,e.C=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.q){const l=((t,e)=>{const n=t.h.replace(/-/g,"_"),o=t.q;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=>{s(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.G}" was not found`);o.isProxied||(n.H=D(o.watchers),n.A=o.serializers,n.T=o.deserializers,mt(o,n,2),o.isProxied=!0);const i=()=>{};e.u|=8;try{new o(e)}catch(e){s(e,t)}e.u&=-9,e.u|=128,i(),vt(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.C,i=()=>lt(e,!0);l&&l["s-rc"]?l["s-rc"].push(i):i()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),e.R&&e.R(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)?yt(e.i,t):(null==e?void 0:e.V)&&e.V.then((()=>yt(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.P)?void 0:t.S)instanceof Node&&!e.P.S.isConnected&&delete e.P.S}))}componentOnReady(){var t;return null==(t=o(this))?void 0:t.V}};p.q=t[0],i.includes(h)||a.get(h)||(l.push(h),a.define(h,mt(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.N)?n:O(u.document);null!=t&&m.setAttribute("nonce",t),p.insertBefore(m,h?h.nextSibling:p.firstChild)}b=!1,v.length?v.map((t=>t.connectedCallback())):f.jmp((()=>y=setTimeout(at,30)))},$t=t=>f.N=t;export{L as H,bt as b,A as c,T as g,C as h,a as p,l as r,$t as s}