"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[906],{7906:function(e,n,t){t.d(n,{S:function(){return G},M:function(){return Y}});var r=t(4051),o=t.n(r),s=t(5893),c=t(5537),a=t(791),i=t(1496),l=t(7357),u=t(4799),d=t(8333),f=t(9309),h=t(5861),v=t(7294),x=t(5152),p=t(2029),m=t(7169),y=t(4825),w=t(7750),b="0xffe3",g="0xffe9",j=[{keys:"Ctrl + Alt + Delete",scans:[]},{keys:"Ctrl + Alt + F1",scans:[b,g,"0xffbe"]},{keys:"Ctrl + Alt + F2",scans:[b,g,"0xffbf"]},{keys:"Ctrl + Alt + F3",scans:[b,g,"0xffc0"]},{keys:"Ctrl + Alt + F4",scans:[b,g,"0xffc1"]},{keys:"Ctrl + Alt + F5",scans:[b,g,"0xffc2"]},{keys:"Ctrl + Alt + F6",scans:[b,g,"0xffc3"]},{keys:"Ctrl + Alt + F7",scans:[b,g,"0xffc4"]},{keys:"Ctrl + Alt + F8",scans:[b,g,"0xffc5"]},{keys:"Ctrl + Alt + F9",scans:[b,g,"0xffc6"]}],k=t(3679),C=t(8336);function B(e,n,t,r,o,s,c){try{var a=e[s](c),i=a.value}catch(l){return void t(l)}a.done?n(i):Promise.resolve(i).then(r,o)}var Z=function(){var e,n=(e=o().mark((function e(n,t,r){var s,c,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=new AbortController,c=setTimeout((function(){return s.abort()}),r),e.next=4,fetch(n,{method:"PUT",headers:{"Content-Type":"application/json","Keep-Alive":"timeout=120"},signal:s.signal,body:JSON.stringify(t)});case 4:return a=e.sent,clearTimeout(c),e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})),function(){var n=this,t=arguments;return new Promise((function(r,o){var s=e.apply(n,t);function c(e){B(s,r,o,c,a,"next",e)}function a(e){B(s,r,o,c,a,"throw",e)}c(void 0)}))});return function(e,t,r){return n.apply(this,arguments)}}(),P=Z,A=t(2152),S=t(2749);function I(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0;t-=1)b.current.sendKey(e[t],0)}else b.current.sendCtrlAltDel();p(null)}}(t)},className:z.keysItem,children:(0,s.jsx)(h.Z,{variant:"subtitle1",children:n})},n)}))})]})]})]}):(0,s.jsx)(l.Z,{display:"flex",className:z.spinnerBox,children:L?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.Z,{style:{paddingBottom:"2em"},children:(0,s.jsx)(w.z,{text:"There was a problem connecting to the server, please try again"})}),(0,s.jsx)(y.Z,{onClick:function(){G(!1)},children:"Reconnect"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.z,{text:"Establishing connection with ".concat(r)}),(0,s.jsx)(w.z,{text:"This may take a few minutes"}),(0,s.jsx)(A.Z,{})]})})]})})};L.defaultProps={onClickCloseButton:void 0};var G=L,V=t(9628),K=t(2787),q=t(4690),H=t(1706);function J(e,n,t,r,o,s,c){try{var a=e[s](c),i=a.value}catch(l){return void t(l)}a.done?n(i):Promise.resolve(i).then(r,o)}var $={externalPreview:"",headerEndAdornment:null,isExternalPreviewStale:!1,isFetchPreview:!0,isShowControls:!0,isUseInnerPanel:!1,onClickConnectButton:void 0,onClickPreview:void 0,serverName:""},Q=function(e){var n=e.children;return e.isUseInnerPanel?(0,s.jsx)(k.Lg,{children:n}):(0,s.jsx)(k.s_,{children:n})},W=function(e){var n=e.children,t=e.isUseInnerPanel,r=e.text;return t?(0,s.jsxs)(k.CH,{children:[r?(0,s.jsx)(w.Ac,{text:r}):(0,s.jsx)(s.Fragment,{}),n]}):(0,s.jsxs)(k.V9,{children:[r?(0,s.jsx)(w.z,{text:r}):(0,s.jsx)(s.Fragment,{}),n]})},X=function(e){var n=e.externalPreview,t=void 0===n?$.externalPreview:n,r=e.headerEndAdornment,c=e.isExternalPreviewStale,a=void 0===c?$.isExternalPreviewStale:c,i=e.isFetchPreview,d=void 0===i?$.isFetchPreview:i,f=e.isShowControls,h=void 0===f?$.isShowControls:f,x=e.isUseInnerPanel,y=void 0===x?$.isUseInnerPanel:x,w=e.onClickPreview,b=e.serverName,g=e.serverUUID,j=e.onClickConnectButton,k=void 0===j?w:j,C=(0,v.useState)(!0),B=C[0],Z=C[1],P=(0,v.useState)(!1),S=P[0],I=P[1],F=(0,v.useState)(""),E=F[0],U=F[1],N=(0,v.useMemo)((function(){return E?(0,s.jsx)(l.Z,{alt:"",component:"img",src:"data:image/png;base64,".concat(E),sx:{height:"100%",opacity:S?"0.4":"1",padding:y?".2em":0,width:"100%"}}):(0,s.jsx)(V.Z,{sx:{height:"100%",width:"100%"}})}),[S,y,E]);return(0,v.useEffect)((function(){var e;d?(e=o().mark((function e(){var n,t,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("".concat(p.Z,"/server/").concat(g,"?ss"),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return n=e.sent,e.next=6,n.json();case 6:t=e.sent,r=t.screenshot,U(r),I(!1),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),I(!0);case 15:return e.prev=15,Z(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,12,15,18]])})),function(){var n=this,t=arguments;return new Promise((function(r,o){var s=e.apply(n,t);function c(e){J(s,r,o,c,a,"next",e)}function a(e){J(s,r,o,c,a,"throw",e)}c(void 0)}))})():t&&(U(t),I(a),Z(!1))}),[t,a,d,g]),(0,s.jsxs)(Q,{isUseInnerPanel:y,children:[(0,s.jsx)(W,{isUseInnerPanel:y,text:b,children:r}),(0,s.jsxs)(q.Z,{row:!0,sx:{"& > :first-child":{flexGrow:1}},children:[(0,s.jsx)(l.Z,{children:B?(0,s.jsx)(A.Z,{mt:"1em",mb:"1em"}):(0,s.jsx)(u.Z,{component:"span",onClick:w,sx:{borderRadius:m.n_,color:m.s7,padding:0},children:N})}),h&&(0,s.jsx)(q.Z,{children:(0,s.jsx)(H.Z,{onClick:k,children:(0,s.jsx)(K.Z,{})})})]})]})};X.defaultProps=$;var Y=X}}]);