phirepass-widgets 0.0.116 → 0.0.118

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 (88) hide show
  1. package/README.md +10 -20
  2. package/dist/cjs/{index-BCgmMoIq.js → index-C3v5xmUo.js} +3 -75
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/phirepass-rdp.cjs.entry.js +5 -16
  5. package/dist/cjs/phirepass-sftp-client.cjs.entry.js +1470 -0
  6. package/dist/cjs/phirepass-terminal.cjs.entry.js +4 -4
  7. package/dist/cjs/phirepass-widgets.cjs.js +3 -3
  8. package/dist/cjs/{protocol-BjOgJZ9-.js → protocol-DCBMfc2u.js} +21 -277
  9. package/dist/collection/collection-manifest.json +1 -3
  10. package/dist/collection/common/channel.js +1 -21
  11. package/dist/collection/components/phirepass-rdp/phirepass-rdp.js +13 -36
  12. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +0 -122
  13. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +31 -181
  14. package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +2 -2
  15. package/dist/collection/phirepass-channel_bg.wasm +0 -0
  16. package/dist/components/index.js +1 -1
  17. package/dist/components/p-CsYQJXY2.js +1 -0
  18. package/dist/components/phirepass-rdp.js +1 -1
  19. package/dist/components/phirepass-sftp-client.js +1 -1
  20. package/dist/components/phirepass-terminal.js +5 -5
  21. package/dist/esm/{index-Dd9o0CbU.js → index-BVOulYtW.js} +3 -75
  22. package/dist/esm/loader.js +3 -3
  23. package/dist/esm/phirepass-rdp.entry.js +5 -16
  24. package/dist/esm/phirepass-sftp-client.entry.js +1468 -0
  25. package/dist/esm/phirepass-terminal.entry.js +4 -4
  26. package/dist/esm/phirepass-widgets.js +4 -4
  27. package/dist/esm/{protocol-BekUePpu.js → protocol-CsYQJXY2.js} +20 -276
  28. package/dist/phirepass-widgets/{p-c28a9257.entry.js → p-7ea2fdbc.entry.js} +2 -2
  29. package/dist/phirepass-widgets/p-BVOulYtW.js +3 -0
  30. package/dist/phirepass-widgets/p-CsYQJXY2.js +1 -0
  31. package/dist/phirepass-widgets/p-c1c616ca.entry.js +1 -0
  32. package/dist/phirepass-widgets/p-f1bc04a8.entry.js +1 -0
  33. package/dist/phirepass-widgets/phirepass-channel_bg.wasm +0 -0
  34. package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
  35. package/dist/types/common/channel.d.ts +0 -30
  36. package/dist/types/components/phirepass-rdp/phirepass-rdp.d.ts +0 -10
  37. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +0 -30
  38. package/dist/types/components.d.ts +34 -434
  39. package/package.json +5 -19
  40. package/dist/cjs/phirepass-downloader_3.cjs.entry.js +0 -3812
  41. package/dist/collection/common/fetch.js +0 -44
  42. package/dist/collection/components/phirepass-downloader/form.js +0 -69
  43. package/dist/collection/components/phirepass-downloader/format.js +0 -105
  44. package/dist/collection/components/phirepass-downloader/jobs.js +0 -393
  45. package/dist/collection/components/phirepass-downloader/phirepass-downloader.css +0 -1109
  46. package/dist/collection/components/phirepass-downloader/phirepass-downloader.js +0 -1455
  47. package/dist/collection/components/phirepass-downloader/source.js +0 -120
  48. package/dist/collection/components/phirepass-downloader/views/dialogs.js +0 -34
  49. package/dist/collection/components/phirepass-downloader/views/fetch-form.js +0 -65
  50. package/dist/collection/components/phirepass-downloader/views/icons.js +0 -34
  51. package/dist/collection/components/phirepass-downloader/views/job-row.js +0 -91
  52. package/dist/collection/components/phirepass-downloader/views/notices.js +0 -15
  53. package/dist/collection/components/phirepass-downloader/views/states.js +0 -19
  54. package/dist/collection/components/phirepass-media-player/phirepass-media-player.css +0 -225
  55. package/dist/collection/components/phirepass-media-player/phirepass-media-player.js +0 -549
  56. package/dist/collection/components/phirepass-media-player/player.js +0 -118
  57. package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.fetch.js +0 -35
  58. package/dist/collection/testing/fixtures.js +0 -219
  59. package/dist/collection/testing/mock-channel.js +0 -410
  60. package/dist/components/p-5QoAejYG.js +0 -1
  61. package/dist/components/p-BekUePpu.js +0 -1
  62. package/dist/components/p-DIf-Ru26.js +0 -1
  63. package/dist/components/phirepass-downloader.d.ts +0 -11
  64. package/dist/components/phirepass-downloader.js +0 -1
  65. package/dist/components/phirepass-media-player.d.ts +0 -11
  66. package/dist/components/phirepass-media-player.js +0 -1
  67. package/dist/esm/phirepass-downloader_3.entry.js +0 -3808
  68. package/dist/phirepass-widgets/p-70a67e4d.entry.js +0 -1
  69. package/dist/phirepass-widgets/p-BekUePpu.js +0 -1
  70. package/dist/phirepass-widgets/p-Dd9o0CbU.js +0 -3
  71. package/dist/phirepass-widgets/p-ab33f71f.entry.js +0 -1
  72. package/dist/types/common/fetch.d.ts +0 -167
  73. package/dist/types/components/phirepass-downloader/form.d.ts +0 -54
  74. package/dist/types/components/phirepass-downloader/format.d.ts +0 -17
  75. package/dist/types/components/phirepass-downloader/jobs.d.ts +0 -123
  76. package/dist/types/components/phirepass-downloader/phirepass-downloader.d.ts +0 -231
  77. package/dist/types/components/phirepass-downloader/source.d.ts +0 -61
  78. package/dist/types/components/phirepass-downloader/views/dialogs.d.ts +0 -52
  79. package/dist/types/components/phirepass-downloader/views/fetch-form.d.ts +0 -31
  80. package/dist/types/components/phirepass-downloader/views/icons.d.ts +0 -5
  81. package/dist/types/components/phirepass-downloader/views/job-row.d.ts +0 -21
  82. package/dist/types/components/phirepass-downloader/views/notices.d.ts +0 -18
  83. package/dist/types/components/phirepass-downloader/views/states.d.ts +0 -38
  84. package/dist/types/components/phirepass-media-player/phirepass-media-player.d.ts +0 -82
  85. package/dist/types/components/phirepass-media-player/player.d.ts +0 -53
  86. package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.fetch.d.ts +0 -40
  87. package/dist/types/testing/fixtures.d.ts +0 -25
  88. package/dist/types/testing/mock-channel.d.ts +0 -132
