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
51 KiB
1 lines
51 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}),Z=(0,h.ZP)(u.Z,{name:"MuiDialog",slot:"Root",overridesResolver:(e,n)=>n.root})({"@media print":{position:"absolute !important"}}),O=(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)(Z,(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)(O,{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,Z=e.dialogProps,O=void 0===Z?{}:Z,S=O.open,A=void 0!==S&&S,k=O.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);function l(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var c=(0,o.forwardRef)((function(e,n){var t=e.scrollContent,c=(0,o.useMemo)((function(){return t?".5em":void 0}),[t]);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){l(e,n,t[n])}))}return e}({dialogProps:{PaperProps:{sx:{minWidth:{xs:"90%",md:"50em"}}}},formContent:!0,scrollBoxProps:{paddingRight:c,paddingTop:".3em"}},e,{ref:n}))}));c.displayName="FormDialog",n.Z=c},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 Je}});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 Z(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 O=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,Z({},o,{control:(0,r.jsx)(j.Z,Z({},n,{checked:t,onChange:c})),label:a}))},S=t(4690),A=t(7504),k=t(1770),C=t(9099),I=t(7869),T=t(6284),E=t(7987),M=t(3144),D=t(2749);function F(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 B(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 F(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 F(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 W={dbPort:"dbPort",ipAddress:"ipAddress",password:"password",sshPort:"sshPort",user:"user"},R="DB port",U="IP address",N="Password",L="Ping",$="SSH port",_="User",H=(0,l.forwardRef)((function(e,n){var t=e.formGridColumns,o=void 0===t?2:t,i=(0,M.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),Z=P[0],F=P[1],H=B((0,D.Z)(!1,i),2),V=H[0],z=H[1],G=(0,l.useCallback)((function(e){return function(n){var t=n.isValid;j((0,g.ZP)(e,t))}}),[]),K=(0,l.useCallback)((function(e){return function(n){j((0,g.ZP)(e,n))}}),[]),q=(0,l.useCallback)((function(e){var n;null===(n=m.current.setMessage)||void 0===n||n.call(null,"api",e)}),[]),X=(0,l.useMemo)((function(){return Object.values(x).some((function(e){return!e}))}),[x]),Y=(0,l.useMemo)((function(){return b(W,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)(C.Z,{input:(0,r.jsx)(T.Z,{formControlProps:{sx:{minWidth:"4.6em",width:"25%"}},id:"add-peer-user-input",inputProps:{placeholder:"admin"},label:_}),inputTestBatch:(0,E.Gn)(_,(function(){Y.user()}),{onFinishBatch:K(W.user)},(function(e){Y.user({children:e})})),onFirstRender:G(W.user),ref:h}),(0,r.jsx)(w.Ac,{children:"@"}),(0,r.jsx)(C.Z,{input:(0,r.jsx)(T.Z,{id:"add-peer-ip-address-input",label:U}),inputTestBatch:(0,E._)(U,(function(){Y.ipAddress()}),{onFinishBatch:K(W.ipAddress)},(function(e){Y.ipAddress({children:e})})),onFirstRender:G(W.ipAddress),ref:s,required:!0})]})},"add-peer-password":{children:(0,r.jsx)(C.Z,{input:(0,r.jsx)(T.Z,{fillRow:!0,id:"add-peer-password-input",label:N,type:f.Z.password}),inputTestBatch:(0,E.Gn)(N,(function(){Y.password()}),{onFinishBatch:K(W.password)},(function(e){Y.password({children:e})})),onFirstRender:G(W.password),ref:u,required:!0})},"add-peer-db-and-ssh-port":{children:(0,r.jsxs)(S.Z,{row:!0,children:[(0,r.jsx)(C.Z,{input:(0,r.jsx)(T.Z,{id:"add-peer-db-port-input",inputProps:{placeholder:"5432"},label:R}),inputTestBatch:(0,v.Z)(R,(function(){Y.dbPort()}),{onFinishBatch:K(W.dbPort)},(function(e){Y.dbPort({children:e})})),onFirstRender:G(W.dbPort),ref:c}),(0,r.jsx)(C.Z,{input:(0,r.jsx)(T.Z,{id:"add-peer-ssh-port-input",inputProps:{placeholder:"22"},label:$}),inputTestBatch:(0,v.Z)($,(function(){Y.sshPort()}),{onFinishBatch:K(W.sshPort)},(function(e){Y.sshPort({children:e})})),onFirstRender:G(W.sshPort),ref:d})]})},"add-peer-is-ping":{children:(0,r.jsx)(O,{checked:Z,label:L,onChange:function(e,n){F(n)}}),sx:{display:"flex"}},"add-peer-message-group":{children:(0,r.jsx)(I.Z,{count:1,defaultMessageType:"warning",ref:m}),sm:o}},spacing:"1em"}),dialogProps:{PaperProps:{sx:{minWidth:"16em"}}},loadingAction:V,onActionAppend:function(){q()},onProceedAppend:function(){var e,n,t,r,o;z(!0),p.Z.post("/host/connection",{ipAddress:null===(e=s.current.getValue)||void 0===e?void 0:e.call(null),isPing:Z,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(){q({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),q(n)})).finally((function(){z(!1)}))},proceedButtonProps:{disabled:X},ref:n,titleText:"Add a peer"})}));H.displayName="AddPeerDialog";var V=H,z=t(6125),G=t(8187),K=t(3679),q=t(5537),X=t(2026),Y=t(7169),J={small:w.KI,medium:w.Ac},Q={size:"small",stateMap:new Map([[!1,(0,r.jsx)(q.Z,{sx:{color:Y.Wd}},"state-false")],[!0,(0,r.jsx)(X.Z,{sx:{color:Y.Ej}},"state-true")]])},ee=function(e){var n=e.label,t=e.size,o=void 0===t?Q.size:t,i=e.state,c=e.stateMap,a=(void 0===c?Q.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)(J[o],{},n)]})};ee.defaultProps=Q;var ne=ee;function te(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 re(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function oe(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){re(e,n,t[n])}))}return e}function ie(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 te(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 te(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 le=function(e){var n=e.refreshInterval,t=void 0===n?6e4:n,i=(0,M.Z)().protect,s=(0,l.useRef)({}),f=(0,l.useRef)({}),h=ie((0,D.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=ie((0,D.Z)({},i),2),j=x[0],P=x[1],Z=(0,l.useState)(!1),O=Z[0],A=Z[1],C=ie((0,D.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)(G.Z,oe({},m))})}),[m]),F=(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=ie(t,2),l=r[0],c=r[1],a=c.networkLinkNumber,s=c.networkNumber,u=c.networkType;return n[l]=oe({},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=ie(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]=oe({},e[u],{dbPort:a,dbUser:s,hostUUID:l,ipAddress:o,isPingTest:c}),n}),{})}))}}).isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(K.TZ,{header:"Configure striker peers",loading:F,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)(z.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)(z.Z,{header:"Peer connections",allowEdit:!0,edit:O,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=ie(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 oe({},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)(ne,{label:"Ping",state:o})]})})}})}),E]})}),(0,r.jsx)(V,{ref:s}),(0,r.jsx)(a.Z,oe({closeOnProceed:!0},v,{ref:f}))]})},ce=t(582),ae=t(5741),se=t(3906);function ue(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 de(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function fe(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){de(e,n,t[n])}))}return e}function pe(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 ue(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 ue(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){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=pe((0,D.Z)(void 0),2),f=d[0],h=d[1],m=pe((0,D.Z)({}),2),y=m[0],b=m[1],v=pe((0,D.Z)({actionProceedText:"",content:"",titleText:""}),2),g=v[0],x=v[1],j=(0,se.Z)({list:y}),P=j.checks,Z=j.getCheck,O=j.hasAllChecks,A=j.hasChecks,C=j.setAllChecks,I=j.setCheck,T=(0,l.useMemo)((function(){return f&&(0,r.jsx)(G.Z,fe({},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]=fe({},n[l],{hostName:r,hostUUID:o,ipAddress:i})})),e}),{})}))},refreshInterval:i}).isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(K.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)(G.Z,{type:"warning",isAllowClose:!0,children:["If you haven't rebuilt the listed targets, then you could be experiencing a"," ",(0,r.jsx)(ae.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)(z.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)(ce.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)(ce.Z,{sx:{flexGrow:1}})]}),(0,r.jsx)(ce.Z,{sx:{flexGrow:1}})]}),allowCheckAll:E,allowCheckItem:!0,allowDelete:!0,allowEdit:!1,disableDelete:!A,edit:!0,getListCheckboxProps:function(){return{checked:O}},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(!Z(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 Z(e)}})]}),T]}),(0,r.jsx)(a.Z,fe({closeOnProceed:!0},g,{ref:s}))]})};function me(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ye(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){me(e,n,t[n])}))}return e}var be="common-user-input-confirm-password",ve="common-user-input-name",ge="common-user-input-password",xe="Username",je="Password",we=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)(C.Z,{input:(0,r.jsx)(T.Z,{id:ge,label:je,type:f.Z.password}),inputTestBatch:(0,E.Gn)(je,(function(){i(ge)}),{onFinishBatch:t(ge)},(function(e){i(ge,{children:e})})),onBlurAppend:function(e){var n,t=e.target.value;g(t.length>0),c(be,t===(null===(n=y.current.getValue)||void 0===n?void 0:n.call(null)))},onFirstRender:o(ge),ref:m,required:p})},"common-user-input-cell-confirm-password":{children:(0,r.jsx)(C.Z,{input:(0,r.jsx)(T.Z,{id:be,inputProps:{readOnly:!v},label:"Confirm password",type:f.Z.password}),inputTestBatch:{defaults:{onSuccess:function(){i(be)}},onFinishBatch:t(be),tests:[{test:E.HJ},{onFailure:function(){i(be,{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(be),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:ye({"common-user-input-cell-name":{children:(0,r.jsx)(C.Z,{input:(0,r.jsx)(T.Z,{id:ve,inputProps:{readOnly:u},label:xe,value:s}),inputTestBatch:(0,E.Gn)(xe,(function(){i(ve)}),{onFinishBatch:t(ve)},(function(e){i(ve,{children:e})})),onFirstRender:o(ve),required:!0}),md:1,sm:2}},x),spacing:"1em"})},Pe=t(2545),Ze=t(8610),Oe=t(6632),Se=t(8859);function Ae(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 ke(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ce(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){ke(e,n,t[n])}))}return e}function Ie(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)||Ee(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 Te(e){return function(e){if(Array.isArray(e))return Ae(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ee(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 Ee(e,n){if(e){if("string"===typeof e)return Ae(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)?Ae(e,n):void 0}}var Me=function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r=Ie(n,1),o=r[0].target,i=o.elements,l=i.namedItem(ve),c=l.value,a=i.namedItem(ge),s="";a&&(s=a.value);return{password:s,userName:c}},De=function(){var e=(0,l.useRef)({}),n=(0,l.useRef)({}),t=(0,l.useRef)({}),o=(0,l.useRef)({}),i=Ie((0,Oe.Z)(),2),s=i[0],d=i[1],f=(0,l.useState)(!1),p=f[0],h=f[1],m=Ie((0,D.Z)({children:"No users found."}),2),y=m[0],b=m[1],v=Ie((0,D.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,Z=j.isLoading,O=(0,Se.Z)([be,ve,ge],o),S=O.isFormInvalid,A=O.isFormSubmitting,C=O.submitForm,T=(0,se.Z)({list:P}),E=T.buildDeleteDialogProps,M=T.checks,F=T.getCheck,B=T.hasChecks,W=T.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)(we,{formUtils:O,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=Me.apply(void 0,Te(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"}}),[O,d,C]),$=(0,l.useMemo)((function(){return{actionProceedText:"Edit",content:(0,r.jsx)(we,{formUtils:O,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=Me.apply(void 0,Te(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)}}),[O,d,C,U,N]),_=(0,l.useMemo)((function(){return(0,r.jsx)(I.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)(K.TZ,{header:"Manage users",loading:Z,children:(0,r.jsx)(z.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)(G.Z,Ce({},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 F(e)},renderListItem:function(e,n){var t=n.userName;return(0,r.jsx)(w.Ac,{children:t})}})}),(0,r.jsx)(Pe.Z,Ce({},L,{disableProceed:S,loadingAction:A,preActionArea:_,ref:e})),(0,r.jsx)(Pe.Z,Ce({},$,{disableProceed:S,loadingAction:A,preActionArea:_,ref:t})),(0,r.jsx)(a.Z,Ce({closeOnProceed:!0},s,{ref:n}))]})},Fe=function(){return(0,r.jsxs)(K.s_,{children:[(0,r.jsx)(le,{}),(0,r.jsx)(he,{}),(0,r.jsx)(De,{})]})},Be=t(2852),We=t(4825),Re=t(2152);function Ue(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 Ne(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Le(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){Ne(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 Ue(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 Ue(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 _e=function(e){return(0,r.jsx)(We.Z,Le({},e,{sx:{width:"100%"}}))},He=function(e){var n=e.installTarget,t=void 0===n?"disabled":n,i=e.onSubmit,c=e.title,a=(0,M.Z)().protect,s=$e((0,D.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)(Re.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)(G.Z,Le({},u,{onClose:function(){d(void 0)}}))})}),[u,d]);return(0,r.jsxs)(K.s_,{children:[(0,r.jsx)(K.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)(Be.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)(_e,{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)(_e,{href:"/init?re=1",children:"Reconfigure striker"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(_e,{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)(_e,{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 Ve(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 ze(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ge(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){ze(e,n,t[n])}))}return e}function Ke(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 qe(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)||Ye(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 Xe(e){return function(e){if(Array.isArray(e))return Ve(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ye(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 Ye(e,n){if(e){if("string"===typeof e)return Ve(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)?Ve(e,n):void 0}}var Je=function(e){var n=e.refreshInterval,t=void 0===n?6e4:n,d=(0,M.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=qe((0,D.Z)(void 0,d),2),g=v[0],x=v[1],j=qe((0,D.Z)("",d),2),w=j[0],P=j[1],Z=(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}),O=Z.data,S=Z.isLoading;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{children:(0,r.jsx)("title",{children:S?"Loading...":"".concat(null===O||void 0===O?void 0:O.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)(He,{installTarget:g,onSubmit:function(e){var n=e.onProceedAppend,t=Ke(e,["onProceedAppend"]);b((function(e){return Ge({},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(Xe(t))),h(!1)}})})),h(!0)},title:w})}),(0,r.jsx)(o.ZP,{item:!0,md:2,xs:1,children:(0,r.jsx)(Fe,{})})]}),(0,r.jsx)(a.Z,Ge({},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}]); |