(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{62675:function(e,t,n){"use strict";var l=n(64836);t.Z=void 0;var r=l(n(64938)),o=n(85893),i=(0,r.default)((0,o.jsx)("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6v2H8v2h8v-2h-2v-2h6c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"DesktopWindows");t.Z=i},31846:function(e,t,n){"use strict";var l=n(64836);t.Z=void 0;var r=l(n(64938)),o=n(85893),i=(0,r.default)((0,o.jsx)("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z"}),"Keyboard");t.Z=i},57976:function(e,t,n){"use strict";var l=n(64836);t.Z=void 0;var r=l(n(64938)),o=n(85893),i=(0,r.default)((0,o.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");t.Z=i},39858:function(e,t,n){"use strict";var l=n(64836);t.Z=void 0;var r=l(n(64938)),o=n(85893),i=(0,r.default)((0,o.jsx)("path",{d:"M13 3h-2v10h2V3zm4.83 2.17-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"}),"PowerSettingsNew");t.Z=i},74808:function(e,t,n){"use strict";var l=n(64836);t.Z=void 0;var r=l(n(64938)),o=n(85893),i=(0,r.default)((0,o.jsx)("path",{d:"M13 3h-2v10h2V3zm4.83 2.17-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"}),"PowerSettingsNewOutlined");t.Z=i},41171:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/server",function(){return n(49666)}])},73393:function(e,t,n){"use strict";var l=n(85893),r=n(90948),o=n(67294),i=n(25934),a=n(19467),s=n(55238),c=n(81796);let u=(0,r.ZP)(s.Z)({justifyContent:"flex-end",width:"100%"});t.Z=e=>{let{actions:t=[],loading:n}=e,r=(0,o.useMemo)(()=>t.map(e=>(0,l.jsx)(a.Z,{...e,children:e.children},(0,i.Z)())),[t]);return n?(0,l.jsx)(c.Z,{mt:0}):(0,l.jsx)(u,{row:!0,spacing:".5em",children:r})}},56597:function(e,t,n){"use strict";var l=n(85893),r=n(5616),o=n(67294),i=n(56211),a=n(55238),s=n(4121),c=n(84154);let u=(0,o.forwardRef)((e,t)=>{let{actionCancelText:n="Cancel",actionProceedText:u,children:d,closeOnProceed:h=!1,contentContainerProps:p,dialogProps:f,disableProceed:m,loading:g,loadingAction:v=!1,onActionAppend:x,onCancelAppend:b,onProceedAppend:_,openInitially:j,preActionArea:w,proceedButtonProps:Z,proceedColour:y="blue",scrollContent:C=!1,scrollBoxProps:k,showActionArea:P=!0,showCancel:M,showClose:D,titleText:O,wide:S,content:z=d}=e,A=(0,o.useRef)(null),V=(0,o.useMemo)(()=>(0,s.Z)(z,c.Ac),[z]),L=(0,o.useMemo)(()=>(0,o.createElement)(C?i.VZ:r.Z,k,V),[V,k,C]),R=(0,o.useMemo)(()=>P&&(0,l.jsx)(i.ux,{cancelProps:{children:n,onClick:function(){for(var e=arguments.length,t=Array(e),n=0;n({setOpen:e=>{var t;return null===(t=A.current)||void 0===t?void 0:t.setOpen(e)}}),[]),(0,l.jsx)(i.Js,{dialogProps:f,header:O,loading:g,openInitially:j,ref:A,showClose:D,wide:S,children:(0,l.jsxs)(a.Z,{...p,children:[L,w,R]})})});u.displayName="ConfirmDialog",t.Z=u},56211:function(e,t,n){"use strict";n.d(t,{ux:function(){return Dialog_DialogActionGroup},VZ:function(){return x},Js:function(){return _}});var l=n(85893),r=n(78262),o=n(67294),i=n(37260),a=n(81796);let s=(0,o.createContext)(void 0),c=(0,o.forwardRef)((e,t)=>{let{children:n,dialogProps:c={},loading:u,openInitially:d=!1,wide:h}=e,{open:p,PaperProps:f={},...m}=c,{sx:g,...v}=f,[x,b]=(0,o.useState)(d),_=(0,o.useMemo)(()=>null!=p?p:x,[x,p]),j=(0,o.useMemo)(()=>u?(0,l.jsx)(a.Z,{mt:0}):n,[n,u]),w=(0,o.useMemo)(()=>({minWidth:h?{xs:"calc(100%)",md:"50em"}:null,overflow:"visible",...g}),[g,h]);return(0,o.useImperativeHandle)(t,()=>({open:_,setOpen:b}),[_]),(0,l.jsx)(r.Z,{open:_,PaperComponent:i.s_,PaperProps:{...v,sx:w},...m,children:(0,l.jsx)(s.Provider,{value:{open:_,setOpen:b},children:j})})});c.displayName="Dialog";var u=n(73393);let handleAction=function(e){let{handlers:{base:t,origin:n}}=e;for(var l=arguments.length,r=Array(l>1?l-1:0),o=1;o{let{cancelProps:t,closeOnProceed:n,loading:r=!1,onCancel:i=handleAction,onProceed:a=handleAction,proceedColour:c,proceedProps:d,showCancel:h=!0,cancelChildren:p=null==t?void 0:t.children,proceedChildren:f=null==d?void 0:d.children}=e,m=(0,o.useContext)(s),g=(0,o.useCallback)(function(){for(var e=arguments.length,n=Array(e),l=0;l{null==m||m.setOpen(!1)},origin:null==t?void 0:t.onClick}},...n)},[null==t?void 0:t.onClick,m,i]),v=(0,o.useCallback)(function(){for(var e=arguments.length,t=Array(e),l=0;l{n&&(null==m||m.setOpen(!1))},origin:null==d?void 0:d.onClick}},...t)},[n,m,a,null==d?void 0:d.onClick]),x=(0,o.useMemo)(()=>{let e=[{background:c,...d,children:f,onClick:v}];return h&&e.unshift({...t,children:p,onClick:g}),(0,l.jsx)(u.Z,{actions:e,loading:r})},[p,g,t,r,f,c,v,d,h]);return x},d=n(83221),h=n(4121),p=n(84154),Dialog_DialogHeader=e=>{let{children:t,showClose:n}=e,r=(0,o.useContext)(s),a=(0,o.useMemo)(()=>(0,h.Z)(t,p.z),[t]),c=(0,o.useMemo)(()=>n&&(0,l.jsx)(d.Z,{mapPreset:"close",onClick:()=>{null==r||r.setOpen(!1)},size:"small"}),[r,n]);return(0,l.jsxs)(i.V9,{children:[a,c]})},f=n(90948),m=n(5616);let g=(0,f.ZP)(m.Z)({overflowY:"scroll",paddingRight:".4em"}),v=(0,f.ZP)(g)({maxHeight:"60vh"});var x=v;let b=(0,o.forwardRef)((e,t)=>{let{children:n,dialogProps:r,header:o,loading:i,openInitially:a,showClose:s,wide:u}=e;return(0,l.jsxs)(c,{dialogProps:r,loading:i,openInitially:a,ref:t,wide:u,children:[(0,l.jsx)(Dialog_DialogHeader,{showClose:s,children:o}),n]})});b.displayName="DialogWithHeader";var _=b},21405:function(e,t,n){"use strict";n.d(t,{Z:function(){return components_Header}});var l=n(85893),r=n(41098),o=n(90948),i=n(42293),a=n(5616),s=n(82589),c=n(54799),u=n(67294),d=n(6010),h=n(25709),p=n(13540),f=n(77533),m=n(78462),g=n(97212),v=n(98619);let x=[{text:"Anvil",image:"/pngs/anvil_icon_on.png",uri:"/manage-element"},{text:"Files",image:"/pngs/files_on.png",uri:"/file-manager"},{text:"Configure",image:"/pngs/configure_icon_on.png",uri:"/config"},{text:"Mail",image:"/pngs/email_on.png",uri:"/mail-config"},{text:"Help",image:"/pngs/help_icon_on.png",uri:"https://alteeve.com/w/Support"}],b={width:"40em",height:"40em"};var _=n(67645),j=n(57632),w=n(55238),Z=n(41247),y=n(84154),C=n(34819);let k="AnvilDrawer",P={actionIcon:"".concat(k,"-actionIcon"),list:"".concat(k,"-list")},M=(0,o.ZP)(f.ZP)(()=>({["& .".concat(P.list)]:{width:"200px"},["& .".concat(P.actionIcon)]:{fontSize:"2.3em",color:d.of}}));var components_AnvilDrawer=e=>{let{open:t,setOpen:n}=e,{getSessionUser:r}=(0,C.Z)(),o=r();return(0,l.jsx)(M,{BackdropProps:{invisible:!0},anchor:"left",open:t,onClose:()=>n(!t),children:(0,l.jsx)("div",{role:"presentation",children:(0,l.jsxs)(m.Z,{className:P.list,children:[(0,l.jsx)(g.ZP,{children:(0,l.jsx)(y.Ac,{children:o?(0,l.jsxs)(l.Fragment,{children:["Welcome, ",o.name]}):"Unregistered"})}),(0,l.jsx)(j.Z,{}),(0,l.jsx)(v.Z,{component:"a",href:"/index.html",children:(0,l.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,l.jsx)(h.Z,{className:P.actionIcon}),(0,l.jsx)(y.Ac,{children:"Dashboard"})]})}),x.map(e=>(0,l.jsx)(v.Z,{component:"a",href:e.uri,children:(0,l.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,l.jsx)("img",{alt:e.text,src:e.image,...b}),(0,l.jsx)(y.Ac,{children:e.text})]})},"anvil-drawer-".concat(e.image))),(0,l.jsx)(v.Z,{onClick:()=>{_.Z.put("/auth/logout").then(()=>{window.location.replace("/login")}).catch(e=>{(0,Z.Z)(e)})},children:(0,l.jsxs)(w.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,l.jsx)(p.Z,{className:P.actionIcon}),(0,l.jsx)(y.Ac,{children:"Logout"})]})})]})})})},D=n(83909),O=n(66354);let S="Header",z={input:"".concat(S,"-input"),barElement:"".concat(S,"-barElement"),iconBox:"".concat(S,"-iconBox"),searchBar:"".concat(S,"-searchBar"),icons:"".concat(S,"-icons")},A=(0,o.ZP)(i.Z)(e=>{let{theme:t}=e;return{paddingTop:t.spacing(.5),paddingBottom:t.spacing(.5),paddingLeft:t.spacing(3),paddingRight:t.spacing(3),borderBottom:"solid 1px",borderBottomColor:d.hM,position:"static",["& .".concat(z.input)]:{height:"2.8em",width:"30vw",backgroundColor:t.palette.secondary.main,borderRadius:d.n_},["& .".concat(z.barElement)]:{padding:0},["& .".concat(z.iconBox)]:{[t.breakpoints.down("sm")]:{display:"none"}},["& .".concat(z.searchBar)]:{[t.breakpoints.down("sm")]:{flexGrow:1,paddingLeft:"15vw"}},["& .".concat(z.icons)]:{paddingLeft:".1em",paddingRight:".1em"}}});var components_Header=()=>{let e=(0,u.useRef)({}),t=(0,u.useRef)({}),[n,o]=(0,u.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(A,{children:(0,l.jsxs)(a.Z,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:[(0,l.jsx)(w.Z,{row:!0,children:(0,l.jsx)(s.Z,{onClick:()=>o(!n),children:(0,l.jsx)("img",{alt:"",src:"/pngs/logo.png",width:"160",height:"40"})})}),(0,l.jsx)(w.Z,{className:z.iconBox,row:!0,spacing:0,children:(0,l.jsx)(a.Z,{children:(0,l.jsx)(c.Z,{onClick:e=>{var n,l;let{currentTarget:r}=e;null===(n=t.current.setAnchor)||void 0===n||n.call(null,r),null===(l=t.current.setOpen)||void 0===l||l.call(null,!0)},sx:{color:d.of,padding:"0 .1rem"},children:(0,l.jsx)(D.Z,{icon:r.Z,ref:e})})})})]})}),(0,l.jsx)(components_AnvilDrawer,{open:n,setOpen:o}),(0,l.jsx)(O.Z,{onFetchSuccessAppend:t=>{var n;null===(n=e.current.indicate)||void 0===n||n.call(null,Object.keys(t).length>0)},ref:t})]})}},65275:function(e,t,n){"use strict";var l=n(85893),r=n(42429),o=n(9309),i=n(6010);t.Z=e=>{let{children:t,sx:n}=e,a={backgroundColor:i.lD,paddingRight:"3em",["&.".concat(r.Z.selected)]:{backgroundColor:i.s7,fontWeight:400,["&.".concat(r.Z.focusVisible)]:{backgroundColor:i.s7},"&:hover":{backgroundColor:i.s7}},["&.".concat(r.Z.focusVisible)]:{backgroundColor:i.s7},"&:hover":{backgroundColor:i.s7},...n};return(0,l.jsx)(o.Z,{...e,sx:a,children:t})}},4121:function(e,t,n){"use strict";var l=n(67294);t.Z=(e,t)=>"string"==typeof e?(0,l.createElement)(t,null,e):e},11221:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{noSSR:function(){return noSSR},default:function(){return dynamic}});let l=n(38754),r=(n(67294),l._(n(80177)));function convertModule(e){return{default:(null==e?void 0:e.default)||e}}function noSSR(e,t){return delete t.webpack,delete t.modules,e(t)}function dynamic(e,t){let n=r.default,l={loading:e=>{let{error:t,isLoading:n,pastDelay:l}=e;return null}};e instanceof Promise?l.loader=()=>e:"function"==typeof e?l.loader=e:"object"==typeof e&&(l={...l,...e}),l={...l,...t};let o=l.loader;return(l.loadableGenerated&&(l={...l,...l.loadableGenerated},delete l.loadableGenerated),"boolean"!=typeof l.ssr||l.ssr)?n({...l,loader:()=>null!=o?o().then(convertModule):Promise.resolve(convertModule(()=>null))}):(delete l.webpack,delete l.modules,noSSR(n,l))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},37747:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return o}});let l=n(38754),r=l._(n(67294)),o=r.default.createContext(null)},80177:function(e,t,n){"use strict";/** @copyright (c) 2017-present James Kyle MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE */Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let l=n(38754),r=l._(n(67294)),o=n(37747),i=[],a=[],s=!1;function load(e){let t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then(e=>(n.loading=!1,n.loaded=e,e)).catch(e=>{throw n.loading=!1,n.error=e,e}),n}let LoadableSubscription=class LoadableSubscription{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}};function Loadable(e){return function(e,t){let n=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),l=null;function init(){if(!l){let t=new LoadableSubscription(e,n);l={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return l.promise()}if(!s){let e=n.webpack?n.webpack():n.modules;e&&a.push(t=>{for(let n of e)if(t.includes(n))return init()})}function LoadableComponent(e,t){!function(){init();let e=r.default.useContext(o.LoadableContext);e&&Array.isArray(n.modules)&&n.modules.forEach(t=>{e(t)})}();let i=r.default.useSyncExternalStore(l.subscribe,l.getCurrentValue,l.getCurrentValue);return r.default.useImperativeHandle(t,()=>({retry:l.retry}),[]),r.default.useMemo(()=>{var t;return i.loading||i.error?r.default.createElement(n.loading,{isLoading:i.loading,pastDelay:i.pastDelay,timedOut:i.timedOut,error:i.error,retry:l.retry}):i.loaded?r.default.createElement((t=i.loaded)&&t.default?t.default:t,e):null},[e,i])}return LoadableComponent.preload=()=>init(),LoadableComponent.displayName="LoadableComponent",r.default.forwardRef(LoadableComponent)}(load,e)}function flushInitializers(e,t){let n=[];for(;e.length;){let l=e.pop();n.push(l(t))}return Promise.all(n).then(()=>{if(e.length)return flushInitializers(e,t)})}Loadable.preloadAll=()=>new Promise((e,t)=>{flushInitializers(i).then(e,t)}),Loadable.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let res=()=>(s=!0,t());flushInitializers(a,e).then(res,res)})),window.__NEXT_PRELOADREADY=Loadable.preloadReady;let c=Loadable},49666:function(e,t,n){"use strict";n.r(t);var l=n(85893),r=n(90948),o=n(5616),i=n(9008),a=n.n(i),s=n(11163),c=n(67294),u=n(81302),d=n(21405);let h="Server",p={preview:"".concat(h,"-preview"),fullView:"".concat(h,"-fullView")},f=(0,r.ZP)("div")(e=>{let{theme:t}=e;return{["& .".concat(p.preview)]:{width:"25%",height:"100%",[t.breakpoints.down("md")]:{width:"100%"}},["& .".concat(p.fullView)]:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"}}});t.default=()=>{let[e,t]=(0,c.useState)(!0),n=(0,s.useRouter)(),{server_name:r,server_state:i,uuid:h,vnc:m}=n.query,g=((null==m?void 0:m.toString())||"").length>0,v=(null==r?void 0:r.toString())||"",x=(null==i?void 0:i.toString())||"",b=(null==h?void 0:h.toString())||"";return(0,c.useEffect)(()=>{g&&t(!1)},[g]),(0,l.jsxs)(f,{children:[(0,l.jsx)(a(),{children:(0,l.jsx)("title",{children:v})}),(0,l.jsx)(d.Z,{}),e?(0,l.jsx)(o.Z,{className:p.preview,children:(0,l.jsx)(u.M,{onClickPreview:()=>{t(!1)},serverName:v,serverState:x,serverUUID:b})}):(0,l.jsx)(o.Z,{className:p.fullView,children:(0,l.jsx)(u.S,{onClickCloseButton:()=>{t(!0)},serverUUID:b,serverName:v})})]})}},5152:function(e,t,n){e.exports=n(11221)},11163:function(e,t,n){e.exports=n(38355)}},function(e){e.O(0,[494,416,50,775,302,774,888,179],function(){return e(e.s=41171)}),_N_E=e.O()}]);