Local modifications to ClusterLabs/Anvil by Alteeve
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
52 KiB

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[490],{5685:function(e,n,t){"use strict";var r=t(7892),o=t(5893);n.Z=(0,r.Z)((0,o.jsx)("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15zM14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2z"}),"QuestionMark")},8262:function(e,n,t){"use strict";t.d(n,{Z:function(){return A}});var r=t(3366),o=t(7462),i=t(7294),l=t(6010),c=t(7192),a=t(7579),s=t(8216),u=t(9964),d=t(6628),f=t(5113),p=t(3616),h=t(1496),m=t(8979);function y(e){return(0,m.Z)("MuiDialog",e)}var b=(0,t(6087).Z)("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);var v=(0,i.createContext)({}),g=t(7227),x=t(2734),j=t(5893);const w=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],P=(0,h.ZP)(g.Z,{name:"MuiDialog",slot:"Backdrop",overrides:(e,n)=>n.backdrop})({zIndex:-1}),O=(0,h.ZP)(u.Z,{name:"MuiDialog",slot:"Root",overridesResolver:(e,n)=>n.root})({"@media print":{position:"absolute !important"}}),Z=(0,h.ZP)("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.container,n[`scroll${(0,s.Z)(t.scroll)}`]]}})((({ownerState:e})=>(0,o.Z)({height:"100%","@media print":{height:"auto"},outline:0},"paper"===e.scroll&&{display:"flex",justifyContent:"center",alignItems:"center"},"body"===e.scroll&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}))),S=(0,h.ZP)(f.Z,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.paper,n[`scrollPaper${(0,s.Z)(t.scroll)}`],n[`paperWidth${(0,s.Z)(String(t.maxWidth))}`],t.fullWidth&&n.paperFullWidth,t.fullScreen&&n.paperFullScreen]}})((({theme:e,ownerState:n})=>(0,o.Z)({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},"paper"===n.scroll&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},"body"===n.scroll&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!n.maxWidth&&{maxWidth:"calc(100% - 64px)"},"xs"===n.maxWidth&&{maxWidth:"px"===e.breakpoints.unit?Math.max(e.breakpoints.values.xs,444):`${e.breakpoints.values.xs}${e.breakpoints.unit}`,[`&.${b.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}},"xs"!==n.maxWidth&&{maxWidth:`${e.breakpoints.values[n.maxWidth]}${e.breakpoints.unit}`,[`&.${b.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[n.maxWidth]+64)]:{maxWidth:"calc(100% - 64px)"}}},n.fullWidth&&{width:"calc(100% - 64px)"},n.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${b.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})));var A=i.forwardRef((function(e,n){const t=(0,p.Z)({props:e,name:"MuiDialog"}),u=(0,x.Z)(),h={enter:u.transitions.duration.enteringScreen,exit:u.transitions.duration.leavingScreen},{"aria-describedby":m,"aria-labelledby":b,BackdropComponent:g,BackdropProps:A,children:k,className:C,disableEscapeKeyDown:I=!1,fullScreen:T=!1,fullWidth:E=!1,maxWidth:M="sm",onBackdropClick:D,onClose:F,open:B,PaperComponent:W=f.Z,PaperProps:R={},scroll:U="paper",TransitionComponent:N=d.Z,transitionDuration:L=h,TransitionProps:$}=t,_=(0,r.Z)(t,w),H=(0,o.Z)({},t,{disableEscapeKeyDown:I,fullScreen:T,fullWidth:E,maxWidth:M,scroll:U}),V=(e=>{const{classes:n,scroll:t,maxWidth:r,fullWidth:o,fullScreen:i}=e,l={root:["root"],container:["container",`scroll${(0,s.Z)(t)}`],paper:["paper",`paperScroll${(0,s.Z)(t)}`,`paperWidth${(0,s.Z)(String(r))}`,o&&"paperFullWidth",i&&"paperFullScreen"]};return(0,c.Z)(l,y,n)})(H),z=i.useRef(),G=(0,a.Z)(b),K=i.useMemo((()=>({titleId:G})),[G]);return(0,j.jsx)(O,(0,o.Z)({className:(0,l.Z)(V.root,C),BackdropProps:(0,o.Z)({transitionDuration:L,as:g},A),closeAfterTransition:!0,BackdropComponent:P,disableEscapeKeyDown:I,onClose:F,open:B,ref:n,onClick:e=>{z.current&&(z.current=null,D&&D(e),F&&F(e,"backdropClick"))},ownerState:H},_,{children:(0,j.jsx)(N,(0,o.Z)({appear:!0,in:B,timeout:L,role:"presentation"},$,{children:(0,j.jsx)(Z,{className:(0,l.Z)(V.container),onMouseDown:e=>{z.current=e.target===e.currentTarget},ownerState:H,children:(0,j.jsx)(S,(0,o.Z)({as:W,elevation:24,role:"dialog","aria-describedby":m,"aria-labelledby":G},R,{className:(0,l.Z)(V.paper,R.className),ownerState:H,children:(0,j.jsx)(v.Provider,{value:K,children:k})}))})}))}))}))},7579:function(e,n,t){"use strict";var r;t.d(n,{Z:function(){return c}});var o=t(7294);let i=0;const l=(r||(r=t.t(o,2))).useId;function c(e){if(void 0!==l){const n=l();return null!=e?e:n}return function(e){const[n,t]=o.useState(e),r=e||n;return o.useEffect((()=>{null==n&&(i+=1,t(`mui-${i}`))}),[n]),r}(e)}},329:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/config",function(){return t(6028)}])},157:function(e,n,t){"use strict";var r=t(5893),o=t(7357),i=t(8262),l=t(7294),c=t(7169),a=t(4825),s=t(4690),u=t(3679),d=t(2152),f=t(7750);function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function h(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){h(e,n,t[n])}))}return e}function y(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function b(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"===typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v={blue:c.Ej,red:c.hM},g=(0,l.forwardRef)((function(e,n){var t=e.actionCancelText,p=void 0===t?"Cancel":t,h=e.actionProceedText,g=e.contentContainerProps,x=void 0===g?{}:g,j=e.closeOnProceed,w=void 0!==j&&j,P=e.content,O=e.dialogProps,Z=void 0===O?{}:O,S=Z.open,A=void 0!==S&&S,k=Z.PaperProps,C=void 0===k?{}:k,I=e.disableProceed,T=e.formContent,E=e.loading,M=void 0!==E&&E,D=e.loadingAction,F=void 0!==D&&D,B=e.onActionAppend,W=e.onCancelAppend,R=e.onProceedAppend,U=e.onSubmitAppend,N=e.openInitially,L=void 0!==N&&N,$=e.preActionArea,_=e.proceedButtonProps,H=void 0===_?{}:_,V=e.proceedColour,z=void 0===V?"blue":V,G=e.scrollContent,K=void 0!==G&&G,q=e.scrollBoxProps,X=(void 0===q?{}:q).sx,Y=e.titleText,J=y(e.dialogProps,["open","PaperProps"]),Q=y(e.scrollBoxProps,["sx"]),ee=C.sx,ne=y(C,["sx"]),te=H.disabled,re=void 0===te?I:te,oe=H.sx,ie=y(H,["disabled","sx"]),le=(0,l.useState)(L),ce=le[0],ae=le[1],se=(0,l.useMemo)((function(){return n?ce:A}),[A,ce,n]),ue=(0,l.useMemo)((function(){return v[z]}),[z]),de=(0,l.useMemo)((function(){var e,n,t,r=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r,o;w&&ae(!1),null===B||void 0===B||(r=B).call.apply(r,[null].concat(b(n))),null===R||void 0===R||(o=R).call.apply(o,[null].concat(b(n)))};return T&&(e="form",n=function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];var o;e.preventDefault(),w&&ae(!1),null===U||void 0===U||(o=U).call.apply(o,[null,e].concat(b(t)))},r=void 0,t="submit"),{contentContainerComponent:e,contentContainerSubmitEventHandler:n,proceedButtonClickEventHandler:r,proceedButtonType:t}}),[w,T,B,R,U]),fe=de.contentContainerComponent,pe=de.contentContainerSubmitEventHandler,he=de.proceedButtonClickEventHandler,me=de.proceedButtonType,ye=(0,l.useMemo)((function(){return(0,r.jsx)(a.Z,{onClick:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r,o;ae(!1),null===B||void 0===B||(r=B).call.apply(r,[null].concat(b(n))),null===W||void 0===W||(o=W).call.apply(o,[null].concat(b(n)))},children:p})}),[p,B,W]),be=(0,l.useMemo)((function(){return(0,r.jsx)(a.Z,m({disabled:re,onClick:he,type:me},ie,{sx:m({backgroundColor:ue,color:c.lD,"&:hover":{backgroundColor:"".concat(ue,"F0")}},oe),children:h}))}),[h,he,re,oe,me,ue,ie]),ve=(0,l.useMemo)((function(){return F?(0,r.jsx)(d.Z,{mt:0}):(0,r.jsxs)(s.Z,{row:!0,spacing:".5em",sx:{justifyContent:"flex-end",width:"100%"},children:[ye,be]})}),[ye,F,be]),ge=(0,l.useMemo)((function(){return"string"===typeof P?(0,r.jsx)(f.Ac,{text:P}):P}),[P]),xe=(0,l.useMemo)((function(){return"string"===typeof Y?(0,r.jsx)(f.z,{children:Y}):Y}),[Y]),je=(0,l.useMemo)((function(){var e,n,t;K&&(T&&(n="hidden",t=".6em"),e=m({maxHeight:"60vh",overflowX:n,overflowY:"scroll",paddingRight:".4em",paddingTop:t},X));return e}),[T,K,X]),we=(0,l.useMemo)((function(){return M?(0,r.jsx)(d.Z,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,m({},Q,{sx:je,children:ge})),$,ve]})}),[ve,je,ge,M,$,Q]);return(0,l.useImperativeHandle)(n,(function(){return{setOpen:function(e){return ae(e)}}}),[]),(0,r.jsxs)(i.Z,m({open:se,PaperComponent:u.s_,PaperProps:m({},ne,{sx:m({overflow:"visible"},ee)})},J,{children:[(0,r.jsx)(u.V9,{children:xe}),(0,r.jsx)(s.Z,m({component:fe,onSubmit:pe},x,{children:we}))]}))}));g.displayName="ConfirmDialog",n.Z=g},2545:function(e,n,t){"use strict";var r=t(5893),o=t(7294),i=t(157),l=t(1706),c=t(7750);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var u=(0,o.forwardRef)((function(e,n){var t=e.scrollContent,u=e.showClose,d=e.titleText,f=s(e,["scrollContent","showClose","titleText"]),p=(0,o.useMemo)((function(){return t?".5em":void 0}),[t]),h=(0,o.useMemo)((function(){var e="string"===typeof d?(0,r.jsx)(c.z,{children:d}):d;return u?(0,r.jsxs)(r.Fragment,{children:[e,(0,r.jsx)(l.Z,{mapPreset:"close",onClick:function(){var e,t;n&&"current"in n&&(null===(e=n.current)||void 0===e||null===(t=e.setOpen)||void 0===t||t.call(null,!1))},variant:"redcontained"})]}):e}),[n,u,d]);return(0,r.jsx)(i.Z,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){a(e,n,t[n])}))}return e}({dialogProps:{PaperProps:{sx:{minWidth:{xs:"90%",md:"50em"}}}},formContent:!0,scrollBoxProps:{paddingRight:p,paddingTop:".3em"},scrollContent:t,titleText:h},f,{ref:n}))}));u.defaultProps={showClose:!1},u.displayName="FormDialog",n.Z=u},8610:function(e,n,t){"use strict";var r=t(5893),o=t(8216),i=t(7212),l=t(8462),c=t(7357),a=t(4690),s=t(7750);function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function d(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function f(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){d(e,n,t[n])}))}return e}function p(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],l=!0,c=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);l=!0);}catch(a){c=!0,o=a}finally{try{l||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return u(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return u(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var h=function(e){var n=e.replace(/([a-z\d])([A-Z])/g,"$1 $2").toLowerCase();return(0,o.Z)(n)},m=function(e){var n=e.entry;return(0,r.jsx)(s.$_,{whiteSpace:"nowrap",children:String(n)})},y=function(e){var n=e.depth,t=void 0===n?0:n,o=e.entries,c=e.getEntryLabel,a=e.getListProps,s=e.getListItemProps,u=e.listKey,d=e.maxDepth,h=e.renderEntry,m=e.renderEntryValue,b=[];Object.entries(o).forEach((function(e){var n=p(e,2),o=n[0],l=n[1],a="form-summary-entry-".concat(o),u=null!==l&&"object"===typeof l,v=u?null:l;b.push((0,r.jsx)(i.ZP,f({sx:{paddingLeft:"".concat(t,"em")}},null===s||void 0===s?void 0:s.call(null,{depth:t,entry:v,key:o}),{children:h({depth:t,entry:v,getLabel:c,key:o,nest:u,renderValue:m})}),a)),u&&t<d&&b.push(y({depth:t+1,entries:l,getEntryLabel:c,listKey:o,maxDepth:d,renderEntry:h,renderEntryValue:m}))}));var v="form-summary-list-".concat(null!==u&&void 0!==u?u:"root");return(0,r.jsx)(l.Z,f({dense:!0,disablePadding:!0},null===a||void 0===a?void 0:a.call(null,{depth:t,entries:o,key:u}),{children:b}),v)};n.Z=function(e){var n=e.entries,t=e.getEntryLabel,o=void 0===t?function(e){return(0,e.cap)(e.key)}:t,i=e.getListProps,l=e.getListItemProps,u=e.hasPassword,d=e.maxDepth,f=void 0===d?3:d,p=e.renderEntry,b=void 0===p?function(e){var n=e.depth,t=e.entry,o=e.getLabel,i=e.key,l=e.nest,u=e.renderValue;return(0,r.jsxs)(a.Z,{fullWidth:!0,growFirst:!0,row:!0,maxWidth:"100%",children:[(0,r.jsx)(s.Ac,{children:o({cap:h,depth:n,entry:t,key:i})}),(0,r.jsx)(c.Z,{sx:{maxWidth:"100%",overflowX:"scroll"},children:!l&&u({depth:n,entry:t,key:i})})]})}:p,v=e.renderEntryValue;return y({entries:n,getEntryLabel:o,getListProps:i,getListItemProps:l,maxDepth:f,renderEntry:b,renderEntryValue:void 0===v?function(e){var n=e.entry;return["",null,void 0].some((function(e){return n===e}))?(0,r.jsx)(s.Ac,{children:"none"}):u?function(e){var n=e.entry,t=e.key;return/passw/i.test(t)?(0,r.jsx)(s.PJ,{revealButtonProps:{sx:{marginRight:0,padding:0}},monospaced:!0,textLineHeight:null,children:String(n)}):m(e)}(e):m(e)}:v})}},5741:function(e,n,t){"use strict";var r=t(5893),o=t(1714),i=t(122),l=t(7169),c=t(4690);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){a(e,n,t[n])}))}return e}function u(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}n.Z=function(e){var n=e.children,t=e.sx,a=u(e,["children","sx"]);return(0,r.jsx)(i.Z,s({underline:"hover",variant:"subtitle1"},a,{sx:s({color:l.lD,textDecorationColor:l.s7},t),children:(0,r.jsxs)(c.Z,{row:!0,children:[n,(0,r.jsx)(o.Z,{sx:{marginLeft:".3em"}})]})}))}},3906:function(e,n,t){"use strict";var r=t(5893),o=t(7294),i=t(6607),l=t(8610);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){c(e,n,t[n])}))}return e}n.Z=function(e){var n=e.list,t=void 0===n?{}:n,c=(0,o.useState)({}),s=c[0],u=c[1],d=(0,o.useMemo)((function(){return Object.keys(t)}),[t]),f=(0,o.useMemo)((function(){return Object.keys(s)}),[s]),p=(0,o.useMemo)((function(){return f.length===d.length}),[f.length,d.length]),h=(0,o.useMemo)((function(){return f.length>0}),[f.length]),m=(0,o.useMemo)((function(){return d.length>1}),[d.length]),y=(0,o.useCallback)((function(e){var n=e.confirmDialogProps,t=void 0===n?{}:n,o=e.formSummaryProps,i=void 0===o?{}:o,c=e.getConfirmDialogTitle,u=e.onProceedAppend,d=e.renderEntry;return a({actionProceedText:"Delete",content:(0,r.jsx)(l.Z,a({entries:s,maxDepth:0,renderEntry:d},i)),onProceedAppend:u,proceedColour:"red",titleText:c(f.length)},t)}),[s,f.length]),b=(0,o.useCallback)((function(e){return s[e]}),[s]),v=(0,o.useCallback)((function(e){return u(d.reduce((function(n,t){return e&&(n[t]=e),n}),{}))}),[d]),g=(0,o.useCallback)((function(e,n){return u((0,i.ZP)(e,n||void 0))}),[]);return{buildDeleteDialogProps:y,checklist:s,checks:f,getCheck:b,hasAllChecks:p,hasChecks:h,multipleItems:m,setAllChecks:v,setCheck:g}}},6632:function(e,n,t){"use strict";var r=t(7294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){o(e,n,t[n])}))}return e}function l(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}n.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.actionProceedText,t=void 0===n?"":n,o=e.content,c=void 0===o?"":o,a=e.titleText,s=void 0===a?"":a,u=l(e,["actionProceedText","content","titleText"]);return(0,r.useState)(i({actionProceedText:t,content:c,titleText:s},u))}},3106:function(e,n){"use strict";n.Z={bcn:"Back-Channel Network",ifn:"Internet-Facing Network",mn:"Migration Network",sn:"Storage Network"}},6028:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Qe}});var r=t(5893),o=t(6886),i=t(9008),l=t(7294),c=t(2029),a=t(157),s=t(5521),u=t(1905),d=t(3106),f=t(4188),p=t(4390);function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function m(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],l=!0,c=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);l=!0);}catch(a){c=!0,o=a}finally{try{l||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return h(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var y=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=function(t){var r;null===(r=n.current.setMessage)||void 0===r||r.call(null,e,t)};return t&&(t[r]=o),o},b=function(e,n){var t,r,o={};return t=e,o=(null!=(r=Array)&&"undefined"!==typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](t):t instanceof r)?e.reduce((function(e,t){return y(t,n,e),e}),o):Object.entries(e).reduce((function(e,t){var r=m(t,2),o=r[0],i=r[1];return y(i,n,e,o),e}),o)},v=t(4894),g=t(6607),x=t(480),j=t(2349),w=t(7750);function P(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){P(e,n,t[n])}))}return e}var Z=function(e){var n=e.checkboxProps,t=e.checked,o=e.formControlLabelProps,i=e.label,c=e.onChange,a=(0,l.useMemo)((function(){return"string"===typeof i?(0,r.jsx)(w.Ac,{children:i}):i}),[i]);return(0,r.jsx)(x.Z,O({},o,{control:(0,r.jsx)(j.Z,O({},n,{checked:t,onChange:c})),label:a}))},S=t(4690),A=t(7504),k=t(1770),C=t(1706),I=t(9099),T=t(7869),E=t(6284),M=t(7987),D=t(3144),F=t(2749);function B(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function W(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],l=!0,c=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);l=!0);}catch(a){c=!0,o=a}finally{try{l||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return B(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return B(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var R={dbPort:"dbPort",ipAddress:"ipAddress",password:"password",sshPort:"sshPort",user:"user"},U="DB port",N="IP address",L="Password",$="Ping",_="SSH port",H="User",V=(0,l.forwardRef)((function(e,n){var t=e.formGridColumns,o=void 0===t?2:t,i=(0,D.Z)().protect,c=(0,l.useRef)({}),s=(0,l.useRef)({}),u=(0,l.useRef)({}),d=(0,l.useRef)({}),h=(0,l.useRef)({}),m=(0,l.useRef)({}),y=(0,l.useState)({}),x=y[0],j=y[1],P=(0,l.useState)(!1),O=P[0],B=P[1],V=W((0,F.Z)(!1,i),2),z=V[0],G=V[1],K=(0,l.useCallback)((function(e){return function(n){var t=n.isValid;j((0,g.ZP)(e,t))}}),[]),q=(0,l.useCallback)((function(e){return function(n){j((0,g.ZP)(e,n))}}),[]),X=(0,l.useCallback)((function(e){var n;null===(n=m.current.setMessage)||void 0===n||n.call(null,"api",e)}),[]),Y=(0,l.useMemo)((function(){return Object.values(x).some((function(e){return!e}))}),[x]),J=(0,l.useMemo)((function(){return b(R,m)}),[]);return(0,r.jsx)(a.Z,{actionProceedText:"Add",content:(0,r.jsx)(A.Z,{columns:{xs:1,sm:o},layout:{"add-peer-user-and-ip-address":{children:(0,r.jsxs)(S.Z,{row:!0,spacing:".3em",children:[(0,r.jsx)(I.Z,{input:(0,r.jsx)(E.Z,{formControlProps:{sx:{minWidth:"4.6em",width:"25%"}},id:"add-peer-user-input",inputProps:{placeholder:"admin"},label:H}),inputTestBatch:(0,M.Gn)(H,(function(){J.user()}),{onFinishBatch:q(R.user)},(function(e){J.user({children:e})})),onFirstRender:K(R.user),ref:h}),(0,r.jsx)(w.Ac,{children:"@"}),(0,r.jsx)(I.Z,{input:(0,r.jsx)(E.Z,{id:"add-peer-ip-address-input",label:N}),inputTestBatch:(0,M._)(N,(function(){J.ipAddress()}),{onFinishBatch:q(R.ipAddress)},(function(e){J.ipAddress({children:e})})),onFirstRender:K(R.ipAddress),ref:s,required:!0})]})},"add-peer-password":{children:(0,r.jsx)(I.Z,{input:(0,r.jsx)(E.Z,{fillRow:!0,id:"add-peer-password-input",label:L,type:f.Z.password}),inputTestBatch:(0,M.Gn)(L,(function(){J.password()}),{onFinishBatch:q(R.password)},(function(e){J.password({children:e})})),onFirstRender:K(R.password),ref:u,required:!0})},"add-peer-db-and-ssh-port":{children:(0,r.jsxs)(S.Z,{row:!0,children:[(0,r.jsx)(I.Z,{input:(0,r.jsx)(E.Z,{id:"add-peer-db-port-input",inputProps:{placeholder:"5432"},label:U}),inputTestBatch:(0,v.Z)(U,(function(){J.dbPort()}),{onFinishBatch:q(R.dbPort)},(function(e){J.dbPort({children:e})})),onFirstRender:K(R.dbPort),ref:c}),(0,r.jsx)(I.Z,{input:(0,r.jsx)(E.Z,{id:"add-peer-ssh-port-input",inputProps:{placeholder:"22"},label:_}),inputTestBatch:(0,v.Z)(_,(function(){J.sshPort()}),{onFinishBatch:q(R.sshPort)},(function(e){J.sshPort({children:e})})),onFirstRender:K(R.sshPort),ref:d})]})},"add-peer-is-ping":{children:(0,r.jsx)(Z,{checked:O,label:$,onChange:function(e,n){B(n)}}),sx:{display:"flex"}},"add-peer-message-group":{children:(0,r.jsx)(T.Z,{count:1,defaultMessageType:"warning",ref:m}),sm:o}},spacing:"1em"}),dialogProps:{PaperProps:{sx:{minWidth:"16em"}}},loadingAction:z,onActionAppend:function(){X()},onProceedAppend:function(){var e,n,t,r,o;G(!0),p.Z.post("/host/connection",{ipAddress:null===(e=s.current.getValue)||void 0===e?void 0:e.call(null),isPing:O,password:null===(n=u.current.getValue)||void 0===n?void 0:n.call(null),port:null===(t=c.current.getValue)||void 0===t?void 0:t.call(null),sshPort:null===(r=d.current.getValue)||void 0===r?void 0:r.call(null),user:null===(o=h.current.getValue)||void 0===o?void 0:o.call(null)}).then((function(){X({children:"Successfully initiated the peer addition. You can continue to edit the field(s) to add another peer.",type:"info"})})).catch((function(e){var n=(0,k.Z)(e);n.children="Failed to add the given peer. ".concat(n.children),X(n)})).finally((function(){G(!1)}))},proceedButtonProps:{disabled:Y},ref:n,titleText:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.z,{children:"Add a peer"}),(0,r.jsx)(C.Z,{mapPreset:"close",onClick:function(){var e;n&&"current"in n&&(null===(e=n.current.setOpen)||void 0===e||e.call(null,!1))},variant:"redcontained"})]})})}));V.displayName="AddPeerDialog";var z=V,G=t(6125),K=t(8187),q=t(3679),X=t(5537),Y=t(2026),J=t(7169),Q={small:w.KI,medium:w.Ac},ee={size:"small",stateMap:new Map([[!1,(0,r.jsx)(X.Z,{sx:{color:J.Wd}},"state-false")],[!0,(0,r.jsx)(Y.Z,{sx:{color:J.Ej}},"state-true")]])},ne=function(e){var n=e.label,t=e.size,o=void 0===t?ee.size:t,i=e.state,c=e.stateMap,a=(void 0===c?ee.stateMap:c).get(i);return(0,r.jsxs)(S.Z,{row:!0,spacing:".3em",children:[a&&(0,l.cloneElement)(a,{fontSize:o}),(0,l.createElement)(Q[o],{},n)]})};ne.defaultProps=ee;var te=ne;function re(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function oe(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ie(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){oe(e,n,t[n])}))}return e}function le(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],l=!0,c=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);l=!0);}catch(a){c=!0,o=a}finally{try{l||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return re(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return re(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ce=function(e){var n=e.refreshInterval,t=void 0===n?6e4:n,i=(0,D.Z)().protect,s=(0,l.useRef)({}),f=(0,l.useRef)({}),h=le((0,F.Z)(void 0,i),2),m=h[0],y=h[1],b=(0,l.useState)({actionProceedText:"",content:"",titleText:""}),v=b[0],g=b[1],x=le((0,F.Z)({},i),2),j=x[0],P=x[1],O=(0,l.useState)(!1),Z=O[0],A=O[1],C=le((0,F.Z)({},i),2),I=C[0],T=C[1],E=(0,l.useMemo)((function(){return m&&(0,r.jsx)(o.ZP,{item:!0,sm:2,xs:1,children:(0,r.jsx)(K.Z,ie({},m))})}),[m]),M=(0,u.Z)("".concat(c.Z,"/host/connection"),{refreshInterval:t,onError:function(e){y({children:"Failed to get connection data. Error: ".concat(e),type:"error"})},onSuccess:function(e){var n=e.local,t=n.inbound,r=t.ipAddress,o=t.port,i=t.user,l=n.peer;P((function(e){return Object.entries(r).reduce((function(n,t){var r=le(t,2),l=r[0],c=r[1],a=c.networkLinkNumber,s=c.networkNumber,u=c.networkType;return n[l]=ie({},e[l],{dbPort:o,dbUser:i,ipAddress:l,networkLinkNumber:a,networkNumber:s,networkType:u}),n}),{})})),T((function(e){return Object.entries(l).reduce((function(n,t){var r=le(t,2),o=r[0],i=r[1],l=i.hostUUID,c=i.isPing,a=i.port,s=i.user,u="".concat(s,"@").concat(o,":").concat(a);return n[u]=ie({},e[u],{dbPort:a,dbUser:s,hostUUID:l,ipAddress:o,isPingTest:c}),n}),{})}))}}).isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(q.TZ,{header:"Configure striker peers",loading:M,children:(0,r.jsxs)(o.ZP,{columns:{xs:1,sm:2},container:!0,spacing:"1em",children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(G.Z,{header:"Inbound connections",listEmpty:(0,r.jsx)(w.Ac,{align:"center",children:"No inbound connections found."}),listItemKeyPrefix:"config-peers-inbound-connection",listItems:j,renderListItem:function(e,n){var t=n.dbPort,o=n.dbUser,i=n.networkNumber,l=n.networkType;return(0,r.jsxs)(S.Z,{spacing:0,sx:{width:"100%"},children:[(0,r.jsx)(w.$_,{children:"".concat(o,"@").concat(e,":").concat(t)}),(0,r.jsx)(w.KI,{children:"".concat(d.Z[l]," ").concat(i)})]})}})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(G.Z,{header:"Peer connections",allowEdit:!0,edit:Z,listEmpty:(0,r.jsx)(w.Ac,{align:"center",children:"No peer connections found."}),listItemKeyPrefix:"config-peers-peer-connection",listItems:I,onAdd:function(){var e;null===(e=s.current.setOpen)||void 0===e||e.call(null,!0)},onDelete:function(){var e,n=Object.entries(I).reduce((function(e,n){var t=le(n,2)[1],r=t.hostUUID;return t.isChecked&&e.local.push(r),e}),{local:[]}),t=n.local.length;t>0&&(g({actionProceedText:"Delete",content:"The peer relationship between this striker and the selected ".concat(t," host(s) will terminate. The removed peer(s) can be re-added later."),onProceedAppend:function(){p.Z.delete("/host/connection",{data:n}).catch((function(e){var n=(0,k.Z)(e);n.children="Failed to delete peer connection(s). ".concat(n.children),y(n)}))},proceedColour:"red",titleText:"Delete ".concat(t," peer(s) from this striker?")}),null===(e=f.current.setOpen)||void 0===e||e.call(null,!0))},onEdit:function(){A((function(e){return!e}))},onItemCheckboxChange:function(e,n,t){I[e].isChecked=t,T((function(e){return ie({},e)}))},renderListItem:function(e,n){var t=n.isPingTest,o=void 0!==t&&t;return(0,r.jsx)(S.Z,{row:!0,spacing:0,children:(0,r.jsxs)(S.Z,{spacing:0,children:[(0,r.jsx)(w.$_,{children:e}),(0,r.jsx)(te,{label:"Ping",state:o})]})})}})}),E]})}),(0,r.jsx)(z,{ref:s}),(0,r.jsx)(a.Z,ie({closeOnProceed:!0},v,{ref:f}))]})},ae=t(582),se=t(5741),ue=t(3906);function de(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function fe(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){fe(e,n,t[n])}))}return e}function he(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],l=!0,c=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);l=!0);}catch(a){c=!0,o=a}finally{try{l||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return de(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return de(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var me=function(e){var n=e.mitmExternalHref,t=void 0===n?"https://en.wikipedia.org/wiki/Man-in-the-middle_attack":n,o=e.refreshInterval,i=void 0===o?6e4:o,s=(0,l.useRef)({}),d=he((0,F.Z)(void 0),2),f=d[0],h=d[1],m=he((0,F.Z)({}),2),y=m[0],b=m[1],v=he((0,F.Z)({actionProceedText:"",content:"",titleText:""}),2),g=v[0],x=v[1],j=(0,ue.Z)({list:y}),P=j.checks,O=j.getCheck,Z=j.hasAllChecks,A=j.hasChecks,C=j.setAllChecks,I=j.setCheck,T=(0,l.useMemo)((function(){return f&&(0,r.jsx)(K.Z,pe({},f))}),[f]),E=(0,l.useMemo)((function(){return Object.keys(y).length>1}),[y]),M=(0,u.Z)("".concat(c.Z,"/ssh-key/conflict"),{onError:function(e){h({children:"Failed to fetch SSH key conflicts. Error: ".concat(e),type:"error"})},onSuccess:function(e){b((function(n){return Object.values(e).reduce((function(e,t){return Object.values(t).forEach((function(t){var r=t.hostName,o=t.hostUUID,i=t.ipAddress,l=t.stateUUID;e[l]=pe({},n[l],{hostName:r,hostUUID:o,ipAddress:i})})),e}),{})}))},refreshInterval:i}).isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(q.TZ,{header:"Manage changed SSH keys",loading:M,children:[(0,r.jsxs)(S.Z,{spacing:".2em",children:[(0,r.jsx)(w.Ac,{children:"The identity of the following targets have unexpectedly changed."}),(0,r.jsxs)(K.Z,{type:"warning",isAllowClose:!0,children:["If you haven't rebuilt the listed targets, then you could be experiencing a"," ",(0,r.jsx)(se.Z,{href:t,sx:{display:"inline-flex"},target:"_blank",children:'"Man In The Middle"'})," ","attack. Please verify the targets have changed for a known reason before proceeding to remove the broken keys."]}),(0,r.jsx)(G.Z,{header:(0,r.jsxs)(S.Z,{row:!0,spacing:".3em",sx:{width:"100%","& > :not(:last-child)":{display:{xs:"none",sm:"flex"}},"& > :last-child":{display:{xs:"initial",sm:"none"},marginLeft:0}},children:[(0,r.jsxs)(S.Z,{row:!0,spacing:".3em",sx:{flexBasis:"calc(50% + 1em)"},children:[(0,r.jsx)(w.Ac,{children:"Host name"}),(0,r.jsx)(ae.Z,{sx:{flexGrow:1}})]}),(0,r.jsxs)(S.Z,{row:!0,spacing:".3em",sx:{flexGrow:1},children:[(0,r.jsx)(w.Ac,{children:"IP address"}),(0,r.jsx)(ae.Z,{sx:{flexGrow:1}})]}),(0,r.jsx)(ae.Z,{sx:{flexGrow:1}})]}),allowCheckAll:E,allowCheckItem:!0,allowDelete:!0,allowEdit:!1,disableDelete:!A,edit:!0,getListCheckboxProps:function(){return{checked:Z}},listEmpty:(0,r.jsx)(w.Ac,{align:"center",children:"No conflicting keys found."}),listItems:y,onAllCheckboxChange:function(e,n){C(n)},onDelete:function(){var e,n=P.reduce((function(e,n){if(!O(n))return e;var t=y[n].hostUUID;return e[t]||(e[t]=[]),e[t].push(n),e}),{});x({actionProceedText:"Delete",content:"Resolve ".concat(P.length," SSH key conflicts. Please make sure the identity change(s) are expected to avoid MITM attacks."),onProceedAppend:function(){p.Z.delete("/ssh-key/conflict",{data:n}).catch((function(e){var n=(0,k.Z)(e);n.children="Failed to delete selected SSH key conflicts. ".concat(n.children),h(n)}))},proceedColour:"red",titleText:"Delete ".concat(P.length," conflicting SSH keys?")}),null===(e=s.current.setOpen)||void 0===e||e.call(null,!0)},onItemCheckboxChange:function(e,n,t){I(e,t)},renderListItem:function(e,n){var t=n.hostName,o=n.ipAddress;return(0,r.jsxs)(S.Z,{spacing:0,sm:"row",sx:{width:"100%","& > *":{flexBasis:"50%"}},xs:"column",children:[(0,r.jsx)(w.Ac,{children:t}),(0,r.jsx)(w.Ac,{children:o})]})},renderListItemCheckboxState:function(e){return O(e)}})]}),T]}),(0,r.jsx)(a.Z,pe({closeOnProceed:!0},g,{ref:s}))]})};function ye(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function be(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){ye(e,n,t[n])}))}return e}var ve="common-user-input-confirm-password",ge="common-user-input-name",xe="common-user-input-password",je="Username",we="Password",Pe=function(e){var n=e.formUtils,t=n.buildFinishInputTestBatchFunction,o=n.buildInputFirstRenderFunction,i=n.setMessage,c=n.setValidity,a=e.previous,s=(void 0===a?{}:a).name,u=e.readOnlyUserName,d=e.requirePassword,p=void 0!==d&&d,h=e.showPasswordField,m=(0,l.useRef)({}),y=(0,l.useRef)({}),b=(0,l.useState)(p),v=b[0],g=b[1],x=(0,l.useMemo)((function(){return h?{"common-user-input-cell-password":{children:(0,r.jsx)(I.Z,{input:(0,r.jsx)(E.Z,{id:xe,label:we,type:f.Z.password}),inputTestBatch:(0,M.Gn)(we,(function(){i(xe)}),{onFinishBatch:t(xe)},(function(e){i(xe,{children:e})})),onBlurAppend:function(e){var n,t=e.target.value;g(t.length>0),c(ve,t===(null===(n=y.current.getValue)||void 0===n?void 0:n.call(null)))},onFirstRender:o(xe),ref:m,required:p})},"common-user-input-cell-confirm-password":{children:(0,r.jsx)(I.Z,{input:(0,r.jsx)(E.Z,{id:ve,inputProps:{readOnly:!v},label:"Confirm password",type:f.Z.password}),inputTestBatch:{defaults:{onSuccess:function(){i(ve)}},onFinishBatch:t(ve),tests:[{test:M.HJ},{onFailure:function(){i(ve,{children:"The passwords do not match."})},test:function(e){var n;return e.value===(null===(n=m.current.getValue)||void 0===n?void 0:n.call(null))}}]},onFirstRender:o(ve),ref:y,required:v})}}:void 0}),[t,o,v,p,i,c,h]);return(0,r.jsx)(A.Z,{columns:{xs:1,sm:2,md:3},layout:be({"common-user-input-cell-name":{children:(0,r.jsx)(I.Z,{input:(0,r.jsx)(E.Z,{id:ge,inputProps:{readOnly:u},label:je,value:s}),inputTestBatch:(0,M.Gn)(je,(function(){i(ge)}),{onFinishBatch:t(ge)},(function(e){i(ge,{children:e})})),onFirstRender:o(ge),required:!0}),md:1,sm:2}},x),spacing:"1em"})},Oe=t(2545),Ze=t(8610),Se=t(6632),Ae=t(8859);function ke(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function Ce(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ie(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){Ce(e,n,t[n])}))}return e}function Te(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],l=!0,c=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);l=!0);}catch(a){c=!0,o=a}finally{try{l||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||Me(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e){return function(e){if(Array.isArray(e))return ke(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Me(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Me(e,n){if(e){if("string"===typeof e)return ke(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ke(e,n):void 0}}var De=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=Te(n,1),o=r[0].target,i=o.elements,l=i.namedItem(ge),c=l.value,a=i.namedItem(xe),s="";a&&(s=a.value);return{password:s,userName:c}},Fe=function(){var e=(0,l.useRef)({}),n=(0,l.useRef)({}),t=(0,l.useRef)({}),o=(0,l.useRef)({}),i=Te((0,Se.Z)(),2),s=i[0],d=i[1],f=(0,l.useState)(!1),p=f[0],h=f[1],m=Te((0,F.Z)({children:"No users found."}),2),y=m[0],b=m[1],v=Te((0,F.Z)(void 0),2),g=v[0],x=v[1],j=(0,u.Z)("".concat(c.Z,"/user"),{onError:function(e){b((0,k.Z)(e))}}),P=j.data,O=j.isLoading,Z=(0,Ae.Z)([ve,ge,xe],o),S=Z.isFormInvalid,A=Z.isFormSubmitting,C=Z.submitForm,I=(0,ue.Z)({list:P}),E=I.buildDeleteDialogProps,M=I.checks,D=I.getCheck,B=I.hasChecks,W=I.setCheck,R=(0,l.useMemo)((function(){return null!==g&&void 0!==g?g:{}}),[g]),U=R.userName,N=R.userUUID,L=(0,l.useMemo)((function(){return{actionProceedText:"Add",content:(0,r.jsx)(Pe,{formUtils:Z,requirePassword:!0,showPasswordField:!0}),onSubmitAppend:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var i,l=De.apply(void 0,Ee(t));d({actionProceedText:"Add",content:(0,r.jsx)(Ze.Z,{entries:l,hasPassword:!0}),onProceedAppend:function(){C({body:l,getErrorMsg:function(e){return(0,r.jsxs)(r.Fragment,{children:["Add user failed. ",e]})},method:"post",successMsg:"Created user ".concat(l.userName,"."),url:"/user"})},titleText:"Add the following new user?"}),null===(i=n.current.setOpen)||void 0===i||i.call(null,!0)},titleText:"Add a web interface user"}}),[Z,d,C]),$=(0,l.useMemo)((function(){return{actionProceedText:"Edit",content:(0,r.jsx)(Pe,{formUtils:Z,previous:{name:U},readOnlyUserName:"admin"===U,showPasswordField:!0}),onSubmitAppend:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var i,l=De.apply(void 0,Ee(t));d({actionProceedText:"Update",content:(0,r.jsx)(Ze.Z,{entries:l,hasPassword:!0}),onProceedAppend:function(){C({body:l,getErrorMsg:function(e){return(0,r.jsxs)(r.Fragment,{children:["Update user failed. ",e]})},method:"put",successMsg:"Updated user ".concat(U),url:"/user/".concat(N)})},titleText:"Update user ".concat(U," with the following?")}),null===(i=n.current.setOpen)||void 0===i||i.call(null,!0)},titleText:"Edit user ".concat(U)}}),[Z,d,C,U,N]),_=(0,l.useMemo)((function(){return(0,r.jsx)(T.Z,{count:1,defaultMessageType:"warning",ref:o})}),[]),H=(0,l.useMemo)((function(){var e;return"admin"===(null===P||void 0===P||null===(e=P.current)||void 0===e?void 0:e.userName)}),[P]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(q.TZ,{header:"Manage users",loading:O,children:(0,r.jsx)(G.Z,{allowAddItem:H,allowDelete:H,allowEdit:!0,allowItemButton:p,disableDelete:!B,edit:p,getListItemCheckboxProps:function(e,n){return{disabled:"admin"===n.userName}},header:!0,listEmpty:(0,r.jsx)(K.Z,Ie({},y)),listItems:P,onAdd:function(){var n;null===(n=e.current.setOpen)||void 0===n||n.call(null,!0)},onDelete:function(){var e;d(E({confirmDialogProps:{onProceedAppend:function(){C({body:{uuids:M},getErrorMsg:function(e){return(0,r.jsxs)(r.Fragment,{children:["Delete user(s) failed. ",e]})},method:"delete",url:"/user"})}},formSummaryProps:{renderEntry:function(e){var n=e.key;return(0,r.jsx)(w.Ac,{children:null===P||void 0===P?void 0:P[n].userName})}},getConfirmDialogTitle:function(e){return"Delete the following ".concat(e," users?")}})),null===(e=n.current.setOpen)||void 0===e||e.call(null,!0)},onEdit:function(){return h((function(e){return!e}))},onItemCheckboxChange:function(e,n,t){return W(e,t)},onItemClick:function(e){var n;p&&(x(e),null===(n=t.current.setOpen)||void 0===n||n.call(null,!0))},renderListItemCheckboxState:function(e){return D(e)},renderListItem:function(e,n){var t=n.userName;return(0,r.jsx)(w.Ac,{children:t})}})}),(0,r.jsx)(Oe.Z,Ie({},L,{disableProceed:S,loadingAction:A,preActionArea:_,ref:e})),(0,r.jsx)(Oe.Z,Ie({},$,{disableProceed:S,loadingAction:A,preActionArea:_,ref:t})),(0,r.jsx)(a.Z,Ie({closeOnProceed:!0},s,{ref:n}))]})},Be=function(){return(0,r.jsxs)(q.s_,{children:[(0,r.jsx)(ce,{}),(0,r.jsx)(me,{}),(0,r.jsx)(Fe,{})]})},We=t(2852),Re=t(4825),Ue=t(2152);function Ne(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function Le(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function $e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){Le(e,n,t[n])}))}return e}function _e(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],l=!0,c=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);l=!0);}catch(a){c=!0,o=a}finally{try{l||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return Ne(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ne(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var He=function(e){return(0,r.jsx)(Re.Z,$e({},e,{sx:{width:"100%"}}))},Ve=function(e){var n=e.installTarget,t=void 0===n?"disabled":n,i=e.onSubmit,c=e.title,a=(0,D.Z)().protect,s=_e((0,F.Z)(void 0,a),2),u=s[0],d=s[1],f=(0,l.useMemo)((function(){return c?(0,r.jsx)(w.z,{sx:{textAlign:"center"},children:c}):(0,r.jsx)(Ue.Z,{mt:0})}),[c]),h=(0,l.useMemo)((function(){return u&&(0,r.jsx)(o.ZP,{item:!0,sm:2,xs:1,children:(0,r.jsx)(K.Z,$e({},u,{onClose:function(){d(void 0)}}))})}),[u,d]);return(0,r.jsxs)(q.s_,{children:[(0,r.jsx)(q.V9,{children:f}),(0,r.jsxs)(o.ZP,{columns:{xs:1,sm:2},container:!0,spacing:"1em",children:[(0,r.jsx)(o.ZP,{item:!0,sm:2,xs:1,children:(0,r.jsxs)(S.Z,{row:!0,children:[(0,r.jsx)(w.Ac,{sx:{flexGrow:1},children:"Install target"}),(0,r.jsx)(We.Z,{checked:"enabled"===t,edge:"end",onChange:function(e,n){var t="disable",o="Disable";n&&(t="enable",o="Enable"),null===i||void 0===i||i.call(null,{actionProceedText:o,content:(0,r.jsxs)(w.Ac,{children:["Would you like to ",t,' "Install target" on this striker? It\'ll take a few moments to complete.']}),onProceedAppend:function(){p.Z.put("/host/local",{isEnableInstallTarget:n},{params:{handler:"install-target"}}).catch((function(e){var n=(0,k.Z)(e);n.children="Failed to ".concat(t,' "Install target". ').concat(n.children),d(n)}))},titleText:"".concat(o,' "Install target" on ').concat(c,"?")})}})]})}),(0,r.jsx)(o.ZP,{item:!0,sm:2,xs:1,children:(0,r.jsx)(He,{onClick:function(){null===i||void 0===i||i.call(null,{actionProceedText:"Update",content:(0,r.jsx)(w.Ac,{children:"Would you like to update the operating system on this striker? It'll be placed into maintenance mode until the update completes."}),onProceedAppend:function(){p.Z.put("/command/update-system").catch((function(e){var n=(0,k.Z)(e);n.children="Failed to initiate system update. ".concat(n.children),d(n)}))},titleText:"Update operating system on ".concat(c,"?")})},children:"Update system"})}),(0,r.jsx)(o.ZP,{item:!0,sm:2,xs:1,children:(0,r.jsx)(He,{href:"/init?re=1",children:"Reconfigure striker"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(He,{onClick:function(){null===i||void 0===i||i.call(null,{actionProceedText:"Reboot",content:(0,r.jsx)(w.Ac,{children:"Would you like to reboot this striker?"}),onProceedAppend:function(){p.Z.put("/command/reboot-host").catch((function(e){var n=(0,k.Z)(e);n.children="Failed to initiate system reboot. ".concat(n.children),d(n)}))},titleText:"Reboot ".concat(c,"?")})},children:"Reboot"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(He,{onClick:function(){null===i||void 0===i||i.call(null,{actionProceedText:"Shutdown",content:(0,r.jsx)(w.Ac,{children:"Would you like to shutdown this striker?"}),onProceedAppend:function(){p.Z.put("/command/poweroff-host").catch((function(e){var n=(0,k.Z)(e);n.children="Failed to initiate system shutdown. ".concat(n.children),d(n)}))},titleText:"Shutdown ".concat(c,"?")})},children:"Shutdown"})}),h]})]})};function ze(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function Ge(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ke(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){Ge(e,n,t[n])}))}return e}function qe(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function Xe(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],l=!0,c=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);l=!0);}catch(a){c=!0,o=a}finally{try{l||null==t.return||t.return()}finally{if(c)throw o}}return i}}(e,n)||Je(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ye(e){return function(e){if(Array.isArray(e))return ze(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Je(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Je(e,n){if(e){if("string"===typeof e)return ze(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ze(e,n):void 0}}var Qe=function(e){var n=e.refreshInterval,t=void 0===n?6e4:n,d=(0,D.Z)().protect,f=(0,l.useState)(!1),p=f[0],h=f[1],m=(0,l.useState)({actionProceedText:"",closeOnProceed:!0,content:"",dialogProps:{open:p},onCancelAppend:function(){h(!1)},onProceedAppend:function(){h(!1)},titleText:""}),y=m[0],b=m[1],v=Xe((0,F.Z)(void 0,d),2),g=v[0],x=v[1],j=Xe((0,F.Z)("",d),2),w=j[0],P=j[1],O=(0,u.Z)("".concat(c.Z,"/host/local"),{onError:function(){P("Unknown")},onSuccess:function(e){var n=e.installTarget,t=e.shortHostName;x(n),P(t)},refreshInterval:t}),Z=O.data,S=O.isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{children:(0,r.jsx)("title",{children:S?"Loading...":"".concat(null===Z||void 0===Z?void 0:Z.shortHostName," Config")})}),(0,r.jsx)(s.Z,{}),(0,r.jsxs)(o.ZP,{container:!0,columns:{xs:1,md:3,lg:4},children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(Ve,{installTarget:g,onSubmit:function(e){var n=e.onProceedAppend,t=qe(e,["onProceedAppend"]);b((function(e){return Ke({},e,t,{onProceedAppend:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;null===n||void 0===n||(o=n).call.apply(o,[null].concat(Ye(t))),h(!1)}})})),h(!0)},title:w})}),(0,r.jsx)(o.ZP,{item:!0,md:2,xs:1,children:(0,r.jsx)(Be,{})})]}),(0,r.jsx)(a.Z,Ke({},y,{dialogProps:{open:p}}))]})}}},function(e){e.O(0,[382,483,894,644,62,780,899,903,774,888,179],(function(){return n=329,e(e.s=n);var n}));var n=e.O();_N_E=n}]);