@@ -1 +1 @@
1
- function t(t,e,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==l;){const l=Object.getOwnPropertyDescriptor(t,e);if(l&&(!n||l.get))return l;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},l=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="http://www.w3.org/1999/xlink",c="undefined"!=typeof window?window:{},u=c.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},a=(()=>{try{return!!c.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),d=!!a&&(()=>!!c.document&&Object.getOwnPropertyDescriptor(c.document.adoptedStyleSheets,"length").writable)(),p=!1,h=[],m=[],v=()=>{var t;return(null==(t=c.document)?void 0:t.hidden)?setTimeout($,16):f.raf($)},b=(t,e)=>n=>{t.push(n),p||(p=!0,e&&4&f.i?g($):v())},y=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},$=()=>{y(h),y(m),(p=h.length>0)&&v()},g=t=>Promise.resolve(void 0).then(t),w=b(m,!0),j=t=>{const e=new URL(t,f.u);return e.origin!==c.location.origin?e.href:e.pathname},O=t=>f.u=t;function S(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(d?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var k,M=new WeakMap,E=t=>"sc-"+t.p,x=t=>"object"==(t=typeof t)||"function"===t,A=(t,e,...n)=>{let l=null,o=null,i=!1,r=!1;const c=[],u=e=>{for(let n=0;n<e.length;n++)if(l=e[n],Array.isArray(l))u(l);else if(null!=l&&"boolean"!=typeof l){if(i="function"!=typeof t&&!x(l))l+="";else if("function"!=typeof t&&void 0===l.i){s("Invalid vNode child");continue}i&&r?c[c.length-1].h+=l:c.push(i?C(null,l):l),r=i}};if(u(n),e){e.key&&(o=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,c,L);const f=C(t,null);return f.m=e,c.length>0&&(f.v=c),f.$=o,f},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,v:null,m:null,$:null}),N={},L={forEach:(t,e)=>t.map(_).forEach(e),map:(t,e)=>t.map(_).map(e).map(D)},_=t=>({vattrs:t.m,vchildren:t.v,vkey:t.$,vname:t.S,vtag:t.j,vtext:t.h}),D=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),A(t.vtag,e,...t.vchildren||[])}const e=C(t.vtag,t.vtext);return e.m=t.vattrs,e.v=t.vchildren,e.$=t.vkey,e.S=t.vname,e},H=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const l of e){if(n)break;for(const e of t[l])if("string"==typeof e){n=!0;break}}if(!n)return t;const l={};for(const n of e)l[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return l},P=(t,e)=>null==t||x(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,e)=>{const n=t;return{emit:t=>U(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},U=(t,e,n)=>{const l=f.ce(e,n);return t.dispatchEvent(l),l},W=(t,e,n,s,i,u)=>{if(n===s)return;let a=o(t,e),d=e.toLowerCase();if("class"===e){const e=t.classList,l=q(n);let o=q(s);{let t=l.filter((t=>t&&!o.includes(t)));e.remove(...t),e.add(...o.filter((t=>t&&!l.includes(t))))}}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&ot(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let o;{const e=l(t);if(e&&e.l&&e.l.t){const t=e.l.t[n];t&&t[1]&&(o=t[1])}}return o||(o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(o)||t.removeAttribute(o):t.setAttribute(o,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const l=x(s);if((a||l&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const l=null==s?"":s;"list"===e?a=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}let o=!1;d!==(d=d.replace(/^xlink\:?/,""))&&(e=d,o=!0),null==s||!1===s?(!1!==s||""===t.getAttribute(e)||4&u&&!F(e))&&(o?t.removeAttributeNS(r,e):t.removeAttribute(e)):(!a||4&u||i)&&!l&&1===t.nodeType&&(s=!0===s?"":s,o?t.setAttributeNS(r,e,s):t.setAttribute(e,s))}}else if(e="-"===e[2]?e.slice(3):o(c,d)?d.slice(2):d[2]+e.slice(3),n||s){const l=e.endsWith(z);e=e.replace(I,""),n&&f.rel(t,e,n,l),s&&f.ael(t,e,s,l)}},T=new Set(["draggable","contenteditable","spellcheck"]),F=t=>T.has(t)||t.startsWith("aria-"),V=/\s/,q=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(V):[]),z="Capture",I=RegExp(z+"$"),Y=(t,e,n)=>{const l=11===e.O.nodeType&&e.O.host?e.O.host:e.O,o=t&&t.m||{},s=e.m||{};for(const t of Z(Object.keys(o)))t in s||W(l,t,o[t],void 0,n,e.i);for(const t of Z(Object.keys(s)))W(l,t,o[t],s[t],n,e.i)};function Z(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var B=!1,G=!1,J=[],K=[],Q=(t,e,n)=>{const l=e.v[n];let o,s,i=0;if(null!=l.h)o=l.O=c.document.createTextNode(l.h);else{if(G||(G="svg"===l.j),!c.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=c.document.createElementNS(G?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",l.j),G&&"foreignObject"===l.j&&(G=!1),Y(null,l,G),l.v){const e="template"===l.j?o.content:o;for(i=0;i<l.v.length;++i)s=Q(t,l,i),s&&e.appendChild(s)}"svg"===l.j?G=!1:"foreignObject"===o.tagName&&(G=!0)}return o["s-hn"]=k,o},X=(t,e,n,l,o,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===k&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);o<=s;++o)l[o]&&(i=Q(null,n,o),i&&(l[o].O=i,st(r,i,e)))},tt=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.O;lt(e),t&&t.remove()}}},et=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),nt=(t,e,n=!1)=>{const l=e.O=t.O,o=t.v,s=e.v,i=e.j,r=e.h;null==r?(G="svg"===i||"foreignObject"!==i&&G,"slot"!==i||B||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{f.i|=1;const e=t.closest(k.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),l=Array.from(t.__childNodes||t.childNodes);for(const t of n?l.reverse():l)null!=t["s-sh"]&&(st(e,t,null!=n?n:null),t["s-sh"]=void 0)}f.i&=-2})(e.O.parentElement)),Y(t,e,G),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],p=e[a],h=l.length-1,m=l[0],v=l[h];const b="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==m)m=l[++c];else if(null==v)v=l[--h];else if(et(d,m,o))nt(d,m,o),d=e[++r],m=l[++c];else if(et(p,v,o))nt(p,v,o),p=e[--a],v=l[--h];else if(et(d,v,o))nt(d,v,o),st(b,d.O,p.O.nextSibling),d=e[++r],v=l[--h];else if(et(p,m,o))nt(p,m,o),st(b,p.O,d.O),p=e[--a],m=l[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].$&&e[f].$===m.$){u=f;break}u>=0?(i=e[u],i.j!==m.j?s=Q(e&&e[c],n,c):(nt(i,m,o),e[u]=void 0,s=i.O),m=l[++c]):(s=Q(e&&e[c],n,c),m=l[++c]),s&&st(d.O.parentNode,s,d.O)}r>a?X(t,null==l[h+1]?null:l[h+1].O,n,l,c,h):c>h&&tt(e,r,a)})(l,o,e,s,n):null!==s?(null!==t.h&&(l.textContent=""),X(l,null,e,s,0,s.length-1)):!n&&null!==o&&tt(o,0,o.length-1),G&&"svg"===i&&(G=!1)):t.h!==r&&(l.data=r)},lt=t=>{t.m&&t.m.ref&&J.push((()=>t.m.ref(null))),t.v&&t.v.map(lt)},ot=(t,e)=>{K.push((()=>t(e)))},st=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),it=(t,e,n=!1)=>{const l=t.$hostElement$,o=t.l,s=t.k||C(null,null),i=(t=>t&&t.j===N)(e)?e:A(null,null,e);if(k=l.tagName,o.M&&(i.m=i.m||{},o.M.forEach((([t,e])=>{i.m[e]=l[t]}))),n&&i.m)for(const t of Object.keys(i.m))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=l[t]);i.j=null,i.i|=4,t.k=i,i.O=s.O=l.shadowRoot||l,B=!(!(1&o.i)||128&o.i),nt(s,i,n),J.forEach((t=>t())),J.length=0,K.forEach((t=>t())),K.length=0},rt=(t,e)=>{if(e&&!t.A&&e["s-p"]){const n=e["s-p"].push(new Promise((l=>t.A=()=>{e["s-p"].splice(n-1,1),l()})))}},ct=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);rt(t,t.C);const n=()=>ut(t,e);if(!e)return w(n);queueMicrotask((()=>{n()}))},ut=(t,e)=>{const n=t.$hostElement$,l=n;if(!l)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 o;return o=vt(l,e?"componentWillLoad":"componentWillUpdate",void 0,n),o=ft(o,(()=>vt(l,"componentWillRender",void 0,n))),ft(o,(()=>dt(t,l,e)))},ft=(t,e)=>at(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),at=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,dt=async(t,e,n)=>{var l;const o=t.$hostElement$,s=o["s-rc"];n&&(t=>{const e=t.l,n=t.$hostElement$,l=e.i,o=((t,e)=>{var n,l,o;const s=E(e),r=i.get(s);if(!c.document)return s;if(t=11===t.nodeType?t:c.document,r)if("string"==typeof r){let o,i=M.get(t=t.head||t);if(i||M.set(t,i=new Set),!i.has(s)){o=c.document.createElement("style"),o.textContent=r;const u=null!=(n=f.N)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=c.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=u&&o.setAttribute("nonce",u),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(o,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(a){const e=new(null!=(l=t.defaultView)?l:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(r),d?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=r+e.textContent:t.prepend(o)}else t.append(o);1&e.i&&t.insertBefore(o,null),4&e.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=M.get(t);if(e||M.set(t,e=new Set),!e.has(s)){const n=null!=(o=t.defaultView)?o:t.ownerDocument.defaultView;let l;if(r.constructor===n.CSSStyleSheet)l=r;else{l=new n.CSSStyleSheet;for(let t=0;t<r.cssRules.length;t++)l.insertRule(r.cssRules[t].cssText,t)}d?t.adoptedStyleSheets.push(l):t.adoptedStyleSheets=[...t.adoptedStyleSheets,l],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);pt(t,e,o,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>ht(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},pt=(t,e,n,l)=>{try{e=e.render(),t.i&=-17,t.i|=2,it(t,e,l)}catch(e){s(e,t.$hostElement$)}return null},ht=t=>{const e=t.$hostElement$,n=e,l=t.C;vt(n,"componentDidRender",void 0,e),64&t.i?vt(n,"componentDidUpdate",void 0,e):(t.i|=64,bt(e),vt(n,"componentDidLoad",void 0,e),t.L(e),l||mt()),t.A&&(t.A(),t.A=void 0),512&t.i&&g((()=>ct(t,!1))),t.i&=-517},mt=()=>{g((()=>U(c,"appload",{detail:{namespace:"phirepass-widgets"}})))},vt=(t,e,n,l)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,l)}},bt=t=>t.classList.add("hydrated"),yt=(t,e,n,o)=>{const i=l(t);if(!i)return;const r=t,c=i.o.get(e),u=i.i,f=r;if(!((n=P(n,o.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.o.set(e,n),o._){const t=o._[e];t&&t.map((t=>{try{const[[l,o]]=Object.entries(t);(128&u||1&o)&&(f?f[l](n,c,e):i.D.push((()=>{i.H[l](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||ct(i,!1)}}},$t=(e,n)=>{var o,s;const i=e.prototype;{e.watchers&&!n._&&(n._=H(e.watchers)),e.deserializers&&!n.P&&(n.P=e.deserializers),e.serializers&&!n.R&&(n.R=e.serializers);const r=Object.entries(null!=(o=n.t)?o:{});r.map((([e,[o]])=>{if(31&o||32&o){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>l(this).o.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=l(this);if(s){if(r)return void 0===(32&o?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),r.call(this,P(t,o)),void yt(this,e,t=32&o?this[e]:s.$hostElement$[e],n);yt(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var c;const u=t.get(e),f=l(this);if(this.hasOwnProperty(u),i.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==f?void 0:f.i;if(f&&t&&!(8&t)&&s!==o){const l=this,i=null==(c=n._)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=(null==l?void 0:l[i])&&(128&t||1&r)&&l[i].call(l,s,o,e)}))}return}const a=r.find((([t])=>t===u)),d=a?a[1][0]:0,p=4&d;if(512&d&&8&d&&!x(this[u])&&(t=>null==t||!1===t?null:!0===t?"":t+"")(this[u])===s)return;const h=p&&null===s&&void 0===this[u];p&&(s=null!==s&&"false"!==s);const m=Object.getOwnPropertyDescriptor(i,u);h||s===this[u]||null==s&&null==this[u]||m.get&&!m.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n._)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,l])=>{var o;const s=l[1]||e;return t.set(s,e),512&l[0]&&(null==(o=n.M)||o.push([e,s])),s}))]))}}return e},gt=async(t,e,n)=>{let l;try{if(!(32&e.i)&&(e.i|=32,e.i&=-1025,l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),l&&l.style)){let t;"string"==typeof l.style&&(t=l.style);const e=E(n);if(!i.has(e)){const l=()=>{};((t,e,n)=>{let l=i.get(t);a&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,i.set(t,l)})(e,t,!!(1&n.i)),l()}}const o=e.C,s=()=>ct(e,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()}catch(n){s(n,t),e.A&&(e.A(),e.A=void 0),!e.L||1024&e.i||e.L(t)}},wt=(t,e)=>{const o={i:e[0],p:e[1]};try{o.t=e[2],o._=H(t._),o.P=t.P,o.R=t.R,o.M=[];const s=t.prototype.connectedCallback,i=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const l={i:0,$hostElement$:t,l:e,o:new Map,U:new Map};l.W=new Promise((t=>l.L=t)),t["s-p"]=[],t["s-rc"]=[];const o=l;t.__stencil__getHostRef=()=>o,512&e.i&&n(t,l)})(this,o)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!l(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=l(t);if(!e)return;const n=e.l,o=()=>{};if(1&e.i)(null==e?void 0:e.H)||(1024&e.i?setTimeout((()=>gt(t,e,n)),1e3):(null==e?void 0:e.W)&&e.W.then((()=>{})));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){rt(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}})),gt(t,e,n)}o()}})(this),s&&s.call(this)},disconnectedCallback(){(async t=>{M.has(t)&&M.delete(t),t.shadowRoot&&M.has(t.shadowRoot)&&M.delete(t.shadowRoot)})(this),i&&i.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else S.call(this,o)}}),Object.defineProperty(t,"is",{value:o.p,configurable:!0}),$t(t,o)}catch(e){return s(e),t}},jt=t=>f.N=t,Ot=t=>Object.assign(f,t),St=new WeakMap;function kt(t,e){let n=St.get(e);n||(n={i:0,l:{i:0,p:e.tagName},$hostElement$:e},St.set(e,n)),it(n,t)}function Mt(t){return t}export{u as H,N as a,R as c,j as getAssetPath,A as h,wt as p,kt as render,O as setAssetPath,jt as setNonce,Ot as setPlatformOptions,Mt as t}
1
+ function t(t,e,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==l;){const l=Object.getOwnPropertyDescriptor(t,e);if(l&&(!n||l.get))return l;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},l=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),a=!!u&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),d=!1,p=[],h=[],m=()=>{var t;return(null==(t=r.document)?void 0:t.hidden)?setTimeout(y,16):f.raf(y)},b=(t,e)=>n=>{t.push(n),d||(d=!0,e&&4&f.i?$(y):m())},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},y=()=>{v(p),v(h),(d=p.length>0)&&m()},$=t=>Promise.resolve(void 0).then(t),g=b(h,!0),w=t=>{const e=new URL(t,f.u);return e.origin!==r.location.origin?e.href:e.pathname},j=t=>f.u=t;function O(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var S,k=new WeakMap,M=t=>"sc-"+t.p,E=t=>"object"==(t=typeof t)||"function"===t,A=(t,e,...n)=>{let l=null,o=null,i=!1,r=!1;const c=[],f=e=>{for(let n=0;n<e.length;n++)if(l=e[n],Array.isArray(l))f(l);else if(null!=l&&"boolean"!=typeof l){if(i="function"!=typeof t&&!E(l))l+="";else if("function"!=typeof t&&void 0===l.i){s("Invalid vNode child");continue}i&&r?c[c.length-1].h+=l:c.push(i?C(null,l):l),r=i}};if(f(n),e){e.key&&(o=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=C(t,null);return u.m=e,c.length>0&&(u.v=c),u.$=o,u},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,v:null,m:null,$:null}),x={},N=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const l of e){if(n)break;for(const e of t[l])if("string"==typeof e){n=!0;break}}if(!n)return t;const l={};for(const n of e)l[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return l},L=(t,e)=>null==t||E(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,_=(t,e)=>{const n=t;return{emit:t=>D(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},D=(t,e,n)=>{const l=f.ce(e,n);return t.dispatchEvent(l),l},H=(t,e,n,s,i,c)=>{if(n===s)return;let u=o(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,l=W(n);let o=W(s);{let t=l.filter((t=>t&&!o.includes(t)));e.remove(...t),e.add(...o.filter((t=>t&&!l.includes(t))))}}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&tt(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let o;{const e=l(t);if(e&&e.l&&e.l.t){const t=e.l.t[n];t&&t[1]&&(o=t[1])}}return o||(o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(o)||t.removeAttribute(o):t.setAttribute(o,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const l=E(s);if((u||l&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const l=null==s?"":s;"list"===e?u=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==s||!1===s?(!1!==s||""===t.getAttribute(e)||4&c&&!R(e))&&t.removeAttribute(e):(!u||4&c||i)&&!l&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):o(r,a)?a.slice(2):a[2]+e.slice(3),n||s){const l=e.endsWith(T);e=e.replace(F,""),n&&f.rel(t,e,n,l),s&&f.ael(t,e,s,l)}},P=new Set(["draggable","contenteditable","spellcheck"]),R=t=>P.has(t)||t.startsWith("aria-"),U=/\s/,W=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(U):[]),T="Capture",F=RegExp(T+"$"),V=(t,e,n)=>{const l=11===e.O.nodeType&&e.O.host?e.O.host:e.O,o=t&&t.m||{},s=e.m||{};for(const t of q(Object.keys(o)))t in s||H(l,t,o[t],void 0,n,e.i);for(const t of q(Object.keys(s)))H(l,t,o[t],s[t],n,e.i)};function q(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var z=!1,I=!1,Y=[],Z=[],B=(t,e,n)=>{const l=e.v[n];let o,s,i=0;if(null!=l.h)o=l.O=r.document.createTextNode(l.h);else{if(I||(I="svg"===l.j),!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=r.document.createElementNS(I?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",l.j),I&&"foreignObject"===l.j&&(I=!1),V(null,l,I),l.v){const e="template"===l.j?o.content:o;for(i=0;i<l.v.length;++i)s=B(t,l,i),s&&e.appendChild(s)}"svg"===l.j?I=!1:"foreignObject"===o.tagName&&(I=!0)}return o["s-hn"]=S,o},G=(t,e,n,l,o,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===S&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);o<=s;++o)l[o]&&(i=B(null,n,o),i&&(l[o].O=i,et(r,i,e)))},J=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.O;X(e),t&&t.remove()}}},K=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),Q=(t,e,n=!1)=>{const l=e.O=t.O,o=t.v,s=e.v,i=e.j,r=e.h;null==r?(I="svg"===i||"foreignObject"!==i&&I,"slot"!==i||z||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{f.i|=1;const e=t.closest(S.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),l=Array.from(t.__childNodes||t.childNodes);for(const t of n?l.reverse():l)null!=t["s-sh"]&&(et(e,t,null!=n?n:null),t["s-sh"]=void 0)}f.i&=-2})(e.O.parentElement)),V(t,e,I),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=e.length-1,d=e[0],p=e[a],h=l.length-1,m=l[0],b=l[h];const v="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==m)m=l[++c];else if(null==b)b=l[--h];else if(K(d,m,o))Q(d,m,o),d=e[++r],m=l[++c];else if(K(p,b,o))Q(p,b,o),p=e[--a],b=l[--h];else if(K(d,b,o))Q(d,b,o),et(v,d.O,p.O.nextSibling),d=e[++r],b=l[--h];else if(K(p,m,o))Q(p,m,o),et(v,p.O,d.O),p=e[--a],m=l[++c];else{for(f=-1,u=r;u<=a;++u)if(e[u]&&null!==e[u].$&&e[u].$===m.$){f=u;break}f>=0?(i=e[f],i.j!==m.j?s=B(e&&e[c],n,c):(Q(i,m,o),e[f]=void 0,s=i.O),m=l[++c]):(s=B(e&&e[c],n,c),m=l[++c]),s&&et(d.O.parentNode,s,d.O)}r>a?G(t,null==l[h+1]?null:l[h+1].O,n,l,c,h):c>h&&J(e,r,a)})(l,o,e,s,n):null!==s?(null!==t.h&&(l.textContent=""),G(l,null,e,s,0,s.length-1)):!n&&null!==o&&J(o,0,o.length-1),I&&"svg"===i&&(I=!1)):t.h!==r&&(l.data=r)},X=t=>{t.m&&t.m.ref&&Y.push((()=>t.m.ref(null))),t.v&&t.v.map(X)},tt=(t,e)=>{Z.push((()=>t(e)))},et=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),nt=(t,e,n=!1)=>{const l=t.$hostElement$,o=t.l,s=t.k||C(null,null),i=(t=>t&&t.j===x)(e)?e:A(null,null,e);if(S=l.tagName,n&&i.m)for(const t of Object.keys(i.m))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=l[t]);i.j=null,i.i|=4,t.k=i,i.O=s.O=l.shadowRoot||l,z=!(!(1&o.i)||128&o.i),Q(s,i,n),Y.forEach((t=>t())),Y.length=0,Z.forEach((t=>t())),Z.length=0},lt=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((l=>t.M=()=>{e["s-p"].splice(n-1,1),l()})))}},ot=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);lt(t,t.A);const n=()=>st(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},st=(t,e)=>{const n=t.$hostElement$,l=n;if(!l)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 o;return o=dt(l,e?"componentWillLoad":"componentWillUpdate",void 0,n),o=it(o,(()=>dt(l,"componentWillRender",void 0,n))),it(o,(()=>ct(t,l,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 l;const o=t.$hostElement$,s=o["s-rc"];n&&(t=>{const e=t.l,n=t.$hostElement$,l=e.i,o=((t,e)=>{var n,l,o;const s=M(e),c=i.get(s);if(!r.document)return s;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let o,i=k.get(t=t.head||t);if(i||k.set(t,i=new Set),!i.has(s)){o=r.document.createElement("style"),o.textContent=c;const d=null!=(n=f.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=d&&o.setAttribute("nonce",d),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(o,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(l=t.defaultView)?l:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(c),a?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=c+e.textContent:t.prepend(o)}else t.append(o);1&e.i&&t.insertBefore(o,null),4&e.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=k.get(t);if(e||k.set(t,e=new Set),!e.has(s)){const n=null!=(o=t.defaultView)?o:t.ownerDocument.defaultView;let l;if(c.constructor===n.CSSStyleSheet)l=c;else{l=new n.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)l.insertRule(c.cssRules[t].cssText,t)}a?t.adoptedStyleSheets.push(l):t.adoptedStyleSheets=[...t.adoptedStyleSheets,l],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);ft(t,e,o,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>ut(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},ft=(t,e,n,l)=>{try{e=e.render(),t.i&=-17,t.i|=2,nt(t,e,l)}catch(e){s(e,t.$hostElement$)}return null},ut=t=>{const e=t.$hostElement$,n=e,l=t.A;dt(n,"componentDidRender",void 0,e),64&t.i?dt(n,"componentDidUpdate",void 0,e):(t.i|=64,pt(e),dt(n,"componentDidLoad",void 0,e),t.N(e),l||at()),t.M&&(t.M(),t.M=void 0),512&t.i&&$((()=>ot(t,!1))),t.i&=-517},at=()=>{$((()=>D(r,"appload",{detail:{namespace:"phirepass-widgets"}})))},dt=(t,e,n,l)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,l)}},pt=t=>t.classList.add("hydrated"),ht=(t,e,n,o)=>{const i=l(t);if(!i)return;const r=t,c=i.o.get(e),f=i.i,u=r;if(!((n=L(n,o.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.o.set(e,n),o.L){const t=o.L[e];t&&t.map((t=>{try{const[[l,o]]=Object.entries(t);(128&f||1&o)&&(u?u[l](n,c,e):i._.push((()=>{i.D[l](n,c,e)})))}catch(t){s(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,c,e)&&!(16&f))return;16&f||ot(i,!1)}}},mt=(e,n)=>{var o,s;const i=e.prototype;{e.watchers&&!n.L&&(n.L=N(e.watchers)),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.P&&(n.P=e.serializers);const r=Object.entries(null!=(o=n.t)?o:{});r.map((([e,[o]])=>{if(31&o||32&o){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>l(this).o.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=l(this);if(s){if(r)return void 0===(32&o?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),r.call(this,L(t,o)),void ht(this,e,t=32&o?this[e]:s.$hostElement$[e],n);ht(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var c;const f=t.get(e),u=l(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==o){const l=this,i=null==(c=n.L)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=(null==l?void 0:l[i])&&(128&t||1&r)&&l[i].call(l,s,o,e)}))}return}const a=r.find((([t])=>t===f)),d=4&(a?a[1][0]:0),p=d&&null===s&&void 0===this[f];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);p||s===this[f]||null==s&&null==this[f]||h.get&&!h.set||(this[f]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.L)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},bt=async(t,e,n)=>{let l;try{if(!(32&e.i)&&(e.i|=32,e.i&=-1025,l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),l&&l.style)){let t;"string"==typeof l.style&&(t=l.style);const e=M(n);if(!i.has(e)){const l=()=>{};((t,e,n)=>{let l=i.get(t);u&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,i.set(t,l)})(e,t,!!(1&n.i)),l()}}const o=e.A,s=()=>ot(e,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),!e.N||1024&e.i||e.N(t)}},vt=(t,e)=>{const o={i:e[0],p:e[1]};try{o.t=e[2],o.L=N(t.L),o.H=t.H,o.P=t.P;const s=t.prototype.connectedCallback,i=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const l={i:0,$hostElement$:t,l:e,o:new Map,R:new Map};l.U=new Promise((t=>l.N=t)),t["s-p"]=[],t["s-rc"]=[];const o=l;t.__stencil__getHostRef=()=>o,512&e.i&&n(t,l)})(this,o)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!l(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=l(t);if(!e)return;const n=e.l,o=()=>{};if(1&e.i)(null==e?void 0:e.D)||(1024&e.i?setTimeout((()=>bt(t,e,n)),1e3):(null==e?void 0:e.U)&&e.U.then((()=>{})));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){lt(e,e.A=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),bt(t,e,n)}o()}})(this),s&&s.call(this)},disconnectedCallback(){(async t=>{k.has(t)&&k.delete(t),t.shadowRoot&&k.has(t.shadowRoot)&&k.delete(t.shadowRoot)})(this),i&&i.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,o)}}),Object.defineProperty(t,"is",{value:o.p,configurable:!0}),mt(t,o)}catch(e){return s(e),t}},yt=t=>f.C=t,$t=t=>Object.assign(f,t),gt=new WeakMap;function wt(t,e){let n=gt.get(e);n||(n={i:0,l:{i:0,p:e.tagName},$hostElement$:e},gt.set(e,n)),nt(n,t)}function jt(t){return t}export{c as H,x as a,_ as c,w as getAssetPath,A as h,vt as p,wt as render,j as setAssetPath,yt as setNonce,$t as setPlatformOptions,jt as t}
@@ -0,0 +1 @@
1
+ class t{__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,s.unregister(this),t}free(){const t=this.__destroy_into_raw();T.__wbg_channel_free(t,0)}authenticate(t,n,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(n,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_authenticate(this.__wbg_ptr,c,o,i,s,r)}connect(){T.channel_connect(this.__wbg_ptr)}create_service(t,n,e,r,c,o,i,s,_){const u=+c,a=+(y(_)?Number.MAX_SAFE_INTEGER:_>>>0);let f,b,l,d,h,w,g,p,m,R,A,N,S,O;try{f=v(t,T.__wbindgen_export,T.__wbindgen_export2),b=F,l=v(n,T.__wbindgen_export,T.__wbindgen_export2),d=F,h=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),w=F,g=v(r,T.__wbindgen_export,T.__wbindgen_export2),p=F,m=y(o)?0:v(o,T.__wbindgen_export,T.__wbindgen_export2),R=F,A=y(i)?0:v(i,T.__wbindgen_export,T.__wbindgen_export2),N=F,S=y(s)?0:v(s,T.__wbindgen_export,T.__wbindgen_export2),O=F}catch(t){throw S&&T.__wbindgen_export3(S,1*O,1),A&&T.__wbindgen_export3(A,1*N,1),m&&T.__wbindgen_export3(m,1*R,1),g&&T.__wbindgen_export3(g,1*p,1),h&&T.__wbindgen_export3(h,1*w,1),l&&T.__wbindgen_export3(l,1*d,1),f&&T.__wbindgen_export3(f,1*b,1),t}T.channel_create_service(this.__wbg_ptr,f,b,l,d,h,w,g,p,u,m,R,A,N,S,O,a)}delete_service(t,n,e){const r=+(y(e)?Number.MAX_SAFE_INTEGER:e>>>0);let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(n,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_delete_service(this.__wbg_ptr,c,o,i,s,r)}disconnect(){T.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==T.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==T.channel_is_disconnected(this.__wbg_ptr)}constructor(t,n,e){let r,c,o,i,_,u;try{r=v(t,T.__wbindgen_export,T.__wbindgen_export2),c=F,o=v(n,T.__wbindgen_export,T.__wbindgen_export2),i=F,_=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),o&&T.__wbindgen_export3(o,1*i,1),r&&T.__wbindgen_export3(r,1*c,1),t}const a=T.channel_new(r,c,o,i,_,u);return this.__wbg_ptr=a,s.register(this,this.__wbg_ptr,this),this}on_connection_close(t){T.channel_on_connection_close(this.__wbg_ptr,y(t)?0:_(t))}on_connection_error(t){T.channel_on_connection_error(this.__wbg_ptr,y(t)?0:_(t))}on_connection_message(t){T.channel_on_connection_message(this.__wbg_ptr,y(t)?0:_(t))}on_connection_open(t){T.channel_on_connection_open(this.__wbg_ptr,y(t)?0:_(t))}on_protocol_message(t){T.channel_on_protocol_message(this.__wbg_ptr,y(t)?0:_(t))}on_protocol_message_type(t,n){const e=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_on_protocol_message_type(this.__wbg_ptr,e,F,y(n)?0:_(n))}open_rdp_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_rdp_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}open_sftp_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_sftp_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}open_ssh_tunnel(t,n,e,r,c){const o=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let i,s,_,u,a,f,b,l;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(n,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F,b=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),l=F}catch(t){throw b&&T.__wbindgen_export3(b,1*l,1),a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_open_ssh_tunnel(this.__wbg_ptr,i,s,_,u,a,f,b,l,o)}send_sftp_chmod(t,n,e,r,c){const o=+n,i=+r,s=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let _,u,a,f;try{_=v(t,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F}catch(t){throw a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),t}T.channel_send_sftp_chmod(this.__wbg_ptr,_,u,o,a,f,i,s)}send_sftp_delete(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_delete(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_download_ack(t,n,e,r){const c=+n,o=+e,i=+r,s=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_download_ack(this.__wbg_ptr,s,F,c,o,i)}send_sftp_download_chunk(t,n,e,r,c){const o=+n,i=+e,s=+r,_=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0),u=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_download_chunk(this.__wbg_ptr,u,F,o,i,s,_)}send_sftp_download_start(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_download_start(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_list_data(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_list_data(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_mkdir(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_mkdir(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_read_file(t,n,e,r){const c=+n,o=+(y(r)?Number.MAX_SAFE_INTEGER:r>>>0);let i,s,_,u;try{i=v(t,T.__wbindgen_export,T.__wbindgen_export2),s=F,_=v(e,T.__wbindgen_export,T.__wbindgen_export2),u=F}catch(t){throw _&&T.__wbindgen_export3(_,1*u,1),i&&T.__wbindgen_export3(i,1*s,1),t}T.channel_send_sftp_read_file(this.__wbg_ptr,i,s,c,_,u,o)}send_sftp_remove(t,n,e,r,c){const o=+n,i=+r,s=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let _,u,a,f;try{_=v(t,T.__wbindgen_export,T.__wbindgen_export2),u=F,a=v(e,T.__wbindgen_export,T.__wbindgen_export2),f=F}catch(t){throw a&&T.__wbindgen_export3(a,1*f,1),_&&T.__wbindgen_export3(_,1*u,1),t}T.channel_send_sftp_remove(this.__wbg_ptr,_,u,o,a,f,i,s)}send_sftp_rename(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=v(r,T.__wbindgen_export,T.__wbindgen_export2),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_rename(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_sftp_upload_chunk(t,n,e,r,c,o,i){const s=+n,_=+e,u=+r,a=+c,f=+(y(i)?Number.MAX_SAFE_INTEGER:i>>>0);let b,l,d,h;try{b=v(t,T.__wbindgen_export,T.__wbindgen_export2),l=F,d=m(o,T.__wbindgen_export),h=F}catch(t){throw d&&T.__wbindgen_export3(d,1*h,1),b&&T.__wbindgen_export3(b,1*l,1),t}T.channel_send_sftp_upload_chunk(this.__wbg_ptr,b,l,s,_,u,a,d,h,f)}send_sftp_upload_start(t,n,e,r,c,o,i){const s=+n,_=+c,u=BigInt.asIntN(64,o),a=+(y(i)?Number.MAX_SAFE_INTEGER:i>>>0);let f,b,l,d,h,w;try{f=v(t,T.__wbindgen_export,T.__wbindgen_export2),b=F,l=v(e,T.__wbindgen_export,T.__wbindgen_export2),d=F,h=v(r,T.__wbindgen_export,T.__wbindgen_export2),w=F}catch(t){throw h&&T.__wbindgen_export3(h,1*w,1),l&&T.__wbindgen_export3(l,1*d,1),f&&T.__wbindgen_export3(f,1*b,1),t}T.channel_send_sftp_upload_start(this.__wbg_ptr,f,b,s,l,d,h,w,_,u,a)}send_sftp_write_file(t,n,e,r,c){const o=+n,i=+(y(c)?Number.MAX_SAFE_INTEGER:c>>>0);let s,_,u,a,f,b;try{s=v(t,T.__wbindgen_export,T.__wbindgen_export2),_=F,u=v(e,T.__wbindgen_export,T.__wbindgen_export2),a=F,f=m(r,T.__wbindgen_export),b=F}catch(t){throw f&&T.__wbindgen_export3(f,1*b,1),u&&T.__wbindgen_export3(u,1*a,1),s&&T.__wbindgen_export3(s,1*_,1),t}T.channel_send_sftp_write_file(this.__wbg_ptr,s,_,o,u,a,f,b,i)}send_ssh_terminal_resize(t,n,e,r,c,o){const i=+n,s=+e,_=+r,u=+c,a=+o,f=v(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_ssh_terminal_resize(this.__wbg_ptr,f,F,i,s,_,u,a)}send_ssh_tunnel_data(t,n,e){const r=+n;let c,o,i,s;try{c=v(t,T.__wbindgen_export,T.__wbindgen_export2),o=F,i=v(e,T.__wbindgen_export,T.__wbindgen_export2),s=F}catch(t){throw i&&T.__wbindgen_export3(i,1*s,1),c&&T.__wbindgen_export3(c,1*o,1),t}T.channel_send_ssh_tunnel_data(this.__wbg_ptr,c,o,r,i,s)}start_heartbeat(t){T.channel_start_heartbeat(this.__wbg_ptr,t)}stop_heartbeat(){T.channel_stop_heartbeat(this.__wbg_ptr)}update_service(t,n,e,r,c,o,i,s,_,u){const a=+o,f=+(y(u)?Number.MAX_SAFE_INTEGER:u>>>0);let b,l,d,h,w,g,p,m,R,A,N,S,O,P,U,j;try{b=v(t,T.__wbindgen_export,T.__wbindgen_export2),l=F,d=v(n,T.__wbindgen_export,T.__wbindgen_export2),h=F,w=v(e,T.__wbindgen_export,T.__wbindgen_export2),g=F,p=y(r)?0:v(r,T.__wbindgen_export,T.__wbindgen_export2),m=F,R=v(c,T.__wbindgen_export,T.__wbindgen_export2),A=F,N=y(i)?0:v(i,T.__wbindgen_export,T.__wbindgen_export2),S=F,O=y(s)?0:v(s,T.__wbindgen_export,T.__wbindgen_export2),P=F,U=y(_)?0:v(_,T.__wbindgen_export,T.__wbindgen_export2),j=F}catch(t){throw U&&T.__wbindgen_export3(U,1*j,1),O&&T.__wbindgen_export3(O,1*P,1),N&&T.__wbindgen_export3(N,1*S,1),R&&T.__wbindgen_export3(R,1*A,1),p&&T.__wbindgen_export3(p,1*m,1),w&&T.__wbindgen_export3(w,1*g,1),d&&T.__wbindgen_export3(d,1*h,1),b&&T.__wbindgen_export3(b,1*l,1),t}T.channel_update_service(this.__wbg_ptr,b,l,d,h,w,g,p,m,R,A,a,N,S,O,P,U,j,f)}}Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);const n=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(t,n){T.__wasm_bindgen_func_elem_67(t,n)}function r(t,n,e){T.__wasm_bindgen_func_elem_63(t,n,e)}function c(t,n,e){T.__wasm_bindgen_func_elem_63_37(t,n,e)}function o(t,n,e){T.__wasm_bindgen_func_elem_63_38(t,n,e)}const i=["blob","arraybuffer"],s="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>T.__wbg_channel_free(t,1)));function _(t){const n=T.__wbindgen_export5();return T.__wbindgen_externrefs.set(n,t),n}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>T.__wbindgen_export6(t.a,t.b)));function a(t){switch(typeof t){case"number":case"boolean":case"undefined":return`${t}`;case"string":return JSON.stringify(t);case"bigint":return`${t}n`;case"symbol":return void 0!==t.description?`Symbol(${t.description})`:"Symbol";case"function":return"string"==typeof t.name&&""!==t.name?`Function(${t.name})`:"Function";case"object":{if(null===t)return"null";if(Array.isArray(t))return"["+Array.from(t,a).join(", ")+"]";if(t instanceof Error)return`${t.name}: ${t.message}\n${t.stack}`;const n=toString.call(t),e=/\[object ([^\]]+)\]/.exec(n)?.[1];if(void 0===e)return n;if("Object"===e)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return e}}}function f(t,n){return t>>>=0,w().subarray(t/1,t/1+n)}let b=null;function l(){return(null===b||!0===b.buffer.detached||void 0===b.buffer.detached&&b.buffer!==T.memory.buffer)&&(b=new DataView(T.memory.buffer)),b}function d(t,n){return t>>>=0,e=w().subarray(t,t+n),N+=e.length,N>=A&&(R=new TextDecoder("utf-8",{ignoreBOM:!0}),R.decode(),N=e.length),R.decode(e);var e}let h=null;function w(){return null!==h&&0!==h.byteLength||(h=new Uint8Array(T.memory.buffer)),h}function g(t,n){try{return t.apply(this,n)}catch(t){const n=_(t);T.__wbindgen_export4(n)}}function y(t){return null==t}function p(t,n,e){const r={a:t,b:n,cnt:1},c=(...t)=>{r.cnt++;const n=r.a;r.a=0;try{return e(n,r.b,...t)}finally{r.a=n,c._wbg_cb_unref()}};return c._wbg_cb_unref=()=>{0==--r.cnt&&(T.__wbindgen_export6(r.a,r.b),r.a=0,u.unregister(r))},u.register(c,r,r),c}function m(t,n){const e=n(1*t.length,1)>>>0;return w().set(t,e/1),F=t.length,e}function v(t,n,e){if(void 0===e){const e=S.encode(t),r=n(e.length,1)>>>0;return w().subarray(r,r+e.length).set(e),F=e.length,r}let r=t.length,c=n(r,1)>>>0;const o=w();let i=0;for(;i<r;i++){const n=t.charCodeAt(i);if(n>127)break;o[c+i]=n}if(i!==r){0!==i&&(t=t.slice(i)),c=e(c,r,r=i+3*t.length,1)>>>0;const n=w().subarray(c+i,c+r);i+=S.encodeInto(t,n).written,c=e(c,r,i,1)>>>0}return F=i,c}let R=new TextDecoder("utf-8",{ignoreBOM:!0});R.decode();const A=2146435072;let N=0;const S=new TextEncoder;"encodeInto"in S||(S.encodeInto=function(t,n){const e=S.encode(t);return n.set(e),{read:t.length,written:e.length}});let T,O,F=0;async function P(t){return void 0!==T?T:(void 0===O&&(O=async function(t){void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===t&&(t=new URL("phirepass-channel_bg.wasm",import.meta.url));const n=function(){const t={__proto__:null,__wbg_Error_208446807d0d1e30:function(t,n){return Error(d(t,n))},__wbg_String_8564e559799eccda:function(t,n){const e=v(String(n),T.__wbindgen_export,T.__wbindgen_export2),r=F;l().setInt32(4+(t>>>0),r,!0),l().setInt32(0+(t>>>0),e,!0)},__wbg___wbindgen_debug_string_f249a2a76caa9a55:function(t,n){const e=v(a(n),T.__wbindgen_export,T.__wbindgen_export2),r=F;l().setInt32(4+(t>>>0),r,!0),l().setInt32(0+(t>>>0),e,!0)},__wbg___wbindgen_string_get_7ce8eee7fd327545:function(t,n){const e="string"==typeof n?n:void 0;var r=y(e)?0:v(e,T.__wbindgen_export,T.__wbindgen_export2),c=F;l().setInt32(4+(t>>>0),c,!0),l().setInt32(0+(t>>>0),r,!0)},__wbg___wbindgen_throw_4c88d8bf264fd984:function(t,n){throw new Error(d(t,n))},__wbg__wbg_cb_unref_09736879a3f67559:function(t){t._wbg_cb_unref()},__wbg_call_40b008ba32f73991:function(){return g((function(t,n){return t.call(n)}),arguments)},__wbg_call_a410eb4b59ed5965:function(){return g((function(t,n,e){return t.call(n,e)}),arguments)},__wbg_call_fc92fee6137d452d:function(){return g((function(t,n,e,r){return t.call(n,e,r)}),arguments)},__wbg_clearInterval_26ba580547547579:function(t){return clearInterval(t)},__wbg_close_5ee9c5fe4e8754a4:function(){return g((function(t){t.close()}),arguments)},__wbg_data_c7e5e8500f1bca2f:function(t){return t.data},__wbg_from_eac91875c8a5ffa4:function(t){return Array.from(t)},__wbg_getRandomValues_5d8c030b527203a6:function(){return g((function(t,n){globalThis.crypto.getRandomValues(f(t,n))}),arguments)},__wbg_get_2080c49015e35254:function(){return g((function(t,n){return Reflect.get(t,n)}),arguments)},__wbg_info_2b8ee6588e4c6072:function(t,n){console.info(d(t,n))},__wbg_instanceof_ArrayBuffer_12cdaa4161423e6b:function(t){let n;try{n=t instanceof ArrayBuffer}catch(t){n=!1}return n},__wbg_length_186163212ffe79c3:function(t){return t.length},__wbg_new_13de428334042d26:function(t){return new Uint8Array(t)},__wbg_new_37eb45aaf5eeb820:function(){return new Array},__wbg_new_cd4348290afae586:function(){return new Object},__wbg_new_with_str_sequence_75b26d88172889d0:function(){return g((function(t,n,e){return new WebSocket(d(t,n),e)}),arguments)},__wbg_prototypesetcall_13162965d1fe7aa3:function(t,n,e){Uint8Array.prototype.set.call(f(t,n),e)},__wbg_push_c9f4893fc209f768:function(t,n){return t.push(n)},__wbg_readyState_039bc047141a5f6d:function(t){return t.readyState},__wbg_send_d83d0891cf698779:function(){return g((function(t,n,e){t.send(f(n,e))}),arguments)},__wbg_setInterval_d933acbf2578adfa:function(){return g((function(t,n){return setInterval(t,n)}),arguments)},__wbg_set_binaryType_d5b4dafd0f127fb2:function(t,n){t.binaryType=i[n]},__wbg_set_d2d33b52458e984a:function(t,n,e){t[n>>>0]=e},__wbg_set_e4b9a833d288759a:function(t,n,e){t[n]=e},__wbg_set_onclose_078935cf8d0fb024:function(t,n){t.onclose=n},__wbg_set_onerror_f7f089f7f059501c:function(t,n){t.onerror=n},__wbg_set_onmessage_26abc49cfa5f9ffc:function(t,n){t.onmessage=n},__wbg_set_onopen_757be120cc7b1ea6:function(t,n){t.onopen=n},__wbg_warn_b0df9a9e7105e74b:function(t,n){console.warn(d(t,n))},__wbindgen_generic_0000000000000001:function(t,n){return p(t,n,r)},__wbindgen_generic_0000000000000002:function(t,n){return p(t,n,c)},__wbindgen_generic_0000000000000003:function(t,n){return p(t,n,o)},__wbindgen_generic_0000000000000004:function(t,n){return p(t,n,e)},__wbindgen_generic_0000000000000005:function(t){return t},__wbindgen_generic_0000000000000006:function(t,n){return f(t,n)},__wbindgen_generic_0000000000000007:function(t,n){return d(t,n)},__wbindgen_generic_0000000000000008:function(t){return BigInt.asUintN(64,t)},__wbindgen_init_externref_table:function(){const t=T.__wbindgen_externrefs;t.set(0,void 0),t.set(1024,void 0),t.set(1025,null),t.set(1026,!0),t.set(1027,!1)}};return{__proto__:null,"./phirepass-channel_bg.js":t}}();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s}=await async function(t,n){if("function"==typeof Response&&t instanceof Response){if(!t.ok)throw new Error(`failed to fetch Wasm: ${t.status} ${t.statusText} fetching '${t.url}'`);if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,n)}catch(n){if(!function(t){switch(t){case"basic":case"cors":case"default":return!0}return!1}(t.type)||"application/wasm"===t.headers.get("Content-Type"))throw n;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",n)}const e=await t.arrayBuffer();return await WebAssembly.instantiate(e,n)}{const e=await WebAssembly.instantiate(t,n);return e instanceof WebAssembly.Instance?{instance:e,module:t}:e}}(await t,n);return function(t){return T=t.exports,b=null,h=null,T.__wbindgen_start(),T}(s)}(t),O.catch((()=>{O=void 0}))),O)}var U,j,k;!function(t){t.Error="Error",t.AuthSuccess="AuthSuccess",t.TunnelOpened="TunnelOpened",t.TunnelClosed="TunnelClosed",t.TunnelData="TunnelData",t.RDPAuthorized="RDPAuthorized",t.SFTPListItems="SFTPListItems",t.SFTPDownloadStartResponse="SFTPDownloadStartResponse",t.SFTPDownloadChunk="SFTPDownloadChunk",t.SFTPUploadStartResponse="SFTPUploadStartResponse",t.SFTPUploadChunkAck="SFTPUploadChunkAck",t.SFTPOpResult="SFTPOpResult"}(U||(U={})),function(t){t[t.Username=0]="Username",t[t.Password=1]="Password",t[t.Default=2]="Default"}(j||(j={})),function(t){t.Disconnected="disconnected",t.Connected="connected",t.Error="error"}(k||(k={}));export{t as C,n as E,j as I,U as P,P as _,k as a}
@@ -1 +1 @@
1
- import{t,p as e,H as s,c as i,h as o,a as n}from"./index.js";import{_ as r,C as h,a,P as c}from"./p-BekUePpu.js";const d=200;function u(t){return!Number.isFinite(t)||t<=0?d:Math.min(8192,Math.max(d,Math.floor(t)))}function l(t){return t-t%2}function p(t){const e=t.getBoundingClientRect();return function(t,e){return{width:l(u(t)),height:l(u(e))}}(e.width,e.height)}class m{onResize;debounceMs;observer;handle;reported;constructor(t,e=250){this.onResize=t,this.debounceMs=e}observe(t,e){this.disconnect(),this.reported=e,this.report(p(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(p(t))),this.debounceMs)})),this.observer.observe(t))}disconnect(){clearTimeout(this.handle),this.handle=void 0,this.observer?.disconnect(),this.observer=void 0,this.reported=void 0}report(t){(function(t,e){return!!t&&!!e&&t.width===e.width&&t.height===e.height})(t,this.reported)||(this.reported=t,this.onResize(t))}}function f(){return navigator.keyboard}function b(){return"function"==typeof f()?.lock}function y(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function g(){if(b())try{f().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const v=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;containerEl;ironEl;userInteraction;viewport;domReady=!1;runtimeReady=!1;connected=!1;disposed=!1;session_id;onFullscreenChange=()=>this.sync_keyboard_lock();credentials;credentialsPrompt=!1;statusMessage;usernameBuffer="";passwordBuffer="";get el(){return this}serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;username;password;destination;scale="fit";dynamicResize=!0;captureKeyboard=!0;clipboard=!0;onNodeIdChange(t,e){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),t&&(this.open_comms(),this.channel.connect())}serverId;channelFactory;onServerIdChange(t,e){this.onNodeIdChange(this.nodeId,this.nodeId)}connectionStateChanged;create_web_socket_endpoint(){const t=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${t}://${this.serverHost}`:`${t}://${this.serverHost}:${this.serverPort}`:`${t}://${this.serverHost}`}async connectedCallback(){document.addEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!1,this.channelFactory||await r(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to RDP.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!0,this.session_id=void 0,this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}async toggleFullscreen(){const t=await async function(t){try{return y(t)?(await document.exitFullscreen(),!1):(await t.requestFullscreen({navigationUI:"hide"}),!0)}catch(e){return console.warn("Failed to change the fullscreen state of the RDP session:",e),y(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return b()}async focusDesktop(){this.focus_desktop()}async sendCtrlAltDel(){return!!this.userInteraction&&(this.userInteraction.ctrlAltDel(),this.focus_desktop(),!0)}async sendMetaKey(){return!!this.userInteraction&&(this.userInteraction.metaKey(),this.focus_desktop(),!0)}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.containerEl&&this.channel&&this.connect()}connect(){this.connected=!0,this.channel.connect()}open_comms(){this.channel=this.channelFactory?this.channelFactory(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId||void 0):this.serverId?new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId):new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([a.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([a.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([a.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case c.Error:this.handle_error(e);break;case c.AuthSuccess:this.handle_auth_success(e);break;case c.RDPAuthorized:this.handle_rdp_authorized(e);break;case c.TunnelClosed:this.handle_tunnel_closed(e);break;default:console.warn("Unknown protocol message type:",e)}}))}close_comms(){this.teardown_client(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}reset_session_state(){this.session_id=void 0,this.credentials=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer="",this.statusMessage=void 0}handle_auth_success(t){if(this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.username&&this.password)return this.credentials={username:this.username,password:this.password},void this.request_tunnel();this.credentialsPrompt=!0}request_tunnel(){this.credentials&&(this.statusMessage=void 0,this.channel.open_rdp_tunnel(this.nodeId,this.serviceId,this.credentials.username,this.credentials.password))}async handle_rdp_authorized(t){this.session_id=t.sid,this.statusMessage="Connecting…";const[e]=await Promise.all([import("@devolutions/iron-remote-desktop-rdp"),import("@devolutions/iron-remote-desktop")]);if(this.disposed||!this.containerEl||this.session_id!==t.sid)return;if(await e.init("info"),this.disposed||!this.containerEl||this.session_id!==t.sid)return;const s=document.createElement("iron-remote-desktop");s.module=e.Backend,s.scale=this.scale,s.flexcenter=!0,s.verbose=!1;const i=[e.enableCredssp(!0)];this.dynamicResize&&i.push(e.displayControl(!0)),s.addEventListener("ready",(e=>{this.start_session(e.detail.irgUserInteraction,t.ticket,i)})),this.ironEl=s,this.mount_client(s)}mount_client(t){this.el.appendChild(t)}async start_session(t,e,s){this.userInteraction=t,this.clipboard||t.setEnableClipboard(!1),t.onWarningCallback((t=>{console.warn("The remote desktop client reported a problem:",t)}));const i=t.configBuilder().withUsername(this.credentials?.username??"").withPassword(this.credentials?.password??"").withDestination(this.destination??this.nodeId).withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`).withAuthToken(e);for(const t of s)i.withExtension(t);let o;this.dynamicResize&&(o=function(t){const e=t.getBoundingClientRect();if(Number.isFinite(e.width)&&Number.isFinite(e.height)&&!(e.width<d||e.height<d))return{width:l(Math.min(Math.floor(e.width),4096)),height:l(Math.min(Math.floor(e.height),4096))}}(this.el),o&&i.withDesktopSize(o));try{const e=await t.connect(i.build());if(this.disposed)return this.shutdown_session(t),void await e.run();t.setVisibility(!0),this.statusMessage=void 0,this.focus_desktop(),this.sync_keyboard_lock();const s=e.run();this.start_viewport_sync(o);const n=await s;this.statusMessage=n.reason()}catch(t){const e=this.describe_error(t);this.statusMessage=e,this.connectionStateChanged.emit([a.Error,t])}}start_viewport_sync(t){this.dynamicResize&&(this.viewport=new m((t=>this.resize_desktop(t))),this.viewport.observe(this.el,t))}stop_viewport_sync(){this.viewport?.disconnect(),this.viewport=void 0}resize_desktop(t){try{this.userInteraction?.resize(t.width,t.height)}catch(t){console.warn("The remote host would not resize its desktop:",t)}}focus_desktop(){!function(t){t?.focus({preventScroll:!0})}(this.ironEl)}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(b()&&w(t))try{await f().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):g()}describe_error(t){return t&&"function"==typeof t.backtrace?t.backtrace():t instanceof Error?t.message:"Connection failed."}handle_tunnel_closed(t){this.session_id=void 0,this.statusMessage=this.statusMessage??"Connection closed.",this.teardown_client(),this.close_comms()}handle_error(t){this.statusMessage=t.message,this.connectionStateChanged.emit([a.Error,t])}shutdown_session(t){try{t.shutdown()}catch(t){console.warn("Failed to shut the RDP session down cleanly:",t)}}teardown_client(){this.stop_viewport_sync(),g(),this.userInteraction&&(this.shutdown_session(this.userInteraction),this.userInteraction=void 0),this.ironEl?.remove(),this.ironEl=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer=""}submit_credentials(t){t.preventDefault(),this.credentialsPrompt=!1,this.credentials={username:this.usernameBuffer,password:this.passwordBuffer},this.usernameBuffer="",this.passwordBuffer="",this.request_tunnel()}render(){return o(n,{key:"9db127da5dbe168ef5f7a021767e5cedeb8305e6"},o("div",{key:"06d2de6763ec479198389032ab65033eefab21d6",class:"screen",ref:t=>this.containerEl=t},o("slot",{key:"7842ca9fd64795794e1b90e15319ddaa599f85b8"})),this.credentialsPrompt&&o("form",{key:"ce53830ced182740f139a318f099918c31013d9f",class:"prompt",onSubmit:t=>this.submit_credentials(t)},o("label",{key:"2b55341b9cfc2e08a847e26985000f5e1bc86eca",htmlFor:"rdp-username"},"Username"),o("input",{key:"243500ff59de6f16cc67acc5ddf9e15e3c0de0f6",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),o("label",{key:"5a346aa6a730c4cb0dd550eab9a65db9f2e74bc6",htmlFor:"rdp-password"},"Password"),o("input",{key:"0f1081b05f94e15a7f04df4de390a33a021ffe53",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),o("button",{key:"e9657c9df124176210508f5125fc526e3c78c5f1",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&o("div",{key:"3c59dbae63b7c5c5ef80344abad4b1a2b4c0b79d",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}static get style(){return':host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021;container-type:inline-size}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}@container (max-width: 640px){.prompt{padding:1rem;gap:0.4rem}.prompt input{min-width:0;width:100%;max-width:22rem;font-size:16px;padding:0.625rem 0.75rem}.prompt button{width:100%;max-width:22rem;padding:0.75rem 1.25rem}.status{font-size:0.75rem;padding:0.5rem;padding-bottom:calc(0.5rem + env(safe-area-inset-bottom))}}'}},[769,"phirepass-rdp",{serverHost:[1,"server-host"],serverPort:[2,"server-port"],allowInsecure:[4,"allow-insecure"],heartbeatInterval:[2,"heartbeat-interval"],nodeId:[1,"node-id"],serviceId:[1,"service-id"],token:[1],username:[1],password:[1],destination:[1],scale:[1],dynamicResize:[4,"dynamic-resize"],captureKeyboard:[4,"capture-keyboard"],clipboard:[4],serverId:[1,"server-id"],channelFactory:[16],credentialsPrompt:[32],statusMessage:[32],toggleFullscreen:[64],keyboardLockSupported:[64],focusDesktop:[64],sendCtrlAltDel:[64],sendMetaKey:[64]},void 0,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]);function k(){"undefined"!=typeof customElements&&["phirepass-rdp"].forEach((e=>{"phirepass-rdp"===e&&(customElements.get(t(e))||customElements.define(t(e),v))}))}k();const _=v,I=k;export{_ as PhirepassRdp,I as defineCustomElement}
1
+ import{t,p as e,H as s,c as i,h as o,a as n}from"./index.js";import{_ as r,C as h,a,P as c}from"./p-CsYQJXY2.js";const d=200;function u(t){return!Number.isFinite(t)||t<=0?d:Math.min(8192,Math.max(d,Math.floor(t)))}function l(t){return t-t%2}function p(t){const e=t.getBoundingClientRect();return function(t,e){return{width:l(u(t)),height:l(u(e))}}(e.width,e.height)}class m{onResize;debounceMs;observer;handle;reported;constructor(t,e=250){this.onResize=t,this.debounceMs=e}observe(t,e){this.disconnect(),this.reported=e,this.report(p(t)),"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>{clearTimeout(this.handle),this.handle=setTimeout((()=>this.report(p(t))),this.debounceMs)})),this.observer.observe(t))}disconnect(){clearTimeout(this.handle),this.handle=void 0,this.observer?.disconnect(),this.observer=void 0,this.reported=void 0}report(t){(function(t,e){return!!t&&!!e&&t.width===e.width&&t.height===e.height})(t,this.reported)||(this.reported=t,this.onResize(t))}}function f(){return navigator.keyboard}function b(){return"function"==typeof f()?.lock}function y(t){return document.fullscreenElement===t}function w(t){return document.fullscreenElement?.contains(t)??!1}function g(){if(b())try{f().unlock()}catch(t){console.warn("Failed to release the keyboard lock:",t)}}const v=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;containerEl;ironEl;userInteraction;viewport;domReady=!1;runtimeReady=!1;connected=!1;disposed=!1;session_id;onFullscreenChange=()=>this.sync_keyboard_lock();credentials;credentialsPrompt=!1;statusMessage;usernameBuffer="";passwordBuffer="";get el(){return this}serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;serviceId;token;username;password;destination;scale="fit";dynamicResize=!0;captureKeyboard=!0;clipboard=!0;onNodeIdChange(t,e){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),t&&(this.open_comms(),this.channel.connect())}serverId;onServerIdChange(t,e){this.onNodeIdChange(this.nodeId,this.nodeId)}connectionStateChanged;create_web_socket_endpoint(){const t=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${t}://${this.serverHost}`:`${t}://${this.serverHost}:${this.serverPort}`:`${t}://${this.serverHost}`}async connectedCallback(){document.addEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!1,await r(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to RDP.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.disposed=!0,this.session_id=void 0,this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}async toggleFullscreen(){const t=await async function(t){try{return y(t)?(await document.exitFullscreen(),!1):(await t.requestFullscreen({navigationUI:"hide"}),!0)}catch(e){return console.warn("Failed to change the fullscreen state of the RDP session:",e),y(t)}}(this.el);return this.focus_desktop(),t}async keyboardLockSupported(){return b()}async focusDesktop(){this.focus_desktop()}async sendCtrlAltDel(){return!!this.userInteraction&&(this.userInteraction.ctrlAltDel(),this.focus_desktop(),!0)}async sendMetaKey(){return!!this.userInteraction&&(this.userInteraction.metaKey(),this.focus_desktop(),!0)}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.containerEl&&this.channel&&this.connect()}connect(){this.connected=!0,this.channel.connect()}open_comms(){this.channel=this.serverId?new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId):new h(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([a.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([a.Disconnected]),this.teardown_client()})),this.channel.on_connection_error((t=>{this.connectionStateChanged.emit([a.Error,t])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((t=>{const{web:e}=t.data;switch(e.type){case c.Error:this.handle_error(e);break;case c.AuthSuccess:this.handle_auth_success(e);break;case c.RDPAuthorized:this.handle_rdp_authorized(e);break;case c.TunnelClosed:this.handle_tunnel_closed(e);break;default:console.warn("Unknown protocol message type:",e)}}))}close_comms(){this.teardown_client(),this.channel&&(this.channel.stop_heartbeat(),this.channel.disconnect())}reset_session_state(){this.session_id=void 0,this.credentials=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer="",this.statusMessage=void 0}handle_auth_success(t){if(this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.username&&this.password)return this.credentials={username:this.username,password:this.password},void this.request_tunnel();this.credentialsPrompt=!0}request_tunnel(){this.credentials&&(this.statusMessage=void 0,this.channel.open_rdp_tunnel(this.nodeId,this.serviceId,this.credentials.username,this.credentials.password))}async handle_rdp_authorized(t){this.session_id=t.sid,this.statusMessage="Connecting…";const[e]=await Promise.all([import("@devolutions/iron-remote-desktop-rdp"),import("@devolutions/iron-remote-desktop")]);if(this.disposed||!this.containerEl||this.session_id!==t.sid)return;if(await e.init("info"),this.disposed||!this.containerEl||this.session_id!==t.sid)return;const s=document.createElement("iron-remote-desktop");s.module=e.Backend,s.scale=this.scale,s.flexcenter=!0,s.verbose=!1;const i=[e.enableCredssp(!0)];this.dynamicResize&&i.push(e.displayControl(!0)),s.addEventListener("ready",(e=>{this.start_session(e.detail.irgUserInteraction,t.ticket,i)})),this.ironEl=s,this.mount_client(s)}mount_client(t){this.el.appendChild(t)}async start_session(t,e,s){this.userInteraction=t,this.clipboard||t.setEnableClipboard(!1),t.onWarningCallback((t=>{console.warn("The remote desktop client reported a problem:",t)}));const i=t.configBuilder().withUsername(this.credentials?.username??"").withPassword(this.credentials?.password??"").withDestination(this.destination??this.nodeId).withProxyAddress(`${this.create_web_socket_endpoint()}/api/web/rdp/${this.nodeId}`).withAuthToken(e);for(const t of s)i.withExtension(t);let o;this.dynamicResize&&(o=function(t){const e=t.getBoundingClientRect();if(Number.isFinite(e.width)&&Number.isFinite(e.height)&&!(e.width<d||e.height<d))return{width:l(Math.min(Math.floor(e.width),4096)),height:l(Math.min(Math.floor(e.height),4096))}}(this.el),o&&i.withDesktopSize(o));try{const e=await t.connect(i.build());if(this.disposed)return this.shutdown_session(t),void await e.run();t.setVisibility(!0),this.statusMessage=void 0,this.focus_desktop(),this.sync_keyboard_lock();const s=e.run();this.start_viewport_sync(o);const n=await s;this.statusMessage=n.reason()}catch(t){const e=this.describe_error(t);this.statusMessage=e,this.connectionStateChanged.emit([a.Error,t])}}start_viewport_sync(t){this.dynamicResize&&(this.viewport=new m((t=>this.resize_desktop(t))),this.viewport.observe(this.el,t))}stop_viewport_sync(){this.viewport?.disconnect(),this.viewport=void 0}resize_desktop(t){try{this.userInteraction?.resize(t.width,t.height)}catch(t){console.warn("The remote host would not resize its desktop:",t)}}focus_desktop(){!function(t){t?.focus({preventScroll:!0})}(this.ironEl)}async sync_keyboard_lock(){this.captureKeyboard&&w(this.el)?(await async function(t){if(b()&&w(t))try{await f().lock()}catch(t){console.warn("Failed to lock the keyboard for the RDP session:",t)}}(this.el),this.focus_desktop()):g()}describe_error(t){return t&&"function"==typeof t.backtrace?t.backtrace():t instanceof Error?t.message:"Connection failed."}handle_tunnel_closed(t){this.session_id=void 0,this.statusMessage=this.statusMessage??"Connection closed.",this.teardown_client(),this.close_comms()}handle_error(t){this.statusMessage=t.message,this.connectionStateChanged.emit([a.Error,t])}shutdown_session(t){try{t.shutdown()}catch(t){console.warn("Failed to shut the RDP session down cleanly:",t)}}teardown_client(){this.stop_viewport_sync(),g(),this.userInteraction&&(this.shutdown_session(this.userInteraction),this.userInteraction=void 0),this.ironEl?.remove(),this.ironEl=void 0,this.credentialsPrompt=!1,this.usernameBuffer="",this.passwordBuffer=""}submit_credentials(t){t.preventDefault(),this.credentialsPrompt=!1,this.credentials={username:this.usernameBuffer,password:this.passwordBuffer},this.usernameBuffer="",this.passwordBuffer="",this.request_tunnel()}render(){return o(n,{key:"56354df7bd0d3f01fcd5ff65ca5618ceb6af1b91"},o("div",{key:"446dc83e41a29c3bc2c341a26092ed3581565967",class:"screen",ref:t=>this.containerEl=t},o("slot",{key:"2beafc92d81662dfac5c7b41356f6c6c802643b9"})),this.credentialsPrompt&&o("form",{key:"dcc29b21fba03bb97526ec3d1cf5a1fb51b483e9",class:"prompt",onSubmit:t=>this.submit_credentials(t)},o("label",{key:"b5a3e302089b2282aedbdbefd4fb5eaca7c34455",htmlFor:"rdp-username"},"Username"),o("input",{key:"3bd1c902a6bc41bc7e69c16258cac78035a949bd",id:"rdp-username",type:"text",autocomplete:"off",autofocus:!0,onInput:t=>this.usernameBuffer=t.target.value}),o("label",{key:"2defe12d73b609cbad27c06447c3c3221ff3e5aa",htmlFor:"rdp-password"},"Password"),o("input",{key:"55935891f24f0c1db71a14c42b2fc7a96c0c0ba6",id:"rdp-password",type:"password",autocomplete:"off",onInput:t=>this.passwordBuffer=t.target.value}),o("button",{key:"83439c0e8756001c7042fc3b6754889d62a8eada",type:"submit"},"Connect")),this.statusMessage&&!this.credentialsPrompt&&o("div",{key:"294262625f44a3f45d54bcd492875a9b6fd03219",class:"status"},this.statusMessage))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}static get style(){return':host{display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;position:relative;background:#0b1021;container-type:inline-size}.screen{width:100%;height:100%;display:flex}::slotted(iron-remote-desktop){display:block;flex:1 1 auto;min-width:0;min-height:0;width:100%;height:100%}:host(:fullscreen){width:100vw;height:100vh;background:#000}.prompt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.875rem}.prompt input{padding:0.5rem 0.75rem;border:1px solid #334155;border-radius:0.375rem;background:#0f172a;color:inherit;font:inherit;min-width:16rem}.prompt input:focus{outline:2px solid #67e8f9;outline-offset:1px}.prompt button{margin-top:0.5rem;padding:0.5rem 1.25rem;border:0;border-radius:0.375rem;background:#67e8f9;color:#0b1021;font:inherit;font-weight:600;cursor:pointer}.status{position:absolute;inset-inline:0;bottom:0;padding:0.5rem 0.75rem;background:rgba(11, 16, 33, 0.92);color:#e2e8f0;font-family:"Berkeley Mono", "Fira Code", "SFMono-Regular", Menlo, monospace;font-size:0.8125rem;text-align:center}@container (max-width: 640px){.prompt{padding:1rem;gap:0.4rem}.prompt input{min-width:0;width:100%;max-width:22rem;font-size:16px;padding:0.625rem 0.75rem}.prompt button{width:100%;max-width:22rem;padding:0.75rem 1.25rem}.status{font-size:0.75rem;padding:0.5rem;padding-bottom:calc(0.5rem + env(safe-area-inset-bottom))}}'}},[769,"phirepass-rdp",{serverHost:[1,"server-host"],serverPort:[2,"server-port"],allowInsecure:[4,"allow-insecure"],heartbeatInterval:[2,"heartbeat-interval"],nodeId:[1,"node-id"],serviceId:[1,"service-id"],token:[1],username:[1],password:[1],destination:[1],scale:[1],dynamicResize:[4,"dynamic-resize"],captureKeyboard:[4,"capture-keyboard"],clipboard:[4],serverId:[1,"server-id"],credentialsPrompt:[32],statusMessage:[32],toggleFullscreen:[64],keyboardLockSupported:[64],focusDesktop:[64],sendCtrlAltDel:[64],sendMetaKey:[64]},void 0,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]);function k(){"undefined"!=typeof customElements&&["phirepass-rdp"].forEach((e=>{"phirepass-rdp"===e&&(customElements.get(t(e))||customElements.define(t(e),v))}))}k();const _=v,I=k;export{_ as PhirepassRdp,I as defineCustomElement}