Files
object-browser/portal-ui/build/static/js/main.2368c861.chunk.js
2021-04-06 00:38:11 -07:00

2 lines
421 KiB
JavaScript

(this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[]).push([[0],{441:function(e,t,n){},568:function(e,t,n){},569:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n(1),i=n.n(c),r=n(27),o=n.n(r),s=n(10),l=n(53),d=n(70),u=Object(d.a)(),b=n(3),j=n(2),m=n(178),p=n.n(m),h=n(303),O=n.n(h),g=n(622),f=n(666),x=n(621),v=n(106),y=n(623),C=n(624),S=n(356),k=n(665),w=n(612),N=n(13),T="USER_LOGGED",E="OPERATOR_MODE",_="MENU_OPEN",A="SERVER_NEEDS_RESTART",I="SERVER_IS_LOADING",M="SET_LOADING_PROGRESS",L="SET_SNACK_BAR_MESSAGE",D="SET_SERVER_DIAG_STAT",B="SET_ERROR_SNACK_MESSAGE",F="SET_SNACK_MODAL_MESSAGE",R="SET_MODAL_ERROR_MESSAGE";function P(e){return{type:T,logged:e}}function z(e){return{type:_,open:e}}function K(e){return{type:A,needsRestart:e}}var U,W=function(e){return{type:L,message:e}},q=function(e){return{type:B,message:e}},V=function(e){return{type:F,message:e}},G=function(e){return{type:R,message:e}},H=n(298),Y=n(299),Q=n(11),Z=n.n(Q),J=n(179),$=n.n(J),X=1073741824,ee=2147483648,te=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],ne=["Ki","Mi","Gi","Ti","Pi","Ei"],ae=["B"].concat(ne),ce=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,a=parseInt(e,10)||0;a>=1024&&++n;)a/=1024;var c=["B"].concat(ne);return a.toFixed(a<10&&n>0?1:0)+" "+(t?c[n]:te[n])},ie=function(){var e;$.a.removeItem("token"),e="token",document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"},re=function(e){var t=e.getHours()<10?"0".concat(e.getHours()):"".concat(e.getHours()),n=e.getMinutes()<10?"0".concat(e.getMinutes()):"".concat(e.getMinutes()),a=e.getSeconds()<10?"0".concat(e.getSeconds()):"".concat(e.getSeconds());return"".concat(t,":").concat(n,":").concat(a,":").concat(e.getMilliseconds())},oe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=parseFloat(e),c=n?ae:te,i=c.findIndex((function(e){return e===t}));if(-1===i)return"0";var r=Math.pow(1024,i),o=a*r;return o.toString(10)},se=function(e,t,n,a){var c=parseInt(e,10);return le(t,c,274877906944,n,a)},le=function(e,t,n,a){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(isNaN(e)||isNaN(t)||isNaN(n)||isNaN(a))return{error:"Some provided data is invalid, please try again.",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0};var i=0,r=0,o=0;if(0===c&&(o=(r=t/(i=Math.floor(Math.min(t/Math.max(4,e),n))))/e),c&&(r=(o=c)*e,i=Math.floor(t/r)),o%1>0){r=(o=Math.ceil(o))*e;var s=(i=Math.floor(t/r))*o*e;if(s>a)return{error:"We were not able to allocate this server.",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0}}return i<X?{error:"Disk Size with this combination would be less than 1Gi, please try another combination",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0}:{error:"",nodes:e,persistentVolumes:r,disks:o,pvSize:i}},de=function(e){var t=e.length;return"pool-".concat(t)},ue=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Date(1e3*parseInt(e));return t?"".concat(n.getFullYear(),"-").concat(String(n.getMonth()+1).padStart(2,"0"),"-").concat(String(n.getDay()).padStart(2,"0")," ").concat(n.getHours(),":").concat(String(n.getMinutes()).padStart(2,"0"),":").concat(String(n.getSeconds()).padStart(2,"0")):"".concat(n.getHours(),":").concat(String(n.getMinutes()).padStart(2,"0"))},be=function(e){var t=1e-9*e,n=Math.round(1e4*(t+Number.EPSILON))/1e4;return"".concat(n," s")},je=function(e){var t=(100*e.split("").reduce((function(e,t){return e+t.charCodeAt(0)+((e<<5)-e)}),0)&16777215).toString(16).toUpperCase();return"#".concat(t.padStart(6,"0"))},me=new(function(){function e(){Object(H.a)(this,e)}return Object(Y.a)(e,[{key:"invoke",value:function(e,t,n){var a=this;return p()(e,t).send(n).then((function(e){return e.body})).catch((function(e){return 401===e.status?(ie(),void(window.location.href="/login")):a.onError(e)}))}},{key:"onError",value:function(e){if(e.status){var t=Z()(e.response,"body.message",e.status.toString()),n=t.charAt(0).toUpperCase()+t.slice(1);return Promise.reject(n)}ie(),window.location.href="/login"}}]),e}());!function(e){e.unknown="unknown",e.form="form",e.redirect="redirect",e.serviceAccount="service-account"}(U||(U={}));var pe=Object(w.a)((function(e){return Object(k.a)({disabled:{"&.MuiInput-underline::before":{borderColor:"#eaeaea",borderBottomStyle:"solid"}}})}));function he(e){var t=pe();return Object(a.jsx)(f.a,Object(j.a)({InputProps:{classes:t}},e))}var Oe=Object(s.b)((function(e){return{loggedIn:e.loggedIn}}),{userLoggedIn:P})(Object(N.a)((function(e){return Object(k.a)({"@global":{body:{backgroundColor:"#FAFAFA"}},paper:{borderRadius:8,display:"flex",flexDirection:"column",alignItems:"center",width:800,height:424,margin:"auto",position:"absolute",top:"50%",left:"50%",marginLeft:-400,marginTop:-212,"&.MuiPaper-root":{borderRadius:8}},avatar:{margin:e.spacing(1),backgroundColor:e.palette.secondary.main},form:{width:"100%"},submit:{margin:"30px 0px 16px",height:40,boxShadow:"none",padding:"16px 30px"},errorBlock:{backgroundColor:"#C72C48",width:800,height:64,display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:"50%",top:"50%",marginLeft:-400,marginTop:-290,color:"#fff",fontWeight:700,fontSize:14,borderRadius:8,padding:10,boxSizing:"border-box"},mainContainer:{position:"relative",height:424},theOcean:{borderTopLeftRadius:8,borderBottomLeftRadius:8,background:"transparent linear-gradient(to bottom, #073052 0%,#05122b 100%); 0% 0% no-repeat padding-box;"},oceanBg:{backgroundImage:"url(/images/BG_Illustration.svg)",backgroundRepeat:"no-repeat",backgroundPosition:"bottom left",height:"100%",width:324},theLogin:{padding:"40px 45px 20px 45px"},loadingLoginStrategy:{textAlign:"center"},headerTitle:{marginBottom:10},submitContainer:{textAlign:"right"},disclaimer:{fontSize:12,marginTop:30},jwtInput:{marginTop:45},linearPredef:{height:10},errorIconStyle:{marginRight:3}})}))((function(e){var t=e.classes,n=e.userLoggedIn,r=Object(c.useState)(""),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(""),j=Object(b.a)(d,2),m=j[0],h=j[1],f=Object(c.useState)(""),k=Object(b.a)(f,2),w=k[0],N=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)({loginStrategy:U.unknown,redirect:""}),M=Object(b.a)(I,2),L=M[0],D=M[1],B=Object(c.useState)(!1),F=Object(b.a)(B,2),R=F[0],P=F[1],z={form:"/api/v1/login","service-account":"/api/v1/login/operator"},K={form:{accessKey:s,secretKey:w},"service-account":{jwt:m}},W=function(e){e.preventDefault(),P(!0),p.a.post(z[L.loginStrategy]||"/api/v1/login").send(K[L.loginStrategy]).then((function(e){var t=e.body;if(t.error)throw P(!1),t.error})).then((function(){n(!0),L.loginStrategy===U.form&&localStorage.setItem("userLoggedIn",btoa(s)),u.push("/")})).catch((function(e){P(!1),A(e.message)}))};Object(c.useEffect)((function(){me.invoke("GET","/api/v1/login").then((function(e){D(e),A(""),"redirect"===e.loginStrategy&&e.redirect})).catch((function(e){A(e)}))}),[]);var q=null;switch(L.loginStrategy){case U.form:q=Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(v.a,{component:"h1",variant:"h6",className:t.headerTitle,children:"Console Login"}),Object(a.jsxs)("form",{className:t.form,noValidate:!0,onSubmit:W,children:[Object(a.jsxs)(x.a,{container:!0,spacing:2,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(he,{fullWidth:!0,id:"accessKey",value:s,onChange:function(e){return l(e.target.value)},label:"Enter Access Key",name:"accessKey",autoComplete:"username",disabled:R})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(he,{fullWidth:!0,value:w,onChange:function(e){return N(e.target.value)},name:"secretKey",label:"Enter Secret Key",type:"password",id:"secretKey",autoComplete:"current-password",disabled:R})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.submitContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",className:t.submit,disabled:""===w||""===s||R,children:"Login"})}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.linearPredef,children:R&&Object(a.jsx)(y.a,{})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.disclaimer,children:[Object(a.jsx)("strong",{children:"Don't have an access key?"}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),"Contact your administrator to have one made"]})]})]});break;case U.redirect:q=Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(v.a,{component:"h1",variant:"h6",className:t.headerTitle,children:"Welcome"}),Object(a.jsx)(g.a,{component:"a",href:L.redirect.replace("%5BHOSTNAME%5D",window.location.hostname),type:"submit",variant:"contained",color:"primary",className:t.submit,children:"Login with SSO"})]});break;case U.serviceAccount:q=Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(v.a,{component:"h1",variant:"h6",className:t.headerTitle,children:"Operator Login"}),Object(a.jsxs)("form",{className:t.form,noValidate:!0,onSubmit:W,children:[Object(a.jsx)(x.a,{container:!0,spacing:2,children:Object(a.jsx)(x.a,{item:!0,xs:12,className:t.jwtInput,children:Object(a.jsx)(he,{required:!0,fullWidth:!0,id:"jwt",value:m,onChange:function(e){return h(e.target.value)},label:"JWT",name:"jwt",autoComplete:"off",disabled:R})})}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.submitContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",className:t.submit,disabled:""===m||R,children:"Login"})}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.linearPredef,children:R&&Object(a.jsx)(y.a,{})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.disclaimer,children:[Object(a.jsx)("strong",{children:"Don't have an access key?"}),Object(a.jsx)("br",{}),"Contact your administrator to have one made"]})]})]});break;default:q=Object(a.jsx)(C.a,{className:t.loadingLoginStrategy})}return Object(a.jsxs)(i.a.Fragment,{children:[""!==_&&Object(a.jsxs)("div",{className:t.errorBlock,children:[Object(a.jsx)(O.a,{fontSize:"small",className:t.errorIconStyle})," ",_]}),Object(a.jsx)(S.a,{className:t.paper,children:Object(a.jsxs)(x.a,{container:!0,className:t.mainContainer,children:[Object(a.jsx)(x.a,{item:!0,xs:7,className:t.theOcean,children:Object(a.jsx)("div",{className:t.oceanBg})}),Object(a.jsx)(x.a,{item:!0,xs:5,className:t.theLogin,children:q})]})})]})}))),ge=n(37),fe=n(5),xe=n(627),ve=n(672),ye=n(626),Ce=n(664),Se={inputLabel:{fontWeight:600,marginRight:10,fontSize:15,color:"#000",textAlign:"left",overflow:"hidden","& span":{display:"flex",alignItems:"center"},display:"flex"},fieldLabelError:{paddingBottom:22},fieldContainer:{marginBottom:20,position:"relative",maxWidth:840,margin:"0px auto"},tooltipContainer:{marginLeft:5,display:"flex",alignItems:"center"},switchContainer:{display:"flex",maxWidth:840}},ke={formScrollable:{maxHeight:"calc(100vh - 300px)",overflowY:"auto",marginBottom:25},formSlider:{marginLeft:0},clearButton:{fontFamily:"Lato, sans-serif",border:"0",backgroundColor:"transparent",color:"#393939",fontWeight:600,fontSize:14,marginRight:10,outline:"0",padding:"16px 25px 16px 25px",cursor:"pointer"},floatingEnabled:{position:"absolute",right:58,zIndex:1e3,marginTop:-38},configureString:{border:"#EAEAEA 1px solid",borderRadius:4,padding:"24px 50px",overflowY:"auto",height:170,maxWidth:840,margin:"0 auto"}},we={tooltip:{fontSize:16}},Ne={width:14,height:14,borderRadius:2},Te={unCheckedIcon:Object(j.a)(Object(j.a)({},Ne),{},{border:"1px solid #c3c3c3"}),checkedIcon:Object(j.a)(Object(j.a)({},Ne),{},{border:"1px solid #081C42",backgroundColor:"#081C42"})},Ee={width:12,height:12,borderRadius:"100%","input:disabled ~ &":{border:"1px solid #9C9C9C"}},_e={radioUnselectedIcon:Object(j.a)(Object(j.a)({},Ee),{},{border:"1px solid #000"}),radioSelectedIcon:Object(j.a)(Object(j.a)({},Ee),{},{border:"1px solid #000",backgroundColor:"#000"})},Ae={label:{color:"#393939",fontWeight:600,fontSize:13,alignSelf:"center",whiteSpace:"nowrap","&:not(:first-of-type)":{marginLeft:10}},timeContainers:{height:40},actionsTray:{display:"flex",justifyContent:"space-between","& button":{flexGrow:0,marginLeft:15}}},Ie={searchField:{flexGrow:1,height:40,background:"#FFFFFF",borderRadius:5,border:"#EAEDEE 1px solid",display:"flex",justifyContent:"center",padding:"0 16px","& input":{fontSize:12,fontWeight:700,color:"#000","&::placeholder":{color:"#393939",opacity:1}},"&:hover":{borderColor:"#000"}}},Me={prefinedContainer:{maxWidth:840,width:"100%",margin:"0 auto"},predefinedTitle:{fontSize:16,fontWeight:600,color:"#000",margin:"10px 0"},predefinedList:{backgroundColor:"#eaeaea",padding:"12px 10px",color:"#393939",fontSize:12,fontWeight:600,minHeight:41},innerContent:{width:"100%",overflowX:"auto",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},innerContentMultiline:{width:"100%",maxHeight:100,overflowY:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},Le={obTitleSection:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:20},sectionTitle:{fontSize:22,color:"#000",fontWeight:600,height:40,lineHeight:"40px"},breadcrumbs:{fontSize:10,color:"#000",marginTop:2,"& a":{textDecoration:"none",color:"#000","&:hover":{textDecoration:"underline"}}}},De={multiSelectTable:{height:200}},Be={customTitle:{fontSize:18,color:"#000",fontWeight:600,padding:"12px 0",borderBottom:"#eaedee 1px solid",marginBottom:10,margin:"15px 38px 27px"},settingsFormContainer:{height:"calc(100vh - 421px)",padding:"15px 38px",overflowY:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},settingsButtonContainer:{borderTop:"1px solid #EAEAEA",padding:"15px 38px",textAlign:"right"},settingsOptionsContainer:{height:"calc(100vh - 244px)",backgroundColor:"#fff",border:"#EAEDEE 1px solid",borderRadius:3,marginTop:15},backButton:{cursor:"pointer",fontSize:10,fontWeight:600,color:"#000",backgroundColor:"transparent",border:0,padding:0,display:"flex",alignItems:"center","&:active, &:focus":{outline:0},"& svg":{width:10,marginRight:4}},backContainer:{margin:"20px 38px 0"}},Fe={logsSubContainer:{height:"calc(100vh - 230px)",padding:"15px 0"}},Re={singleValueContainer:{position:"relative",flexGrow:1,width:"100%",height:"100%",border:"#EAEAEA 1px solid",borderRadius:5,backgroundColor:"#fff"},titleContainer:{color:"#393939",fontWeight:600,height:15,textAlign:"center",fontSize:10},contentContainer:{flexGrow:2,justifyContent:"center",alignItems:"center",display:"flex",position:"absolute",width:"100%",height:"calc(100% - 15px)"},contentContainerWithLabel:{height:"calc(100% - 25px)"},legendBlock:{position:"absolute",bottom:5,display:"flex",width:"100%",height:15,flexWrap:"wrap",overflowY:"auto"},singleLegendContainer:{display:"flex",alignItems:"center",padding:"0 10px",maxWidth:"100%"},colorContainer:{width:8,height:8,minWidth:8,borderRadius:"100%",marginRight:5},legendLabel:{fontSize:"80%",color:"#393939",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},Pe={customTooltip:{backgroundColor:"rgba(255, 255, 255, 0.90)",border:"#eaeaea 1px solid",borderRadius:3,padding:"5px 10px",maxHeight:300,overflowY:"auto"},labelContainer:{display:"flex",alignItems:"center"},labelColor:{width:6,height:6,display:"block",borderRadius:"100%",marginRight:5},itemValue:{fontSize:"75%",color:"#393939"},valueContainer:{fontWeight:600},timeStampTitle:{fontSize:"80%",color:"#9c9c9c",textAlign:"center",marginBottom:6}},ze={snackBar:{backgroundColor:"#081F44",fontWeight:400,fontFamily:"Lato, sans-serif",fontSize:14,padding:"0px 20px 0px 20px;",boxShadow:"none","&.MuiPaper-root.MuiSnackbarContent-root":{borderRadius:"0px 0px 5px 5px"},"& div":{textAlign:"center",padding:"6px 30px",width:"100%",overflowX:"hidden",textOverflow:"ellipsis"}},errorSnackBar:{backgroundColor:"#C72C48",color:"#fff"},snackBarExternal:{top:"-17px",position:"absolute",minWidth:"348px",whiteSpace:"nowrap",height:"33px"},snackDiv:{top:"17px",left:"50%",position:"absolute"},snackBarModal:{top:0,position:"absolute",minWidth:"348px",whiteSpace:"nowrap",height:"33px",maxWidth:"calc(100% - 140px)"}},Ke={multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8,alignSelf:"flex-start"},headerElement:{position:"sticky",top:0,paddingTop:5,marginBottom:10,zIndex:500,backgroundColor:"#fff"},tableTitle:{fontWeight:700,width:"30%"},poolError:{color:"#dc1f2e",fontSize:"0.75rem",paddingLeft:120},error:{color:"#dc1f2e",fontSize:"0.75rem"},h3Section:{marginTop:0},descriptionText:{fontSize:13,color:"#777777"},container:{padding:"77px 0 0 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}},Ue=n(656),We=n(625);function qe(){return Object(a.jsxs)(v.a,{variant:"body2",color:"textSecondary",align:"center",children:["Copyright \xa9 ",Object(a.jsx)(We.a,{color:"inherit",href:"https://material-ui.com/",children:"MinIO"})," ",(new Date).getFullYear(),"."]})}var Ve=Object(w.a)((function(e){return{"@global":{body:{backgroundColor:e.palette.common.white}},paper:{marginTop:e.spacing(8),display:"flex",flexDirection:"column",alignItems:"center"}}})),Ge=function(){var e=Ve();return Object(a.jsxs)(ye.a,{component:"main",children:[Object(a.jsx)(xe.a,{}),Object(a.jsx)("div",{className:e.paper,children:Object(a.jsx)(v.a,{variant:"h1",component:"h1",children:"404 Not Found"})}),Object(a.jsx)(Ue.a,{mt:5,children:Object(a.jsx)(qe,{})})]})},He=n(22),Ye=n(636),Qe=n(41),Ze=n.n(Qe),Je=n(311),$e=n.n(Je),Xe=n(88),et=n.n(Xe),tt=n(355),nt=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",children:[Object(a.jsx)("title",{children:"ic_h_copy-new_sl"}),Object(a.jsx)("g",{id:"Layer_2","data-name":"Layer 2",children:Object(a.jsx)("g",{id:"Layer_1-2","data-name":"Layer 1",children:Object(a.jsx)("path",{className:"cls-1",d:"M0,0V16H16V0ZM11.886,9.048H9.048v2.838h-2.1V9.048H4.114v-2.1H6.952V4.114h2.1V6.952h2.838Z"})})})]})})},at=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",children:Object(a.jsxs)("g",{id:"Group_55","data-name":"Group 55",transform:"translate(1002 -2555)",children:[Object(a.jsx)("rect",{id:"Rectangle_29",width:"2",height:"12",transform:"translate(-997 2555)",fill:"#fff"}),Object(a.jsx)("rect",{id:"Rectangle_30",width:"2",height:"12",transform:"translate(-990 2560) rotate(90)",fill:"#fff"})]})})})},ct=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10.402 13",children:Object(a.jsx)("path",{d:"M6.761 1V0H3.64v1H.004v1h10.4V1zM.004 2.998l1.672 10h7.052l1.673-10zm3.412 8.243l-.552-6.478h.653l.553 6.472zm3.569 0h-.653l.551-6.472h.654z",className:"a"})})})},it=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(a.jsxs)("g",{transform:"translate(249 720)",children:[Object(a.jsx)("rect",{width:"6",height:"5",transform:"translate(-244 -720) rotate(90)"}),Object(a.jsx)("rect",{width:"4",height:"4",transform:"translate(-243 -720)"}),Object(a.jsx)("rect",{width:"5",height:"4",transform:"translate(-239 -715) rotate(90)"}),Object(a.jsx)("rect",{width:"5",height:"3",transform:"translate(-244 -710) rotate(180)"})]})})})},rt=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(a.jsx)("path",{d:"M8.392,10H1.608L0,0H10Z"})})})},ot=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6.131 10",children:Object(a.jsx)("g",{transform:"translate(193 719.787)",children:Object(a.jsxs)("g",{transform:"translate(-193 -719.787)",children:[Object(a.jsx)("path",{d:"M3,0h.131a3,3,0,0,1,3,3V5a0,0,0,0,1,0,0H0A0,0,0,0,1,0,5V3A3,3,0,0,1,3,0Z",transform:"translate(0 5)"}),Object(a.jsx)("ellipse",{cx:"2.065",cy:"2",rx:"2.065",ry:"2",transform:"translate(1 0)"})]})})})})},st=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 9.5",children:Object(a.jsxs)("g",{transform:"translate(231 719.516)",children:[Object(a.jsx)("path",{d:"M-125.5,7.984a4.5,4.5,0,0,1,4.5-4.5,4.5,4.5,0,0,1,4.5,4.5Z",transform:"translate(-105 -720)"}),Object(a.jsx)("rect",{width:"10",height:"1",transform:"translate(-231 -711.016)"}),Object(a.jsx)("path",{d:"M-119.5.484h-3v1h1v1h1v-1h1Z",transform:"translate(-105 -720)"})]})})})},lt=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 9.787",children:Object(a.jsx)("g",{transform:"translate(177 719.787)",children:Object(a.jsxs)("g",{transform:"translate(-105 -720)",children:[Object(a.jsx)("path",{d:"M-65,5a3,3,0,0,0-1.131.224A3.981,3.981,0,0,1-65,8v2h3V8A3,3,0,0,0-65,5Z"}),Object(a.jsx)("path",{d:"M-72,10h6V8a3,3,0,0,0-3-3,3,3,0,0,0-3,3Z"}),Object(a.jsx)("path",{className:"a",d:"M-65,.213a1.993,1.993,0,0,0-1.384.561A2.967,2.967,0,0,1-66,2.213a2.964,2.964,0,0,1-.384,1.439A1.989,1.989,0,0,0-65,4.213a2,2,0,0,0,2-2A2,2,0,0,0-65,.213Z"}),Object(a.jsx)("circle",{cx:"2",cy:"2",r:"2",transform:"translate(-71 0.213)"})]})})})})},dt=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 8.75 10",children:Object(a.jsx)("path",{d:"M-44.625,10l-4.353-2.419L-53.375,10V0h8.75Z",transform:"translate(53.375)"})})})},ut=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 9.998 10",children:Object(a.jsx)("g",{transform:"translate(140.999 720)",children:Object(a.jsxs)("g",{transform:"translate(-105 -720)",children:[Object(a.jsx)("rect",{width:"1.114",height:"1.667",transform:"translate(-27.116 8.333)"}),Object(a.jsx)("path",{d:"M-28.184,10H-29.3V8.154l2.182-3.037V3.147H-26V5.476l-2.182,3.037Z"}),Object(a.jsx)("rect",{width:"1.114",height:"2.963",transform:"translate(-31.531)"}),Object(a.jsx)("rect",{width:"1.114",height:"2.132",transform:"translate(-27.115 0)"}),Object(a.jsx)("rect",{width:"1.114",height:"5.389",transform:"translate(-29.298)"}),Object(a.jsx)("path",{d:"M-30.417,10h-1.114V5.722l-2.233-3V0h1.114V2.353l2.233,3Z"}),Object(a.jsx)("path",{d:"M-32.65,10h-1.114V6.185l-2.234-3V0h1.114V2.815l2.234,3Z"}),Object(a.jsx)("rect",{width:"1.114",height:"4.463",transform:"translate(-35.999 5.537)"})]})})})})},bt=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:[Object(a.jsx)("rect",{width:"1.433",height:"1"}),Object(a.jsx)("rect",{width:"7.828",height:"1",transform:"translate(2.172)"}),Object(a.jsx)("rect",{width:"1.433",height:"1",transform:"translate(0 6)"}),Object(a.jsx)("rect",{width:"1.433",height:"1",transform:"translate(0 3)"}),Object(a.jsx)("rect",{width:"1.433",height:"1",transform:"translate(0 9)"}),Object(a.jsx)("rect",{width:"1.368",height:"0.569",transform:"translate(6.316 9)"}),Object(a.jsx)("path",{d:"M5.566,9.569v-.31l-.238-.138-.269.155-.65.375L4.034,9V9H2.172v1H5.566Z"}),Object(a.jsx)("path",{d:"M9.966,9l-.375.65-.65-.375-.269-.155-.238.138V10H10V9H9.967Z"}),Object(a.jsx)("path",{d:"M3.625,6.793l.269-.155V6.362l-.269-.155L3.266,6H2.172V7H3.266Z"}),Object(a.jsx)("path",{d:"M8.434,3.431v.31l.238.138.269-.155.649-.375L9.966,4V4H10V3H8.434Z"}),Object(a.jsx)("path",{d:"M4.034,4l.375-.65.65.375.269.155.238-.138V3H2.172V4H4.033Z"}),Object(a.jsx)("path",{d:"M9.356,5.929,10,5.558,9.316,4.373l-.644.372-.988-.571V3.431H6.316v.743l-.988.571-.644-.372L4,5.558l.644.371V7.071L4,7.442l.684,1.185.644-.372.988.571v.743H7.684V8.826l.988-.571.644.372L10,7.442l-.644-.371ZM7,7.278A.778.778,0,1,1,7.778,6.5.779.779,0,0,1,7,7.278Z"})]})})},jt=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 9",children:Object(a.jsxs)("g",{transform:"translate(79 438.479)",children:[Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("rect",{x:"-77.9",y:"-434.5",width:"7.8",height:"1"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("rect",{x:"-77.9",y:"-434.5",transform:"matrix(0.4999 -0.8661 0.8661 0.4999 338.8698 -281.1237)",width:"7.8",height:"1"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("rect",{x:"-74.5",y:"-437.9",transform:"matrix(0.866 -0.5001 0.5001 0.866 207.1129 -95.1668)",width:"1",height:"7.8"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("path",{d:"M-71.8-430.1h-4.5l-2.2-3.9l2.2-3.9h4.5l2.2,3.9L-71.8-430.1z M-75.7-431.1h3.3l1.7-2.9l-1.7-2.9h-3.3 l-1.7,2.9L-75.7-431.1z"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("path",{d:"M-72.3-434c0,0.9-0.7,1.7-1.7,1.7c-0.9,0-1.7-0.7-1.7-1.7c0-0.9,0.7-1.7,1.7-1.7 C-73.1-435.7-72.3-434.9-72.3-434z"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("path",{d:"M-76.8-434c0,0.6-0.5,1.1-1.1,1.1c0,0,0,0,0,0c-0.6,0-1.1-0.5-1.1-1.1c0,0,0,0,0,0c0-0.6,0.5-1.1,1.1-1.1 c0,0,0,0,0,0C-77.3-435.1-76.8-434.6-76.8-434C-76.8-434-76.8-434-76.8-434z"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("path",{d:"M-69-434c0,0.6-0.5,1.1-1.1,1.1c0,0,0,0,0,0c-0.6,0-1.1-0.5-1.1-1.1c0,0,0,0,0,0c0-0.6,0.5-1.1,1.1-1.1 c0,0,0,0,0,0C-69.5-435.1-69-434.6-69-434C-69-434-69-434-69-434z"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("path",{d:"M-75.4-431.6c0.5,0.3,0.7,1,0.4,1.5c-0.3,0.5-1,0.7-1.5,0.4c0,0,0,0,0,0c-0.5-0.3-0.7-1-0.4-1.5 C-76.6-431.7-75.9-431.9-75.4-431.6C-75.4-431.6-75.4-431.6-75.4-431.6z"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("path",{d:"M-71.5-438.3c0.5,0.3,0.7,1,0.4,1.5c-0.3,0.5-1,0.7-1.5,0.4c0,0,0,0,0,0c-0.5-0.3-0.7-1-0.4-1.5 C-72.7-438.5-72-438.6-71.5-438.3C-71.5-438.3-71.5-438.3-71.5-438.3z"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("path",{d:"M-72.6-431.6c0.5-0.3,1.2-0.1,1.5,0.4c0,0,0,0,0,0c0.3,0.5,0.1,1.2-0.4,1.5c-0.5,0.3-1.2,0.1-1.5-0.4 c0,0,0,0,0,0C-73.3-430.6-73.1-431.3-72.6-431.6z"})})}),Object(a.jsx)("g",{children:Object(a.jsx)("g",{children:Object(a.jsx)("path",{d:"M-76.5-438.3c0.5-0.3,1.2-0.1,1.5,0.4c0,0,0,0,0,0c0.3,0.5,0.1,1.2-0.4,1.5c-0.5,0.3-1.2,0.1-1.5-0.4 c0,0,0,0,0,0C-77.2-437.3-77-438-76.5-438.3z"})})})]})})})},mt=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(a.jsxs)("g",{transform:"translate(61 439)",children:[Object(a.jsx)("rect",{width:"1.5",height:"10",transform:"translate(-56.75 -439)"}),Object(a.jsx)("path",{d:"M6.5,10V0h.572L10,10Z",transform:"translate(-61 -439)"}),Object(a.jsx)("path",{d:"M3.5,10V0H2.928L0,10Z",transform:"translate(-61 -439)"})]})})})},pt=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(a.jsxs)("g",{transform:"translate(43 439)",children:[Object(a.jsx)("path",{d:"M27.5,10",transform:"translate(-61 -439)"}),Object(a.jsx)("rect",{width:"1.5",height:"2",transform:"translate(-43 -431)"}),Object(a.jsx)("rect",{width:"1.5",height:"6",transform:"translate(-38.75 -435)"}),Object(a.jsx)("rect",{width:"1.5",height:"8",transform:"translate(-36.625 -437)"}),Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-40.875 -433)"}),Object(a.jsx)("rect",{width:"1.5",height:"10",transform:"translate(-34.5 -439)"}),Object(a.jsx)("path",{d:"M18.5,10",transform:"translate(-61 -439)"})]})})})},ht=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(a.jsx)("g",{transform:"translate(213 720)",children:Object(a.jsxs)("g",{transform:"translate(-105 -720)",children:[Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-108)"}),Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-108 6)"}),Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-99.5 6)"}),Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-99.5)"}),Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-98) rotate(90)"}),Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-104) rotate(90)"}),Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-104 8.5) rotate(90)"}),Object(a.jsx)("rect",{width:"1.5",height:"4",transform:"translate(-98 8.5) rotate(90)"}),Object(a.jsx)("circle",{cx:"2",cy:"2",r:"2",transform:"translate(-105 3)"})]})})})})},Ot="ADD_BUCKET_OPEN",gt="ADD_BUCKET_NAME",ft="ADD_BUCKET_VERSIONED",xt="ADD_BUCKET_LOCKING",vt="ADD_BUCKET_QUOTA",yt="ADD_BUCKET_QUOTA_TYPE",Ct="ADD_BUCKET_QUOTA_SIZE",St="ADD_BUCKET_QUOTA_UNIT",kt="ADD_BUCKET_RESET",wt="ADD_BUCKET_RETENTION",Nt="ADD_BUCKET_RETENTION_MODE",Tt="ADD_BUCKET_RETENTION_UNIT",Et="ADD_BUCKET_RETENTION_VALIDITY";var _t=n(63),At=n.n(_t),It=n(572),Mt=n(618),Lt=n(662),Dt=n(85),Bt=n(308),Ft=n.n(Bt),Rt=n(187),Pt=n.n(Rt),zt=n(307),Kt=n.n(zt),Ut="#081C42",Wt="#081C42",qt=function(e){var t=e.active,n=void 0!==t&&t;return Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 11.856",children:Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M-54,8l1.764,2.614A7.52,7.52,0,0,0-46,13.928h0a7.52,7.52,0,0,0,6.234-3.314L-38,8l-1.764-2.614A7.52,7.52,0,0,0-46,2.072h0a7.52,7.52,0,0,0-6.234,3.314Zm10.286,0A2.285,2.285,0,0,1-46,10.286,2.285,2.285,0,0,1-48.286,8,2.285,2.285,0,0,1-46,5.714,2.285,2.285,0,0,1-43.714,8Zm1.3,0A3.59,3.59,0,0,1-46,11.59,3.59,3.59,0,0,1-49.59,8,3.59,3.59,0,0,1-46,4.41,3.59,3.59,0,0,1-42.41,8Z",transform:"translate(54 -2.072)"})})},Vt=function(e){var t=e.active,n=void 0!==t&&t;return Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 13.833 13.833",children:Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M2.934,16H0V13.066L10.607,2.459a1,1,0,0,1,1.414,0l1.52,1.52a1,1,0,0,1,0,1.414Z",transform:"translate(0 -2.167)"})})},Gt=function(e){var t=e.active,n=void 0!==t&&t;return Object(a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 13 13",children:[Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M11.05 8.617v2.429h-9.1v-9.1h2.429v-1.95H0v13h13V8.617z",className:"a"}),Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M3.854 9.256h1.95a4.945 4.945 0 013.6-4.74v1.3l.6-.487 2.474-2.012L9.4.817v1.7a6.9 6.9 0 00-5.546 6.739z",className:"a"})]})},Ht=function(e){var t=e.active,n=void 0!==t&&t;return Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 10.402 13",children:Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M6.761 1V0H3.64v1H.004v1h10.4V1zM.004 2.998l1.672 10h7.052l1.673-10zm3.412 8.243l-.552-6.478h.653l.553 6.472zm3.569 0h-.653l.551-6.472h.654z"})})},Yt=function(e){var t=e.active,n=void 0!==t&&t;return Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 10 11.429",children:Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M-43.375,11.429-48.35,8.664l-5.025,2.764V0h10Z",transform:"translate(53.375)"})})},Qt=function(e){var t=e.active,n=void 0!==t&&t;return Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"})})},Zt=function(e){var t=e.active,n=void 0!==t&&t;return Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3v-3h18v3z"})})},Jt=function(e){var t=e.active,n=void 0!==t&&t;return Object(a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 13 12.996",children:[Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M11.05 9.096v1.95h-9.1v-1.95H0v3.9h13v-3.9z"}),Object(a.jsx)("path",{fill:n?Wt:Ut,d:"M6.5 9.75L9 6.672H7.475V0h-1.95v6.672H4z"})]})},$t=n(36),Xt=function(e,t){switch(e){case"view":return Object(a.jsx)(qt,{active:t});case"edit":return Object(a.jsx)(Vt,{active:t});case"delete":return Object(a.jsx)(Ht,{active:t});case"description":return Object(a.jsx)(Yt,{active:t});case"share":return Object(a.jsx)(Gt,{active:t});case"cloud":return Object(a.jsx)(Qt,{active:t});case"console":return Object(a.jsx)(Zt,{active:t});case"download":return Object(a.jsx)(Jt,{active:t})}return null},en=Object(N.a)((function(){return Object(k.a)({spacing:{margin:"0 8px"}})}))((function(e){var t=e.type,n=e.onClick,c=e.valueToSend,i=e.idField,r=e.selected,o=e.to,s=e.sendOnlyId,l=void 0!==s&&s,d=e.classes,u=l?c[i]:c,b=Object(a.jsx)(It.a,{"aria-label":t,size:"small",onClick:n?function(e){e.stopPropagation(),n(u)}:function(){return null},className:d.spacing,children:Xt(t,r)});return n?b:At()(o)?Object(a.jsx)($t.a,{to:"".concat(o,"/").concat(u),onClick:function(e){e.stopPropagation()},children:b}):null})),tn=n(668),nn=n(669),an=function(e){return Object(a.jsxs)(tt.a,Object(j.a)(Object(j.a)({},e),{},{viewBox:"0 0 12 12",children:[Object(a.jsx)("path",{d:"M357.14,346a5,5,0,1,1-5,5,5,5,0,0,1,5-5m0-1a6,6,0,1,0,6,6,6,6,0,0,0-6-6Z",transform:"translate(-351.14 -345.03)"}),Object(a.jsx)("path",{d:"M356.21,352.42v-1.86h.52c1.23,0,1.92-.45,1.92-1.29s-.68-1.18-1.89-1.18a8.07,8.07,0,0,0-.93.06l-.1-1.25a9.13,9.13,0,0,1,1.08-.08c2,0,3.19.94,3.19,2.4s-.93,2.24-2.64,2.46l-.05.74Zm1.56,1.8a1,1,0,1,1-1-1A1,1,0,0,1,357.77,354.22Z",transform:"translate(-351.14 -345.03)"})]}))},cn=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Se),we),Te),{},{fieldContainer:Object(j.a)(Object(j.a)({},Se.fieldContainer),{},{display:"flex",justifyContent:"flex-start",alignItems:"center",margin:"15px 0",marginBottom:0,flexBasis:"initial"})}))}))((function(e){var t=e.label,n=e.onChange,c=e.value,r=e.id,o=e.name,s=e.checked,l=void 0!==s&&s,d=e.disabled,u=void 0!==d&&d,b=e.tooltip,j=void 0===b?"":b,m=e.classes;return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:m.fieldContainer,children:[Object(a.jsx)("div",{children:Object(a.jsx)(Lt.a,{name:o,id:r,value:c,color:"primary",inputProps:{"aria-label":"secondary checkbox"},checked:l,onChange:n,checkedIcon:Object(a.jsx)("span",{className:m.checkedIcon}),icon:Object(a.jsx)("span",{className:m.unCheckedIcon}),disabled:u})}),""!==t&&Object(a.jsxs)(tn.a,{htmlFor:r,className:m.inputLabel,children:[Object(a.jsx)("span",{children:t}),""!==j&&Object(a.jsx)("div",{className:m.tooltipContainer,children:Object(a.jsx)(nn.a,{title:j,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:m.tooltip})})})})]})]})})})),rn="#9c9c9c80",on={fontWeight:400,fontSize:14,borderColor:rn,borderWidth:"0.5px",height:40,transitionDuration:"0.3s",padding:"initial",paddingRight:6,paddingLeft:6},sn=function(e,t,n,i,r,o,s,l,d,u,b){var j=function(e,t,n,a,c,i,r){var o=Object(He.a)(e);i&&(o=e.filter((function(e){return r.includes(e.elementKey)})));var s=t;return a&&(s-=45),c&&(s-=n),o.reduce((function(e,t){return t.width?e-t.width:e}),s)/o.filter((function(e){return!e.width})).length}(e,t,n,i,r,l,d);return e.map((function(e,t){if(l&&!d.includes(e.elementKey))return null;var n=!e.enableSort||!e.enableSort;return Object(a.jsx)(Dt.b,{dataKey:e.elementKey,headerClassName:"titleHeader ".concat(e.headerTextAlign?"text-".concat(e.headerTextAlign):""),headerRenderer:function(){return Object(a.jsxs)(c.Fragment,{children:[u===e.elementKey&&Object(a.jsx)(c.Fragment,{children:"ASC"===b?Object(a.jsx)(Kt.a,{}):Object(a.jsx)(Pt.a,{})}),e.label]})},className:e.contentTextAlign?"text-".concat(e.contentTextAlign):"",cellRenderer:function(t){var n=t.rowData,i=!!o&&o.includes(At()(n)?n:n[s]);return function(e,t,n){var i=At()(e)?e:Z()(e,t.elementKey,null),r=t.renderFullObject?e:i,o=t.renderFunction?t.renderFunction(r):r;return Object(a.jsx)(c.Fragment,{children:Object(a.jsx)("span",{className:n?"selected":"",children:o})})}(n,e,i)},width:e.width||j,disableSort:n,defaultSortDirection:"ASC"},"col-tb-".concat(t.toString()))}))},ln=Object(N.a)((function(){return Object(k.a)(Object(j.a)(Object(j.a)({dialogContainer:{padding:"12px 26px 22px"},paper:{display:"flex",overflow:"auto",flexDirection:"column",padding:"19px 38px",boxShadow:"none",border:"#EAEDEE 1px solid",borderRadius:3,minHeight:200,overflowY:"scroll",position:"relative","&::-webkit-scrollbar":{width:3,height:3}},noBackground:{backgroundColor:"transparent",border:0},defaultPaperHeight:{height:"calc(100vh - 205px)"},allTableSettings:{"& .MuiTableCell-sizeSmall:last-child":{paddingRight:"initial"},"& .MuiTableCell-body.MuiTableCell-sizeSmall:last-child":{paddingRight:6}},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:700,fontSize:14,borderColor:"#39393980",borderWidth:"0.5px",padding:"6px 0 10px"}}},rowUnselected:Object(j.a)(Object(j.a)({},on),{},{color:"#393939"}),rowSelected:Object(j.a)(Object(j.a)({},on),{},{color:"#081C42",fontWeight:600}),paginatorContainer:{display:"flex",justifyContent:"flex-end",padding:"5px 38px"},checkBoxHeader:{width:50,textAlign:"left",paddingRight:10,"&.MuiTableCell-paddingCheckbox":{paddingBottom:4,paddingLeft:0}},actionsContainer:{width:150,borderColor:rn},paginatorComponent:{borderBottom:0},checkBoxRow:{borderColor:rn,padding:"0 10px 0 0"},loadingBox:{paddingTop:"100px",paddingBottom:"100px"},overlayColumnSelection:{position:"absolute",right:0,top:0},popoverContainer:{position:"relative"},popoverContent:{maxHeight:250,overflowY:"auto",padding:"0 10px 10px"},shownColumnsLabel:{color:"#9c9c9c",fontSize:12,padding:10,borderBottom:"#eaeaea 1px solid",width:"100%"},"@global":{".rowLine":{borderBottom:"1px solid ".concat(rn),height:40,color:"#393939",fontSize:14,transitionDuration:.3,"&:focus":{outline:"initial"},"&:hover:not(.ReactVirtualized__Table__headerRow)":{userSelect:"none",backgroundColor:"#ececec",fontWeight:600,"&.canClick":{cursor:"pointer"},"&.canSelectText":{userSelect:"text"}},"& .selected":{color:"#081C42",fontWeight:600}},".headerItem":{userSelect:"none",fontWeight:700,fontSize:14,fontStyle:"initial",display:"flex",alignItems:"center",outline:"none"},".ReactVirtualized__Table__headerRow":{fontWeight:700,fontSize:14,borderColor:"#39393980",textTransform:"initial"},".optionsAlignment":{textAlign:"center"},".text-center":{textAlign:"center"},".text-right":{textAlign:"right"},".progress-enabled":{paddingTop:3,display:"inline-block",margin:"0 10px",position:"relative",width:18,height:18},".progress-enabled > .MuiCircularProgress-root":{position:"absolute",left:0,top:3}}},Te),_e))}))((function(e){var t=e.itemActions,n=e.columns,r=e.onSelect,o=e.records,s=e.isLoading,l=e.loadingMessage,d=void 0===l?Object(a.jsx)(v.a,{component:"h3",children:"Loading..."}):l,j=e.entityName,m=e.selectedItems,p=e.idField,h=e.classes,O=e.radioSelection,g=void 0!==O&&O,f=e.customEmptyMessage,k=void 0===f?"":f,w=e.customPaperHeight,N=void 0===w?"":w,T=e.noBackground,E=void 0!==T&&T,_=e.columnsSelector,A=void 0!==_&&_,I=e.textSelectable,M=void 0!==I&&I,L=e.columnsShown,D=void 0===L?[]:L,B=e.onColumnChange,F=void 0===B?function(e,t){}:B,R=e.infiniteScrollConfig,P=e.sortConfig,z=e.autoScrollToBottom,K=void 0!==z&&z,U=Object(c.useState)(!1),W=Object(b.a)(U,2),q=W[0],V=W[1],G=i.a.useState(null),H=Object(b.a)(G,2),Y=H[0],Q=H[1],Z=t?t.find((function(e){return"view"===e.type})):null,J=function(e){V(!q),Q(e.currentTarget)},$=function(){V(!1),Q(null)};return Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)(S.a,{className:"".concat(h.paper," ").concat(E?h.noBackground:""," ").concat(""!==N?N:h.defaultPaperHeight),children:[s&&Object(a.jsxs)(x.a,{container:!0,className:h.loadingBox,children:[Object(a.jsx)(x.a,{item:!0,xs:12,style:{textAlign:"center"},children:d}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]}),A&&!s&&o.length>0&&Object(a.jsx)("div",{className:h.overlayColumnSelection,children:function(e){return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(It.a,{"aria-describedby":"columnsSelector",color:"primary",onClick:J,children:Object(a.jsx)(Ft.a,{fontSize:"inherit"})}),Object(a.jsxs)(Mt.a,{anchorEl:Y,id:"columnsSelector",open:q,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:$,className:h.popoverContainer,children:[Object(a.jsx)("div",{className:h.shownColumnsLabel,children:"Shown Columns"}),Object(a.jsx)("div",{className:h.popoverContent,children:e.map((function(e){return Object(a.jsx)(cn,{label:e.label,checked:D.includes(e.elementKey),onChange:function(t){F(e.elementKey,t.target.checked)},id:"chbox-".concat(e.label),name:"chbox-".concat(e.label),value:e.label},"tableColumns-".concat(e.label))}))})]})]})}(n)}),o&&!s&&o.length>0?Object(a.jsx)(Dt.c,{isRowLoaded:function(e){var t=e.index;return!!o[t]},loadMoreRows:R?R.loadMoreRecords:function(){return new Promise((function(){return!0}))},rowCount:R?R.recordsCount:o.length,children:function(e){var i=e.onRowsRendered,s=e.registerChild;return Object(a.jsx)(Dt.a,{children:function(e){var l=e.width,d=e.height,b=function(e,t){var n=45*t;return n<80?80:n>e?e:n}(l,t?t.filter((function(e){return"view"!==e.type})).length:0),O=!(!r||!m),f=!!(t&&t.length>1||t&&1===t.length&&"view"!==t[0].type);return Object(a.jsxs)(Dt.d,{ref:s,disableHeader:!1,headerClassName:"headerItem",headerHeight:40,height:d,noRowsRenderer:function(){return Object(a.jsx)(c.Fragment,{children:""!==k?k:"There are no ".concat(j," yet.")})},overscanRowCount:10,rowHeight:40,width:l,rowCount:o.length,rowGetter:function(e){var t=e.index;return o[t]},onRowClick:function(e){!function(e){if(Z){var t=Z.sendOnlyId?e[p]:e;if(Z.to)return void u.push("".concat(Z.to,"/").concat(t));Z.onClick&&Z.onClick(t)}}(e.rowData)},rowClassName:"rowLine ".concat(Z?"canClick":""," ").concat(!Z&&M?"canSelectText":""),onRowsRendered:i,sort:P?P.triggerSort:void 0,sortBy:P?P.currentSort:void 0,sortDirection:P?P.currentDirection:void 0,scrollToIndex:K?o.length-1:-1,children:[O&&Object(a.jsx)(Dt.b,{headerRenderer:function(){return Object(a.jsx)(c.Fragment,{children:"Select"})},dataKey:p,width:45,cellRenderer:function(e){var t=e.rowData,n=!!m&&m.includes(At()(t)?t:t[p]);return Object(a.jsx)(Lt.a,{value:At()(t)?t:t[p],color:"primary",inputProps:{"aria-label":"secondary checkbox"},checked:n,onChange:r,onClick:function(e){e.stopPropagation()},checkedIcon:Object(a.jsx)("span",{className:g?h.radioSelectedIcon:h.checkedIcon}),icon:Object(a.jsx)("span",{className:g?h.radioUnselectedIcon:h.unCheckedIcon})})}}),sn(n,l,b,O,f,m||[],p,A,D,P?P.currentSort:"",P?P.currentDirection:void 0),f&&Object(a.jsx)(Dt.b,{headerRenderer:function(){return Object(a.jsx)(c.Fragment,{children:"Options"})},dataKey:p,width:b,headerClassName:"optionsAlignment",className:"optionsAlignment",cellRenderer:function(e){var n=e.rowData,c=!!m&&m.includes(At()(n)?n:n[p]);return function(e,t,n,c){return e.map((function(e,i){if("view"===e.type)return null;var r="string"===typeof t?t:t[c];return e.hideButtonFunction&&e.hideButtonFunction(r)?null:e.showLoaderFunction&&e.showLoaderFunction(r)?Object(a.jsx)("div",{className:"progress-enabled",children:Object(a.jsx)(C.a,{color:"primary",size:18,variant:"indeterminate"},"actions-loader-".concat(e.type,"-").concat(i.toString()))}):Object(a.jsx)(en,{type:e.type,onClick:e.onClick,to:e.to,valueToSend:t,selected:n,idField:c,sendOnlyId:!!e.sendOnlyId},"actions-".concat(e.type,"-").concat(i.toString()))}))}(t||[],n,c,p)}})]})}})}}):Object(a.jsx)(c.Fragment,{children:!s&&Object(a.jsx)("div",{children:""!==k?k:"There are no ".concat(j," yet.")})})]})})})),dn=n(628),un=n(629),bn=n(630),jn={content:'" "',borderLeft:"2px solid #9C9C9C",height:33,width:1,position:"absolute"},mn=Object(s.b)((function(e){return{modalSnackMessage:e.system.modalSnackBar}}),{setModalSnackMessage:V}),pn=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({dialogContainer:{padding:"8px 15px 22px"},closeContainer:{textAlign:"right"},closeButton:{width:45,height:45,padding:0,backgroundColor:"initial","&:hover":{backgroundColor:"initial"},"&:active":{backgroundColor:"initial"}},modalCloseIcon:{fontSize:35,color:"#9C9C9C",fontWeight:300,"&:hover":{color:"#9C9C9C"}},closeIcon:{"&::before":Object(j.a)(Object(j.a)({},jn),{},{transform:"rotate(45deg)"}),"&::after":Object(j.a)(Object(j.a)({},jn),{},{transform:"rotate(-45deg)"}),"&:hover::before, &:hover::after":{borderColor:"#9C9C9C"},width:24,height:24,display:"block",position:"relative"},titleClass:{padding:"0px 50px 12px","& h2":{fontWeight:600,color:"#000",fontSize:22}},modalContent:{padding:"0 50px"},customDialogSize:{width:"100%",maxWidth:765}},ze))}))(mn((function(e){var t=e.onClose,n=e.modalOpen,i=e.title,r=e.children,o=e.classes,s=e.wideLimit,l=void 0===s||s,d=e.modalSnackMessage,u=e.noContentPadding,m=e.setModalSnackMessage,p=Object(c.useState)(!1),h=Object(b.a)(p,2),O=h[0],g=h[1];Object(c.useEffect)((function(){if(d){if(""===d.message)return void g(!1);g(!0)}}),[d]);var f=l?{classes:{paper:o.customDialogSize}}:{maxWidth:"md",fullWidth:!0};return Object(a.jsx)(dn.a,Object(j.a)(Object(j.a)({open:n,onClose:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},f),{},{children:Object(a.jsxs)("div",{className:o.dialogContainer,children:[Object(a.jsx)(Ce.a,{open:O,className:o.snackBarModal,onClose:function(){g(!1),m("")},message:d?d.message:"",ContentProps:{className:"".concat(o.snackBar," ").concat(d&&"error"===d.type?o.errorSnackBar:"")},autoHideDuration:d&&"error"===d.type?1e4:5e3}),Object(a.jsx)("div",{className:o.closeContainer,children:Object(a.jsx)(It.a,{"aria-label":"close",className:o.closeButton,onClick:t,disableRipple:!0,children:Object(a.jsx)("span",{className:o.closeIcon})})}),Object(a.jsx)(un.a,{id:"alert-dialog-title",className:o.titleClass,children:i}),Object(a.jsx)(bn.a,{className:u?"":o.modalContent,children:r})]})}))}))),hn=Object(w.a)((function(e){return Object(k.a)({root:{borderRadius:0,"&::before":{borderColor:"#9c9c9c"}},disabled:{"&.MuiInput-underline::before":{borderColor:"#eaeaea",borderBottomStyle:"solid"}},input:{padding:"15px 30px 10px 5px",color:"#393939",fontSize:13,fontWeight:600,"&:placeholder":{color:"#393939",opacity:1}},error:{color:"#b53b4b"}})}));function On(e){var t=hn();return Object(a.jsx)(f.a,Object(j.a)({InputProps:{classes:t}},e))}var gn=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Se),we),{},{textBoxContainer:{flexGrow:1},textBoxWithIcon:{position:"relative",paddingRight:25},errorState:{color:"#b53b4b",fontSize:14,position:"absolute",top:7,right:7},overlayAction:{position:"absolute",right:0,top:15,"& svg":{maxWidth:15,maxHeight:15}}}))}))((function(e){var t=e.label,n=e.onChange,c=e.value,r=e.id,o=e.name,s=e.type,l=void 0===s?"text":s,d=e.autoComplete,u=void 0===d?"off":d,b=e.disabled,j=void 0!==b&&b,m=e.multiline,p=void 0!==m&&m,h=e.tooltip,O=void 0===h?"":h,g=e.index,f=void 0===g?0:g,v=e.error,y=void 0===v?"":v,C=e.required,S=void 0!==C&&C,k=e.placeholder,w=void 0===k?"":k,N=e.min,T=e.max,E=e.overlayIcon,_=void 0===E?null:E,A=e.overlayAction,I=e.classes,M={"data-index":f};return"number"===l&&N&&(M.min=N),"number"===l&&T&&(M.max=T),Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:"".concat(I.fieldContainer," ").concat(""!==y?I.errorInField:""),children:[""!==t&&Object(a.jsxs)(tn.a,{htmlFor:r,className:I.inputLabel,children:[Object(a.jsxs)("span",{children:[t,S?"*":""]}),""!==O&&Object(a.jsx)("div",{className:I.tooltipContainer,children:Object(a.jsx)(nn.a,{title:O,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:I.tooltip})})})})]}),Object(a.jsx)("div",{className:I.textBoxContainer,children:Object(a.jsx)(On,{id:r,name:o,fullWidth:!0,value:c,disabled:j,onChange:n,type:l,multiline:p,autoComplete:u,inputProps:M,error:""!==y,helperText:y,placeholder:w,className:I.inputRebase})}),_&&Object(a.jsx)("div",{className:I.overlayAction,children:Object(a.jsx)(It.a,{onClick:A?function(){A()}:function(){return null},size:"small",disableFocusRipple:!1,disableRipple:!1,disableTouchRipple:!1,children:_})})]})})})),fn=n(360),xn=n(617),vn=n(659),yn=n(631),Cn=Object(N.a)((function(e){return Object(k.a)({root:{lineHeight:1,"label + &":{marginTop:e.spacing(3)}},input:{position:"relative",color:"#393939",fontSize:13,fontWeight:600,padding:"15px 20px 10px 10px",borderBottom:"1px solid #9c9c9c",display:"flex",alignItems:"center","&:hover":{borderColor:"#393939"},"&:focus":{backgroundColor:"#fff"}}})}))(fn.a),Sn=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Se),we))}))((function(e){var t=e.classes,n=e.id,c=e.name,r=e.onChange,o=e.options,s=e.label,l=e.tooltip,d=void 0===l?"":l,u=e.value,b=e.disabled,j=void 0!==b&&b;return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.fieldContainer,children:[""!==s&&Object(a.jsxs)(tn.a,{htmlFor:n,className:t.inputLabel,children:[Object(a.jsx)("span",{children:s}),""!==d&&Object(a.jsx)("div",{className:t.tooltipContainer,children:Object(a.jsx)(nn.a,{title:d,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:t.tooltip})})})})]}),Object(a.jsx)(xn.a,{fullWidth:!0,children:Object(a.jsx)(vn.a,{id:n,name:c,value:u,onChange:r,input:Object(a.jsx)(Cn,{}),disabled:j,children:o.map((function(e){return Object(a.jsx)(yn.a,{value:e.value,children:e.label},"select-".concat(c,"-").concat(e.label))}))})})]})})})),kn=n(670),wn=n(632),Nn=n(660),Tn=Object(w.a)(Object(j.a)({root:{"&:hover":{backgroundColor:"transparent"}}},_e)),En=function(e){var t=Tn();return Object(a.jsx)(Nn.a,Object(j.a)({className:t.root,disableRipple:!0,color:"default",checkedIcon:Object(a.jsx)("span",{className:t.radioSelectedIcon}),icon:Object(a.jsx)("span",{className:t.radioUnselectedIcon})},e))},_n=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Se),we),{},{radioBoxContainer:{},fieldContainer:Object(j.a)(Object(j.a)({},Se.fieldContainer),{},{display:"flex",justifyContent:"space-between",borderBottom:"#9c9c9c 1px solid",paddingBottom:10,marginTop:11}),optionLabel:{"&.Mui-disabled":{"& .MuiFormControlLabel-label":{color:"#9c9c9c"}},"&:last-child":{marginRight:0},"& .MuiFormControlLabel-label":{fontSize:12,color:"#000"}},checkedOption:{"& .MuiFormControlLabel-label":{fontSize:12,color:"#000",fontWeight:700}}}))}))((function(e){var t=e.selectorOptions,n=void 0===t?[]:t,c=e.currentSelection,r=e.label,o=e.id,s=e.name,l=e.onChange,d=e.tooltip,u=void 0===d?"":d,b=e.disableOptions,j=void 0!==b&&b,m=e.classes,p=e.displayInColumn,h=void 0!==p&&p;return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:m.fieldContainer,children:[Object(a.jsxs)(tn.a,{htmlFor:o,className:m.inputLabel,children:[Object(a.jsx)("span",{children:r}),""!==u&&Object(a.jsx)("div",{className:m.tooltipContainer,children:Object(a.jsx)(nn.a,{title:u,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:m.tooltip})})})})]}),Object(a.jsx)("div",{className:m.radioBoxContainer,children:Object(a.jsx)(kn.a,{"aria-label":o,id:o,name:s,value:c,onChange:l,row:!h,children:n.map((function(e){return Object(a.jsx)(wn.a,{value:e.value,control:Object(a.jsx)(En,{}),label:e.label,disabled:j,className:Object(fe.a)(m.optionLabel,Object(ge.a)({},m.checkedOption,e.value===c))},"rd-".concat(s,"-").concat(e.value))}))})})]})})})),An=n(675),In=n(633),Mn=Object(N.a)({root:{alignItems:"flex-start",height:18,padding:"0 12px",display:"flex",position:"relative"},switchBase:{color:"#fff",padding:0,top:"initial","&$checked":{color:"#fff"},"&$checked + $track":{backgroundColor:"#081C42",opacity:1,height:15},"&:hover":{backgroundColor:"#fff"}},checked:{},track:{height:15,backgroundColor:"#9C9C9C",border:"#081C42 1px solid",opacity:1,padding:0,marginTop:1.5,"&$checked":{backgroundColor:"#081C42"}},thumb:{backgroundColor:"#fff",border:"#081C42 1px solid",boxShadow:"none",width:18,height:18,padding:0,marginLeft:10}})(In.a),Ln=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column",paddingTop:15,boxShadow:"none"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noFound:{textAlign:"center",padding:"10px 0"},tableContainer:{maxHeight:200},stickyHeader:{backgroundColor:"#fff"},actionsTitle:{fontWeight:600,color:"#081C42",fontSize:16,alignSelf:"center"},tableBlock:{marginTop:15},filterField:{width:375,fontWeight:600,"& .input":{"&::placeholder":{fontWeight:600,color:"#081C42"}}},divContainer:{borderBottom:"#9c9c9c 1px solid",paddingBottom:14,marginBottom:20,maxWidth:840,margin:"0 auto"},wrapperContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:840,margin:"0px auto"},indicatorLabel:{fontSize:12,fontWeight:600,color:"#081C42",margin:"0 8px 0 10px"},fieldDescription:{marginTop:4,color:"#999999"}},Ae),Se))}))((function(e){var t=e.label,n=void 0===t?"":t,c=e.onChange,r=e.value,o=e.id,s=e.name,l=e.checked,d=void 0!==l&&l,u=e.disabled,b=void 0!==u&&u,j=e.switchOnly,m=void 0!==j&&j,p=e.tooltip,h=void 0===p?"":p,O=e.description,g=void 0===O?"":O,f=e.indicatorLabels,y=void 0===f?[]:f,C=e.containerClass,S=void 0===C?"":C,k=e.classes,w=Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)("div",{className:"".concat(k.switchContainer," ").concat(S),children:[Object(a.jsx)(Mn,{checked:d,onChange:c,color:"primary",name:s,inputProps:{"aria-label":"primary checkbox"},disabled:b,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,value:r}),2===y.length&&Object(a.jsx)("span",{className:k.indicatorLabel,children:d?y[0]:y[1]})]})});return m?w:Object(a.jsxs)("div",{className:k.divContainer,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:k.wrapperContainer,children:[""!==n&&Object(a.jsxs)(tn.a,{htmlFor:o,className:k.inputLabel,children:[Object(a.jsx)("span",{children:n}),""!==h&&Object(a.jsx)("div",{className:k.tooltipContainer,children:Object(a.jsx)(nn.a,{title:h,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:k.tooltip})})})})]}),w]}),""!==g&&Object(a.jsx)(x.a,{item:!0,xs:10,children:Object(a.jsx)(v.a,{component:"p",className:k.fieldDescription,children:g})})]})})),Dn=Object(s.b)((function(e){return{addBucketModalOpen:e.buckets.open,bucketName:e.buckets.addBucketName,versioningEnabled:e.buckets.addBucketVersioningEnabled,lockingEnabled:e.buckets.addBucketLockingEnabled,quotaEnabled:e.buckets.addBucketQuotaEnabled,quotaType:e.buckets.addBucketQuotaType,quotaSize:e.buckets.addBucketQuotaSize,quotaUnit:e.buckets.addBucketQuotaUnit,retentionEnabled:e.buckets.addBucketRetentionEnabled,retentionMode:e.buckets.addBucketRetentionMode,retentionUnit:e.buckets.addBucketRetentionUnit,retentionValidity:e.buckets.addBucketRetentionValidity}}),{addBucketName:function(e){return{type:gt,name:e}},addBucketVersioned:function(e){return{type:ft,versioned:e}},enableObjectLocking:function(e){return{type:xt,locking:e}},addBucketQuota:function(e){return{type:vt,quota:e}},addBucketQuotaType:function(e){return{type:yt,quotaType:e}},addBucketQuotaSize:function(e){return{type:Ct,quotaSize:e}},addBucketQuotaUnit:function(e){return{type:St,quotaUnit:e}},addBucketRetention:function(e){return{type:wt,retention:e}},addBucketRetentionMode:function(e){return{type:Nt,retentionMode:e}},addBucketRetentionUnit:function(e){return{type:Tt,retentionUnit:e}},addBucketRetentionValidity:function(e){return{type:Et,retentionValidity:e}},setModalError:G})(Object(N.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},quotaSizeContainer:{flexGrow:1},sizeFactorContainer:{flexGrow:0,maxWidth:80,marginLeft:8,alignSelf:"flex-start"}},ke))}))((function(e){var t=e.classes,n=e.open,r=e.closeModalAndRefresh,o=e.addBucketName,s=e.addBucketVersioned,l=e.enableObjectLocking,d=e.addBucketQuota,u=e.addBucketQuotaType,j=e.addBucketQuotaSize,m=e.addBucketQuotaUnit,p=e.addBucketRetention,h=e.addBucketRetentionMode,O=e.addBucketRetentionUnit,f=e.addBucketRetentionValidity,C=e.setModalError,S=e.bucketName,k=e.versioningEnabled,w=e.lockingEnabled,N=e.quotaEnabled,T=e.quotaType,E=e.quotaSize,_=e.quotaUnit,A=e.retentionEnabled,I=e.retentionMode,M=e.retentionUnit,L=e.retentionValidity,D=Object(c.useState)(!1),B=Object(b.a)(D,2),F=B[0],R=B[1],P=Object(c.useState)(!1),z=Object(b.a)(P,2),K=z[0],U=z[1],W=Object(c.useState)(!1),q=Object(b.a)(W,2),V=q[0],G=q[1],H=Object(An.a)(S,1e3),Y=Object(b.a)(H,1)[0];Object(c.useEffect)((function(){o(Y)}),[Y,o]);var Q=function(){o(""),s(!1),l(!1),d(!1),u("hard"),j("1"),m("TiB"),p(!1),h("compliance"),O("days"),f(1)};return Object(c.useEffect)((function(){var e=!1;""!==S.trim()&&(e=!0),N&&e&&(""!==E.trim()&&0!==parseInt(E)||(e=!1)),k&&A||(p(!1),h("compliance"),O("days"),f(1)),A?(l(!0),G(!0)):G(!1),A&&(Number.isNaN(L)||L<1)&&(e=!1),U(e)}),[S,A,w,T,E,_,N,A,p,h,O,f,L]),Object(a.jsx)(pn,{title:"Create Bucket",modalOpen:n,onClose:function(){r(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){if(e.preventDefault(),!F){R(!0);var t={name:S,versioning:k,locking:w};if(N){var n=oe(E,_,!1);t.quota={enabled:!0,quota_type:T,amount:parseInt(n)}}A&&(t.retention={mode:I,unit:M,validity:L}),me.invoke("POST","/api/v1/buckets",t).then((function(e){R(!1),r(!0)})).catch((function(e){R(!1),C(e)})),Q()}}(e)},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"bucket-name",name:"bucket-name",onChange:function(e){o(e.target.value)},label:"Bucket Name",value:S})}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(v.a,{component:"h6",variant:"h6",children:"Features"}),Object(a.jsx)("hr",{})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"versioned",id:"versioned",name:"versioned",checked:k,onChange:function(e){s(e.target.checked)},description:"Allows to keep multiple versions of the same object under the same key.",label:"Versioning",indicatorLabels:["On","Off"]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"locking",id:"locking",name:"locking",disabled:V,checked:w,onChange:function(e){l(e.target.checked)},label:"Object Locking",description:"Required to support retention and legal hold. Can only be enabled at bucket creation.",indicatorLabels:["On","Off"]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"bucket_quota",id:"bucket_quota",name:"bucket_quota",checked:N,onChange:function(e){d(e.target.checked)},label:"Quota",description:"Limit the amount of data in the bucket.",indicatorLabels:["On","Off"]})}),N&&Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:T,id:"quota_type",name:"quota_type",label:"Quota Type",onChange:function(e){u(e.target.value)},selectorOptions:[{value:"hard",label:"Hard"},{value:"fifo",label:"FIFO"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)("div",{className:t.multiContainer,children:[Object(a.jsx)("div",{className:t.quotaSizeContainer,children:Object(a.jsx)(gn,{type:"number",id:"quota_size",name:"quota_size",onChange:function(e){j(e.target.value)},label:"Quota",value:E,required:!0,min:"1"})}),Object(a.jsx)("div",{className:t.sizeFactorContainer,children:Object(a.jsx)(Sn,{label:"\xa0",id:"quota_unit",name:"quota_unit",value:_,onChange:function(e){m(e.target.value)},options:te.map((function(e){return{label:e,value:e}}))})})]})})]}),k&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"bucket_retention",id:"bucket_retention",name:"bucket_retention",checked:A,onChange:function(e){p(e.target.checked)},label:"Retention",description:"Impose rules to prevent object deletion for a period of time.",indicatorLabels:["On","Off"]})}),A&&Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:I,id:"retention_mode",name:"retention_mode",label:"Retention Mode",onChange:function(e){h(e.target.value)},selectorOptions:[{value:"compliance",label:"Compliance"},{value:"governance",label:"Governance"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:M,id:"retention_unit",name:"retention_unit",label:"Retention Unit",onChange:function(e){O(e.target.value)},selectorOptions:[{value:"days",label:"Days"},{value:"years",label:"Years"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{type:"number",id:"retention_validity",name:"retention_validity",onChange:function(e){f(e.target.valueAsNumber)},label:"Retention Validity",value:String(L),required:!0,min:"1"})})]})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:Q,children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:F||!K,children:"Save"})]}),F&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),Bn=n(634),Fn=n(635),Rn={setErrorSnackMessage:q},Pn=Object(s.b)(null,Rn)((function(e){var t=e.closeDeleteModalAndRefresh,n=e.deleteOpen,i=e.selectedBucket,r=e.setErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1];return Object(a.jsxs)(dn.a,{open:n,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete Bucket"}),Object(a.jsxs)(bn.a,{children:[l&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to delete bucket ",Object(a.jsx)("b",{children:i}),"? ",Object(a.jsx)("br",{}),"A bucket can only be deleted if it's empty."]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:l,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){l||(d(!0),me.invoke("DELETE","/api/v1/buckets/".concat(i),{name:i}).then((function(e){d(!1),t(!0)})).catch((function(e){d(!1),r(e)})))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),zn=Object(N.a)((function(e){return Object(k.a)({headerContainer:{position:"absolute",width:"100%",height:77,display:"flex",backgroundColor:"#fff",borderBottom:"#E3E3E3 1px solid",left:0},label:{display:"flex",justifyContent:"flex-start",alignItems:"center"},labelStyle:{color:"#000",fontSize:18,fontWeight:700,marginLeft:55,marginTop:8}})}))((function(e){var t=e.classes,n=e.label;return Object(a.jsx)(x.a,{container:!0,className:t.headerContainer,children:Object(a.jsx)(x.a,{item:!0,xs:12,className:t.label,children:Object(a.jsx)(v.a,{variant:"h4",className:t.labelStyle,children:n})})})})),Kn=n(310),Un=n.n(Kn),Wn=n(309),qn=n.n(Wn),Vn=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},Me))}))((function(e){var t=e.classes,n=e.label,i=void 0===n?"":n,r=e.content,o=e.multiLine,s=void 0!==o&&o;return Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)(x.a,{className:t.prefinedContainer,children:[""!==i&&Object(a.jsx)(x.a,{item:!0,xs:12,className:t.predefinedTitle,children:i}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.predefinedList,children:Object(a.jsx)(x.a,{item:!0,xs:12,className:s?t.innerContentMultiline:t.innerContent,children:r})})]})})})),Gn=Object(N.a)((function(e){return Object(k.a)({wizardStepContainer:{display:"flex",flexDirection:"column"},wizardComponent:{overflowY:"auto",marginBottom:10,height:"calc(100vh - 435px)",maxWidth:840,margin:"0 auto",width:"100%"},wizardModal:{overflowY:"auto",marginBottom:10,height:"calc(100vh - 515px)"},buttonsContainer:{display:"flex",flexDirection:"row",justifyContent:"flex-end",padding:"10px 0",borderTop:"#EAEAEA 1px solid","& button":{marginLeft:10},"&.forModal":{paddingBottom:0}}})}))((function(e){var t=e.classes,n=e.page,c=e.pageChange,i=e.loadingStep,r=e.forModal;return Object(a.jsxs)("div",{className:t.wizardStepContainer,children:[Object(a.jsx)("div",{className:r?t.wizardModal:t.wizardComponent,children:n.componentRender}),i&&Object(a.jsx)("div",{children:Object(a.jsx)(y.a,{})}),Object(a.jsx)("div",{className:"".concat(t.buttonsContainer," ").concat(r?"forModal":""),children:n.buttons.map((function(e){return Object(a.jsx)(g.a,{variant:"contained",color:"primary",size:"small",onClick:function(){!function(e){switch(e.type){case"next":c("++");break;case"back":c("--");break;case"to":c(e.toPage||0)}e.action&&e.action(c)}(e)},disabled:!e.enabled,children:e.label},"button-".concat(n.label,"-").concat(e.label))}))})]})})),Hn=Object(N.a)((function(e){return Object(k.a)({wizardMain:{display:"flex",width:"100%",height:"100%",flexGrow:1},wizFromContainer:{height:"calc(100vh - 365px)",minHeight:450,padding:"0 30px"},wizFromModal:{position:"relative"},wizardSteps:{minWidth:180,marginRight:10,borderRight:"#eaeaea 1px solid",display:"flex",flexGrow:1,flexDirection:"column",height:"100%","& ul":{padding:"0 15px 0 40px",marginTop:0,"& li":{listStyle:"lower-roman",marginBottom:12}}},modalWizardSteps:{padding:5,borderBottom:"#eaeaea 1px solid","& ul":{padding:0,marginTop:0,display:"flex",justifyContent:"space-evenly","& li":{listStyle:"lower-roman","&::marker":{paddingLeft:15}}}},buttonList:{backgroundColor:"transparent",border:"none",cursor:"pointer","&:not(:disabled):hover":{textDecoration:"underline"},"&:selected, &:active, &:focus, &:focus:active":{border:"none",outline:0,boxShadow:"none"}},paddedContentGrid:{padding:"0 10px"},stepsLabel:{fontSize:20,color:"#393939",fontWeight:600,margin:"15px 12px","&.stepsModalTitle":{textAlign:"center",width:"100%",marginTop:0,marginBottom:10}},stepsMasterContainer:{position:"sticky",top:0,backgroundColor:"#FFFFFF",width:"100%",maxHeight:90}})}))((function(e){var t=e.classes,n=e.wizardSteps,i=e.loadingStep,r=e.forModal,o=Object(c.useState)(0),s=Object(b.a)(o,2),l=s[0],d=s[1],u=function(e){var t=n.length-1;if("++"===e){var a=l+1;a>t&&(a=t),d(a)}if("--"===e){var c=l-1;c<0&&(c=0),d(c)}if("number"===typeof e){var i=e;e<0&&(i=0),e>t&&(i=t),d(i)}};if(0===n.length)return null;var j=function(){return Object(a.jsx)("ul",{children:n.map((function(e,n){return Object(a.jsx)("li",{children:Object(a.jsx)("button",{onClick:function(){return u(n)},disabled:n>l,className:t.buttonList,children:e.label})},"wizard-".concat(n.toString()))}))})};return Object(a.jsxs)(x.a,{container:!0,className:r?t.wizFromModal:t.wizFromContainer,children:[r?Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)("div",{className:t.stepsMasterContainer,children:[Object(a.jsx)("div",{className:"".concat(t.stepsLabel," stepsModalTitle"),children:"Steps"}),Object(a.jsx)("div",{className:t.modalWizardSteps,children:j()})]})}):Object(a.jsx)(c.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,sm:3,md:3,lg:3,xl:2,children:Object(a.jsxs)("div",{className:t.wizardSteps,children:[Object(a.jsx)("span",{className:t.stepsLabel,children:"Steps"}),j()]})})}),Object(a.jsx)(x.a,{item:!0,xs:12,sm:r?12:9,md:r?12:9,lg:r?12:9,xl:r?12:10,className:r?"":t.paddedContentGrid,children:Object(a.jsx)(Gn,{page:n[l],pageChange:u,loadingStep:i,forModal:r})})]})})),Yn=Object(s.b)(null,{setModalErrorSnackMessage:G}),Qn=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"},remoteBucketList:{display:"grid",gridTemplateColumns:"auto auto 45px",alignItems:"center",justifyContent:"stretch"},errorIcon:{color:"#C72C48"},successIcon:{color:"#42C91A"},hide:{opacity:0,transitionDuration:"0.3s"}},ke),Ke))}))(Yn((function(e){var t=e.open,n=e.closeModalAndRefresh,i=e.classes,r=e.buckets,o=e.setModalErrorSnackMessage,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(!1),g=Object(b.a)(O,2),f=g[0],v=g[1],y=Object(c.useState)(""),C=Object(b.a)(y,2),S=C[0],k=C[1],w=Object(c.useState)(""),N=Object(b.a)(w,2),T=N[0],E=N[1],_=Object(c.useState)(""),A=Object(b.a)(_,2),I=A[0],M=A[1],L=Object(c.useState)(""),D=Object(b.a)(L,2),B=D[0],F=D[1],R=Object(c.useState)(!0),P=Object(b.a)(R,2),z=P[0],K=P[1],U=Object(c.useState)([]),W=Object(b.a)(U,2),q=W[0],V=W[1],G=Object(c.useState)([]),H=Object(b.a)(G,2),Y=H[0],Q=H[1],J=Object(c.useState)([]),$=Object(b.a)(J,2),X=$[0],ee=$[1],te=Y.map((function(e){return{label:e,value:e}}));Object(c.useEffect)((function(){if(0===q.length){var e=[],t=[];r.forEach((function(n){e.push(n),t.push("")})),V(t),u(e)}}),[r,q.length]);var ne=function(e){var t=e.errString;switch(t){case"":return Object(a.jsx)("div",{className:i.successIcon,children:Object(a.jsx)(qn.a,{})});case"n/a":return null;default:if(t)return Object(a.jsx)("div",{className:i.errorIcon,children:Object(a.jsx)(nn.a,{title:t,placement:"top-start",children:Object(a.jsx)(Un.a,{})})})}return null},ae=function(e,t){var n=Object(He.a)(q);n[e]=t,V(n)},ce=function(e){var t=Object(He.a)(d),n=Object(He.a)(q);e.forEach((function(e){var a=Z()(e,"errorString","");if(!a||""===a){var c=t.indexOf(e.originBucket);t.splice(c,1),n.splice(c,1)}})),u(t),V(n)};return Object(a.jsx)(pn,{modalOpen:t,onClose:function(){n(!1)},title:"Set Multiple Bucket Replication",children:Object(a.jsx)(Hn,{loadingStep:p||f,wizardSteps:[{label:"Remote Configuration",componentRender:Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Vn,{label:"Local Buckets to replicate",content:d.join(", ")})}),Object(a.jsx)("h4",{children:"Remote Endpoint Configuration"}),Object(a.jsx)("span",{className:i.descriptionText,children:"Please avoid the use of root credentials for this feature"}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"accessKey",name:"accessKey",onChange:function(e){k(e.target.value)},label:"Access Key",value:S})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"secretKey",name:"secretKey",onChange:function(e){E(e.target.value)},label:"Secret Key",value:T})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"targetURL",name:"targetURL",onChange:function(e){M(e.target.value)},placeholder:"play.min.io:9000",label:"Target URL",value:I})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{checked:z,id:"useTLS",name:"useTLS",label:"Use TLS",onChange:function(e){K(e.target.checked)},value:"yes"})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"region",name:"region",onChange:function(e){F(e.target.value)},label:"Region",value:B})})]}),buttons:[{type:"custom",label:"Next",enabled:!f,action:function(e){var t={accessKey:S,secretKey:T,targetURL:I,useTLS:z};v(!0),me.invoke("POST","api/v1/list-external-buckets",t).then((function(t){var n=Z()(t,"buckets",[]);if(n&&n.length>0){var a=n.map((function(e){return e.name}));Q(a)}e("++"),v(!1)})).catch((function(e){v(!1),o(e)}))}}]},{label:"Buckets Assignation",componentRender:Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)("h3",{children:"Remote Buckets Assignation"}),Object(a.jsx)("span",{className:i.descriptionText,children:"Please select / type the desired remote bucket were you want the local data to be replicated."}),Object(a.jsx)("div",{className:i.remoteBucketList,children:d.map((function(e,t){var n,r=function(e){if(X.length>0){var t=X.find((function(t){return t.originBucket===e}));if(t)return Z()(t,"errorString","")||""}return"n/a"}(e);return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)("div",{className:""===r?i.hide:"",children:e}),Object(a.jsx)("div",{className:""===r?i.hide:"",children:(n=t,Y.length>0?Object(a.jsx)(c.Fragment,{children:Object(a.jsx)(Sn,{label:"",id:"assign-bucket-".concat(n),name:"assign-bucket-".concat(n),value:q[n],onChange:function(e){ae(n,e.target.value)},options:te,disabled:p})}):Object(a.jsx)(c.Fragment,{children:Object(a.jsx)(gn,{id:"assign-bucket-".concat(n),name:"assign-bucket-".concat(n),label:"",onChange:function(e){ae(n,e.target.value)},value:q[n],disabled:p})}))}),Object(a.jsx)("div",{className:""===r?i.hide:"",children:X.length>0&&Object(a.jsx)(ne,{errString:r})})]},"buckets-assignation-".concat(t.toString(),"-").concat(e))}))})]}),buttons:[{type:"back",label:"Back",enabled:!0},{type:"next",label:"Create",enabled:!p,action:function(){h(!0);var e=d.map((function(e,t){return{originBucket:e,destinationBucket:q[t]}})),t="".concat(z?"https://":"http://").concat(I),a={accessKey:S,secretKey:T,targetURL:t,region:B,bucketsRelation:e};me.invoke("POST","/api/v1/buckets-replication",a).then((function(e){h(!1);var t=e.replicationState;ee(t),0===t.filter((function(e){return e.errorString&&""!==e.errorString})).length?n(!0):setTimeout((function(){ce(t)}),500)})).catch((function(e){h(!1),o(e)}))}}]}],forModal:!0})})}))),Zn=Object(s.b)((function(e){return{addBucketModalOpen:e.buckets.open}}),{addBucketOpen:function(e){return{type:Ot,open:e}},addBucketReset:function(){return{type:kt}},setErrorSnackMessage:q})(Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}}},Ae),Ie),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=e.addBucketOpen,i=e.addBucketModalOpen,r=e.addBucketReset,o=e.setErrorSnackMessage,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!0),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(!1),v=Object(b.a)(O,2),y=v[0],C=v[1],S=Object(c.useState)(""),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(!0),M=Object(b.a)(I,2),L=M[0],D=M[1],B=Object(c.useState)(!1),F=Object(b.a)(B,2),R=F[0],P=F[1],z=Object(c.useState)([]),K=Object(b.a)(z,2),U=K[0],W=K[1],q=Object(c.useState)(!1),V=Object(b.a)(q,2),G=V[0],H=V[1];Object(c.useEffect)((function(){L&&me.invoke("POST","/api/v1/has-permission",{actions:[{id:"createBucket",action:"s3:CreateBucket"}]}).then((function(e){if(D(!1),e.permissions){var t=(e.permissions?e.permissions:[]).find((function(e){return"createBucket"===e.id}));t&&t.can?P(!0):P(!1),D(!1)}})).catch((function(e){D(!1),o(e)}))}),[L,o]),Object(c.useEffect)((function(){if(p){h(!0),me.invoke("GET","/api/v1/buckets").then((function(e){h(!1),u(e.buckets||[])})).catch((function(e){h(!1),o(e)}))}}),[p,o]);var Y=[{type:"view",to:"/buckets",sendOnlyId:!0},{type:"delete",onClick:function(e){C(!0),N(e)},sendOnlyId:!0}],Q=d.filter((function(e){return""===_||e.name.indexOf(_)>=0}));return Object(a.jsxs)(c.Fragment,{children:[i&&Object(a.jsx)(Dn,{open:i,closeModalAndRefresh:function(e){n(!1),r(),e&&(h(!0),W([]))}}),y&&Object(a.jsx)(Pn,{deleteOpen:y,selectedBucket:w,closeDeleteModalAndRefresh:function(e){!function(e){C(!1),e&&(h(!0),W([]))}(e)}}),G&&Object(a.jsx)(Qn,{open:G,buckets:U,closeModalAndRefresh:function(e){H(!1),e&&W([])}}),Object(a.jsx)(zn,{label:"Buckets"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(f.a,{placeholder:"Search Buckets",className:t.searchField,id:"search-resource",label:"",onChange:function(e){A(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)($e.a,{}),onClick:function(){H(!0)},disabled:0===U.length,children:"Set Replication"}),R&&Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){n(!0)},children:"Create Bucket"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{itemActions:Y,columns:[{label:"Name",elementKey:"name"},{label:"Creation Date",elementKey:"creation_date",renderFunction:function(e){return Object(a.jsx)(et.a,{children:e})}},{label:"Size",elementKey:"size",renderFunction:ce,width:60,contentTextAlign:"right"}],isLoading:p,records:Q,entityName:"Buckets",idField:"name",selectedItems:U,onSelect:function(e){var t=e.target,n=t.value,a=t.checked,c=Object(He.a)(U);return a?c.push(n):c=c.filter((function(e){return e!==n})),W(c),c}})})]})})]})}))),Jn=n(351),$n=n(658),Xn=n(642),ea=Object(s.b)(null,{setModalErrorSnackMessage:G}),ta=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},ke))}))(ea((function(e){var t=e.classes,n=e.open,i=e.bucketName,r=e.closeModalAndRefresh,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)("compliance"),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)("days"),f=Object(b.a)(O,2),v=f[0],C=f[1],S=Object(c.useState)(1),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(!1),E=Object(b.a)(T,2),_=E[0],A=E[1];return Object(c.useEffect)((function(){Number.isNaN(w)||w<1?A(!1):A(!0)}),[w]),Object(a.jsx)(pn,{title:"Set Retention Configuration",modalOpen:n,onClose:function(){r()},children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d||(u(!0),me.invoke("PUT","/api/v1/buckets/".concat(i,"/retention"),{mode:p,unit:v,validity:w}).then((function(){u(!1),r()})).catch((function(e){u(!1),o(e)})))},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:p,id:"retention_mode",name:"retention_mode",label:"Retention Mode",onChange:function(e){h(e.target.value)},selectorOptions:[{value:"compliance",label:"Compliance"},{value:"governance",label:"Governance"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:v,id:"retention_unit",name:"retention_unit",label:"Retention Unit",onChange:function(e){C(e.target.value)},selectorOptions:[{value:"days",label:"Days"},{value:"years",label:"Years"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{type:"number",id:"retention_validity",name:"retention_validity",onChange:function(e){N(e.target.valueAsNumber)},label:"Retention Validity",value:String(w),required:!0,min:"1"})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:d||!_,children:"Set"})}),d&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),na=n(638),aa=n(639),ca=n(640),ia=n(641),ra=n(637),oa=Object(s.b)(null,{setModalErrorSnackMessage:G}),sa=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"}},ke))}))(oa((function(e){var t=e.classes,n=e.open,i=e.selectedBucket,r=e.closeModalAndRefresh,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(""),f=Object(b.a)(O,2),v=f[0],C=f[1],S=Object(c.useState)(""),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)([]),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)([]),M=Object(b.a)(I,2),L=M[0],D=M[1],B=Object(c.useCallback)((function(){u(!0),me.invoke("GET","/api/v1/admin/arns").then((function(e){var t=[];null!==e.arns&&(t=e.arns),u(!1),D(t)})).catch((function(e){u(!1),o(e)}))}),[o]);Object(c.useEffect)((function(){B()}),[B]);var F=function(e,t){var n=_.indexOf(t),a=[];-1===n?a=a.concat(_,t):0===n?a=a.concat(_.slice(1)):n===_.length-1?a=a.concat(_.slice(0,-1)):n>0&&(a=a.concat(_.slice(0,n),_.slice(n+1))),A(a)},R=L.map((function(e){return{label:e,value:e}}));return Object(a.jsx)(pn,{modalOpen:n,onClose:function(){r()},title:"Subscribe To Event",children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d||(u(!0),me.invoke("POST","/api/v1/buckets/".concat(i,"/events"),{configuration:{arn:w,events:_,prefix:p,suffix:v},ignoreExisting:!0}).then((function(){u(!1),r()})).catch((function(e){u(!1),o(e)})))},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Sn,{onChange:function(e){N(e.target.value)},id:"select-access-policy",name:"select-access-policy",label:"ARN",value:w,options:R})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)(ra.a,{size:"medium",children:[Object(a.jsx)(na.a,{className:t.minTableHeader,children:Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{children:"Select"}),Object(a.jsx)(ca.a,{children:"Event"})]})}),Object(a.jsx)(ia.a,{children:[{label:"PUT - Object Uploaded",value:"put"},{label:"GET - Object accessed",value:"get"},{label:"DELETE - Object Deleted",value:"delete"}].map((function(e){return Object(a.jsxs)(aa.a,{onClick:function(t){return F(0,e.value)},children:[Object(a.jsx)(ca.a,{padding:"checkbox",children:Object(a.jsx)(Lt.a,{value:e.value,color:"primary",inputProps:{"aria-label":"secondary checkbox"},onChange:function(t){return F(0,e.value)},checked:_.includes(e.value)})}),Object(a.jsx)(ca.a,{className:t.wrapCell,children:e.label})]},"group-".concat(e.value))}))})]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"prefix-input",name:"prefix-input",label:"Prefix",value:p,onChange:function(e){h(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"suffix-input",name:"suffix-input",label:"Suffix",value:v,onChange:function(e){C(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d,children:"Save"})}),d&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),la=Object(s.b)(null,{setErrorSnackMessage:q})((function(e){var t=e.closeDeleteModalAndRefresh,n=e.deleteOpen,i=e.selectedBucket,r=e.bucketEvent,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(a.jsxs)(dn.a,{open:n,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete Event"}),Object(a.jsxs)(bn.a,{children:[d&&Object(a.jsx)(y.a,{}),Object(a.jsx)(Bn.a,{id:"alert-dialog-description",children:"Are you sure you want to delete this event?"})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){!function(){if(!d&&null!=r){u(!0);var e=Z()(r,"events",[]),n=Z()(r,"prefix",""),a=Z()(r,"suffix","");me.invoke("DELETE","/api/v1/buckets/".concat(i,"/events/").concat(r.arn),{events:e,prefix:n,suffix:a}).then((function(e){u(!1),t(!0)})).catch((function(e){u(!1),o(e)}))}}()},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),da=Object(s.b)(null,{setModalErrorSnackMessage:G}),ua=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"}},ke))}))(da((function(e){var t=e.open,n=e.closeModalAndRefresh,i=e.classes,r=e.bucketName,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(""),f=Object(b.a)(O,2),v=f[0],C=f[1],S=Object(c.useState)(""),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),L=M[0],D=M[1];return Object(a.jsx)(pn,{modalOpen:t,onClose:function(){n()},title:"Set Bucket Replication",children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u(!0),function(){var e={accessKey:p,secretKey:v,targetURL:w,region:L,bucketsRelation:[{originBucket:r,destinationBucket:_}]};me.invoke("POST","/api/v1/buckets-replication",e).then((function(e){u(!1);var t=Z()(e,"replicationState",[]);if(t.length>0){var a=t[0];return u(!1),a.errorString&&""!==a.errorString?void o(a.errorString):void n()}o("No changes applied")})).catch((function(e){u(!1),o(e)}))}()},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:i.formScrollable,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"accessKey",name:"accessKey",onChange:function(e){h(e.target.value)},label:"Access Key",value:p})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"secretKey",name:"secretKey",onChange:function(e){C(e.target.value)},label:"Secret Key",value:v})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"targetURL",name:"targetURL",onChange:function(e){N(e.target.value)},placeholder:"https://play.min.io:9000",label:"Target URL",value:w})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"targetBucket",name:"targetBucket",onChange:function(e){A(e.target.value)},label:"Target Bucket",value:_})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"region",name:"region",onChange:function(e){D(e.target.value)},label:"Region",value:L})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:i.buttonContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d,children:"Save"})}),d&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),ba=Object(s.b)(null,{setModalErrorSnackMessage:G}),ja=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},buttonContainer:{textAlign:"right"}},ke))}))(ba((function(e){var t=e.classes,n=e.open,i=e.selectedBucket,r=e.closeModalAndRefresh,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)("sse-s3"),f=Object(b.a)(O,2),v=f[0],C=f[1];return Object(a.jsx)(pn,{modalOpen:n,onClose:function(){r()},title:"Enable Bucket Encryption",children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d||me.invoke("POST","/api/v1/buckets/".concat(i,"/encryption/enable"),{encType:v,kmsKeyID:p}).then((function(){u(!1),r()})).catch((function(e){u(!1),o(e)}))},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Sn,{onChange:function(e){C(e.target.value)},id:"select-encryption-type",name:"select-encryption-type",label:"Encryption Type",value:v,options:[{label:"SSE-S3",value:"sse-s3"},{label:"SSE-KMS",value:"sse-kms"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),"sse-kms"===v&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"kms-key-id",name:"kms-key-id",label:"KMS Key ID",value:p,onChange:function(e){h(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d,children:"Save"})}),d&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),ma=Object(s.b)(null,{setErrorSnackMessage:q})((function(e){var t=e.closeVersioningModalAndRefresh,n=e.modalOpen,i=e.selectedBucket,r=e.versioningCurrentState,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(a.jsxs)(dn.a,{open:n,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Edit Versioning"}),Object(a.jsxs)(bn.a,{children:[d&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to"," ",Object(a.jsx)("strong",{children:r?"disable":"enable"})," ","versioning for this bucket?",r&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)("strong",{children:"File versions won't be automatically deleted"})]})]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){d||(u(!0),me.invoke("PUT","/api/v1/buckets/".concat(i,"/versioning"),{versioning:!r}).then((function(){u(!1),t(!0)})).catch((function(e){u(!1),o(e)})))},color:"secondary",autoFocus:!0,children:r?"Disable":"Enable"})]})]})})),pa=function(){return Object(a.jsxs)(tt.a,{viewBox:"0 0 16.172 17.187",children:[Object(a.jsx)("defs",{children:Object(a.jsxs)("linearGradient",{id:"a",y1:"0.5",x2:"1",y2:"0.5",gradientUnits:"objectBoundingBox",children:[Object(a.jsx)("stop",{offset:"0.044",stopColor:"#362585"}),Object(a.jsx)("stop",{offset:"0.301",stopColor:"#281b6f"}),Object(a.jsx)("stop",{offset:"1",stopColor:"#1e1560"})]})}),Object(a.jsx)("path",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.5px"},d:"M-4778.1,2239.582v6.425h6.425",transform:"translate(4787.594 -2239.582)"}),Object(a.jsx)("path",{fill:"#707070",d:"M-4784.238,2247.532v-.581c0-.027.009-.054.012-.081.039-.313.055-.632.121-.939a6.744,6.744,0,0,1,3.064-4.441,6.514,6.514,0,0,1,3.293-1.032,6.923,6.923,0,0,1,2.667.423,6.793,6.793,0,0,1,4.119,4.333,6.053,6.053,0,0,1,.279,1.337c.006.083.014.164.021.247v.86c-.011.131-.018.261-.032.392a6.494,6.494,0,0,1-.626,2.147,6.807,6.807,0,0,1-4.044,3.528,6.052,6.052,0,0,1-1.663.3,6.576,6.576,0,0,1-2.565-.325,6.73,6.73,0,0,1-3.947-3.451,6.627,6.627,0,0,1-.658-2.288C-4784.212,2247.816-4784.225,2247.674-4784.238,2247.532Zm13.025-.306c-.024-.309-.021-.661-.082-1a6.206,6.206,0,0,0-1.658-3.293,6.153,6.153,0,0,0-4.1-1.9,5.984,5.984,0,0,0-2.476.355,6.188,6.188,0,0,0-4.134,5.708,6.453,6.453,0,0,0,.228,1.881,6.127,6.127,0,0,0,1.984,3.052,6.046,6.046,0,0,0,3.806,1.445,6.043,6.043,0,0,0,1.235-.065,6.249,6.249,0,0,0,3.783-2.2,6.2,6.2,0,0,0,1.352-3.048C-4771.228,2247.863-4771.233,2247.563-4771.212,2247.226Z",transform:"translate(4786.834 -2240.452)"}),Object(a.jsx)("ellipse",{style:{opacity:.1,fill:"url(#a)"},cx:"6.151",cy:"6.151",rx:"6.151",ry:"6.151",transform:"translate(0 4.886)"})]})},ha=n(312);n(441);n(442);var Oa=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},Se))}))((function(e){var t=e.value,n=e.label,c=void 0===n?"":n,r=e.tooltip,o=void 0===r?"":r,s=e.classes,l=e.onChange,d=void 0===l?function(){}:l,u=e.onBeforeChange,b=e.readOnly,j=void 0!==b&&b;return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsxs)(tn.a,{className:s.inputLabel,children:[Object(a.jsx)("span",{children:c}),""!==o&&Object(a.jsx)("div",{className:s.tooltipContainer,children:Object(a.jsx)(nn.a,{title:o,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:s.tooltip})})})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ha.Controlled,{value:t,options:{mode:"javascript",lineNumbers:!0,readOnly:j},onBeforeChange:u,onChange:d})})]})})),ga={setModalErrorSnackMessage:G},fa=Object(s.b)(null,ga),xa=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({jsonPolicyEditor:{minHeight:400,width:"100%"},buttonContainer:{textAlign:"right"}},ke),Se))}))(fa((function(e){var t=e.classes,n=e.open,i=e.closeModalAndRefresh,r=e.policyEdit,o=e.setModalErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(""),f=Object(b.a)(O,2),v=f[0],C=f[1];Object(c.useEffect)((function(){r&&(h(r.name),C(r?JSON.stringify(JSON.parse(r.policy),null,4):""))}),[r]);var S=""!==p.trim();return Object(a.jsx)(pn,{modalOpen:n,onClose:function(){i(!1)},title:"".concat(r?"Info":"Create"," Policy"),children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d||(u(!0),me.invoke("POST","/api/v1/policies",{name:p,policy:v}).then((function(e){u(!1),i(!0)})).catch((function(e){u(!1),o(e)})))},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"policy-name",name:"policy-name",label:"Policy Name",placeholder:"Enter Policy Name",onChange:function(e){h(e.target.value)},value:p,disabled:!!r})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(Oa,{label:"".concat(r?"Edit":"Write"," Policy"),value:v,onBeforeChange:function(e,t,n){C(n)}})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[!r&&Object(a.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){h(""),C("")},children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d||!S,children:"Save"})]}),d&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),va=Object(s.b)(null,{setModalErrorSnackMessage:G}),ya=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},ke))}))(va((function(e){var t=e.classes,n=e.open,i=e.bucketName,r=e.actualPolicy,o=e.closeModalAndRefresh,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(""),p=Object(b.a)(m,2),h=p[0],O=p[1];return Object(c.useEffect)((function(){O(r)}),[O,r]),Object(a.jsx)(pn,{title:"Change Access Policy",modalOpen:n,onClose:function(){o()},children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u||(j(!0),me.invoke("PUT","/api/v1/buckets/".concat(i,"/set-policy"),{access:h}).then((function(e){j(!1),o()})).catch((function(e){j(!1),s(e)})))},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.formScrollable,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Sn,{value:h,label:"Access Policy",id:"select-access-policy",name:"select-access-policy",onChange:function(e){O(e.target.value)},options:[{value:"PRIVATE",label:"Private"},{value:"PUBLIC",label:"Public"}]})})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,disabled:u,children:"Set"})}),u&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),Ca={setErrorSnackMessage:q},Sa=Object(s.b)(null,Ca)((function(e){var t=e.closeDeleteModalAndRefresh,n=e.deleteOpen,i=e.selectedBucket,r=e.ruleToDelete,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(a.jsxs)(dn.a,{open:n,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete Replication Rule"}),Object(a.jsxs)(bn.a,{children:[d&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to delete replication rule ",Object(a.jsx)("b",{children:r}),"? ",Object(a.jsx)("br",{}),"Remember, at lease one rule must be present once replication has been enabled"]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){d||(u(!0),me.invoke("DELETE","/api/v1/buckets/".concat(i,"/replication/").concat(r)).then((function(){u(!1),t(!0)})).catch((function(e){u(!1),o(e)})))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})}));function ka(e){var t=e.children,n=e.value,i=e.index,r=Object(Jn.a)(e,["children","value","index"]);return Object(a.jsx)("div",Object(j.a)(Object(j.a)({role:"tabpanel",hidden:n!==i,id:"simple-tabpanel-".concat(i),"aria-labelledby":"simple-tab-".concat(i),style:{marginTop:"5px"}},r),{},{children:n===i&&Object(a.jsx)(c.Fragment,{children:t})}))}function wa(e){return{id:"simple-tab-".concat(e),"aria-controls":"simple-tabpanel-".concat(e)}}var Na,Ta=Object(s.b)(null,{setErrorSnackMessage:q}),Ea=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},actionsTray:{textAlign:"right","& button":{marginLeft:10}},searchField:{background:"#FFFFFF",padding:12,borderRadius:5,boxShadow:"0px 3px 6px #00000012"},noRecords:{lineHeight:"24px",textAlign:"center",padding:"20px"},gridWrapper:{width:320},gridContainer:{display:"grid",gridTemplateColumns:"auto auto",gridGap:8,justifyContent:"flex-start",alignItems:"center","& div:not(.MuiCircularProgress-root)":{display:"flex",alignItems:"center"},"& div:nth-child(odd)":{justifyContent:"flex-end",fontWeight:700},"& div:nth-child(2n)":{minWidth:150}},masterActions:{width:"25%",minWidth:"120px","& div":{margin:"5px 0px"}},paperContainer:{padding:15,paddingLeft:23},headerContainer:{display:"flex",justifyContent:"space-between"},capitalizeFirst:{textTransform:"capitalize"},doubleElement:{display:"flex",justifyContent:"space-between"},encCheckbox:{margin:0,padding:0},tabPan:{marginTop:"5px"},fixedHeight:{height:165,minWidth:247,padding:"25px 28px","& svg":{maxHeight:18}},elementTitle:{fontWeight:500,color:"#777777",fontSize:14,marginTop:-9},consumptionValue:{color:"#000000",fontSize:"60px",fontWeight:"bold"}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Ta((function(e){var t=e.classes,n=e.match,i=e.setErrorSnackMessage,r=Object(c.useState)(null),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)([]),u=Object(b.a)(d,2),m=u[0],p=u[1],h=Object(c.useState)([]),O=Object(b.a)(h,2),f=O[0],y=O[1],k=Object(c.useState)([]),w=Object(b.a)(k,2),N=w[0],T=w[1],E=Object(c.useState)(!0),_=Object(b.a)(E,2),A=_[0],I=_[1],M=Object(c.useState)([]),L=Object(b.a)(M,2),D=L[0],B=L[1],F=Object(c.useState)(!0),R=Object(b.a)(F,2),P=R[0],z=R[1],K=Object(c.useState)(!0),U=Object(b.a)(K,2),W=U[0],q=U[1],V=Object(c.useState)(!0),G=Object(b.a)(V,2),H=G[0],Y=G[1],Q=Object(c.useState)(!0),J=Object(b.a)(Q,2),$=J[0],X=J[1],ee=Object(c.useState)(!0),te=Object(b.a)(ee,2),ne=te[0],ae=te[1],ie=Object(c.useState)(!0),re=Object(b.a)(ie,2),oe=re[0],se=re[1],le=Object(c.useState)(!0),de=Object(b.a)(le,2),ue=de[0],be=de[1],je=Object(c.useState)(!0),pe=Object(b.a)(je,2),he=pe[0],Oe=pe[1],ge=Object(c.useState)(!1),fe=Object(b.a)(ge,2),xe=fe[0],ve=fe[1],ye=Object(c.useState)(0),Ce=Object(b.a)(ye,2),Se=Ce[0],ke=Ce[1],we=Object(c.useState)(!1),Ne=Object(b.a)(we,2),Te=Ne[0],Ee=Ne[1],_e=Object(c.useState)(!1),Ae=Object(b.a)(_e,2),Ie=Ae[0],Me=Ae[1],Le=Object(c.useState)(!1),De=Object(b.a)(Le,2),Be=De[0],Fe=De[1],Re=Object(c.useState)(!1),Pe=Object(b.a)(Re,2),ze=Pe[0],Ke=Pe[1],Ue=Object(c.useState)(null),We=Object(b.a)(Ue,2),qe=We[0],Ve=We[1],Ge=Object(c.useState)("0"),He=Object(b.a)(Ge,2),Ye=He[0],Qe=He[1],Ze=Object(c.useState)(!1),Je=Object(b.a)(Ze,2),$e=Je[0],Xe=Je[1],et=Object(c.useState)(!1),tt=Object(b.a)(et,2),nt=tt[0],ct=tt[1],it=Object(c.useState)(!1),rt=Object(b.a)(it,2),ot=rt[0],st=rt[1],lt=Object(c.useState)(!1),dt=Object(b.a)(lt,2),ut=dt[0],bt=dt[1],jt=Object(c.useState)(!1),mt=Object(b.a)(jt,2),pt=mt[0],ht=mt[1],Ot=Object(c.useState)(null),gt=Object(b.a)(Ot,2),ft=gt[0],xt=gt[1],vt=Object(c.useState)(!1),yt=Object(b.a)(vt,2),Ct=yt[0],St=yt[1],kt=Object(c.useState)(!0),wt=Object(b.a)(kt,2),Nt=wt[0],Tt=wt[1],Et=Object(c.useState)(!1),_t=Object(b.a)(Et,2),At=_t[0],Mt=_t[1],Dt=Object(c.useState)(!1),Bt=Object(b.a)(Dt,2),Ft=Bt[0],Rt=Bt[1],Pt=Object(c.useState)(!1),zt=Object(b.a)(Pt,2),Kt=zt[0],Ut=zt[1],Wt=Object(c.useState)(""),qt=Object(b.a)(Wt,2),Gt=qt[0],Ht=qt[1];Object(c.useEffect)((function(){Nt&&me.invoke("POST","/api/v1/has-permission",{actions:[{id:"PutReplicationConfiguration",action:"s3:PutReplicationConfiguration",bucket_name:Yt},{id:"GetReplicationConfiguration",action:"s3:GetReplicationConfiguration",bucket_name:Yt}]}).then((function(e){if(Tt(!1),e.permissions){var t=e.permissions?e.permissions:[],n=t.find((function(e){return"PutReplicationConfiguration"===e.id}));n&&n.can?Mt(!0):Mt(!1);var a=t.find((function(e){return"GetReplicationConfiguration"===e.id}));a&&a.can?Rt(!0):Rt(!1),Tt(!1)}})).catch((function(e){Tt(!1),i(e)}))}),[Nt,i]);var Yt=n.params.bucketName;Object(c.useEffect)((function(){H&&me.invoke("GET","/api/v1/buckets/".concat(Yt,"/events")).then((function(e){var t=Z()(e,"events",[]);Y(!1),p(t||[])})).catch((function(e){Y(!1),i(e)}))}),[H,i,Yt]),Object(c.useEffect)((function(){$&&me.invoke("GET","/api/v1/buckets/".concat(Yt,"/versioning")).then((function(e){ct(e.is_versioned),X(!1)})).catch((function(e){i(e),X(!1)}))}),[$,i,Yt]),Object(c.useEffect)((function(){$&&me.invoke("GET","/api/v1/buckets/".concat(Yt,"/object-locking")).then((function(e){st(e.object_locking_enabled),ae(!1)})).catch((function(e){i(e),ae(!1)}))}),[ne,i,Yt]),Object(c.useEffect)((function(){oe&&me.invoke("GET","/api/v1/buckets/".concat(Yt,"/replication")).then((function(e){var t=e.rules?e.rules:[];y(t),se(!1)})).catch((function(e){i(e),se(!1)}))}),[oe,i,Yt]),Object(c.useEffect)((function(){A&&me.invoke("GET","/api/v1/bucket-policy/".concat(Yt)).then((function(e){T(e.policies),I(!1)})).catch((function(e){i(e),I(!1)}))}),[A,i,Yt]),Object(c.useEffect)((function(){P&&me.invoke("GET","/api/v1/bucket-users/".concat(Yt)).then((function(e){B(e),z(!1)})).catch((function(e){i(e),z(!1)}))}),[P,i,Yt]),Object(c.useEffect)((function(){ue&&me.invoke("GET","/api/v1/buckets").then((function(e){var t=Z()(e,"buckets",[]).find((function(e){return e.name===Yt})),n=Z()(t,"size","0");be(!1),Qe(n)})).catch((function(e){be(!1),i(e)}))}),[ue,i,Yt]),Object(c.useEffect)((function(){W&&me.invoke("GET","/api/v1/buckets/".concat(Yt)).then((function(e){q(!1),l(e)})).catch((function(e){q(!1),i(e)}))}),[W,i,Yt]),Object(c.useEffect)((function(){he&&me.invoke("GET","/api/v1/buckets/".concat(Yt,"/encryption/info")).then((function(e){e.algorithm&&bt(!0),Oe(!1)})).catch((function(e){console.error(e),Oe(!1)}))}),[he,Yt]);var Qt=function(){q(!0),be(!0),se(!0),X(!0),Y(!0),Oe(!0)},Zt=function(){I(!0)},Jt="n/a";null!==s&&(Jt=s.access);var $t=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Xe(e)},Xt=[{type:"delete",onClick:function(e){Ke(!0),Ve(e)}}],en=[{type:"view",onClick:function(e){Me(!0),xt(e)}}],tn=[{type:"delete",onClick:function(e){Ht(e.id),Ut(!0)},hideButtonFunction:function(){return f.length<=1}}];return Object(a.jsxs)(c.Fragment,{children:[Te&&Object(a.jsx)(sa,{open:Te,selectedBucket:Yt,closeModalAndRefresh:function(){Ee(!1),Qt()}}),Be&&Object(a.jsx)(ja,{open:Be,selectedBucket:Yt,closeModalAndRefresh:function(){Fe(!1),Qt()}}),xe&&Object(a.jsx)(ya,{bucketName:Yt,open:xe,actualPolicy:Jt,closeModalAndRefresh:function(){ve(!1),Qt()}}),Ie&&Object(a.jsx)(xa,{open:Ie,closeModalAndRefresh:function(e){Me(!1),e&&Zt()},policyEdit:ft}),pt&&Object(a.jsx)(ta,{bucketName:Yt,open:pt,closeModalAndRefresh:function(){ht(!1),Qt()}}),$e&&Object(a.jsx)(ua,{closeModalAndRefresh:function(){$t(!1),Qt()},open:$e,bucketName:Yt}),ze&&Object(a.jsx)(la,{deleteOpen:ze,selectedBucket:Yt,bucketEvent:qe,closeDeleteModalAndRefresh:function(e){Ke(!1),e&&Qt()}}),Ct&&Object(a.jsx)(ma,{closeVersioningModalAndRefresh:function(e){St(!1),e&&Qt()},modalOpen:Ct,selectedBucket:Yt,versioningCurrentState:nt}),Kt&&Object(a.jsx)(Sa,{deleteOpen:Kt,selectedBucket:Yt,closeDeleteModalAndRefresh:function(e){Ut(!1),e&&se(!0)},ruleToDelete:Gt}),Object(a.jsx)(zn,{label:"Bucket > ".concat(n.params.bucketName)}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)(x.a,{container:!0,spacing:2,children:[Object(a.jsx)(x.a,{item:!0,children:Object(a.jsxs)(S.a,{className:t.fixedHeight,children:[Object(a.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(a.jsx)(x.a,{item:!0,className:t.icon,children:Object(a.jsx)(pa,{})}),Object(a.jsx)(x.a,{item:!0,children:Object(a.jsx)(v.a,{className:t.elementTitle,children:"Reported Usage"})})]}),Object(a.jsx)(v.a,{className:t.consumptionValue,children:ce(Ye)})]})}),Object(a.jsx)(x.a,{item:!0,children:Object(a.jsx)(S.a,{className:t.paperContainer,children:Object(a.jsxs)("div",{className:t.gridContainer,children:[Object(a.jsx)("div",{children:"Access Policy:"}),Object(a.jsxs)("div",{className:t.capitalizeFirst,children:[W?Object(a.jsx)(C.a,{color:"primary",size:16,variant:"indeterminate"}):Jt.toLowerCase(),Object(a.jsx)(It.a,{color:"primary","aria-label":"access",size:"small",className:t.propertiesIcon,onClick:function(){St(!0)},children:Object(a.jsx)(Vt,{active:!0})})]}),Object(a.jsx)("div",{children:"Replication:"}),Object(a.jsx)("div",{className:t.doubleElement,children:Object(a.jsx)("span",{children:f.length?"Yes":"No"})}),!ot&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)("div",{children:"Object Locking:"}),Object(a.jsx)("div",{children:"No"})]}),Object(a.jsx)("div",{children:"Encryption:"}),Object(a.jsx)("div",{children:Object(a.jsx)(Lt.a,{color:"primary",className:t.encCheckbox,inputProps:{"aria-label":"secondary checkbox"},onChange:function(e){return function(e){e.target.checked?Fe(!0):me.invoke("POST","/api/v1/buckets/".concat(Yt,"/encryption/disable")).then((function(){bt(!1)})).catch((function(e){i(e)}))}(e)},checked:ut})})]})})}),ot&&Object(a.jsx)(x.a,{item:!0,children:Object(a.jsx)(S.a,{className:t.paperContainer,children:Object(a.jsxs)("div",{className:t.gridContainer,children:[Object(a.jsx)("div",{children:"Object Locking"}),Object(a.jsx)("div",{}),Object(a.jsx)("div",{children:"Versioning:"}),Object(a.jsx)("div",{children:$?Object(a.jsx)(C.a,{color:"primary",size:16,variant:"indeterminate"}):Object(a.jsxs)(c.Fragment,{children:[nt&&!$?"Yes":"No","\xa0",Object(a.jsx)(It.a,{color:"primary","aria-label":"retention",size:"small",className:t.propertiesIcon,onClick:function(){ve(!0)},children:Object(a.jsx)(Vt,{active:!0})})]})}),Object(a.jsx)("div",{children:"Retention:"}),Object(a.jsx)("div",{children:$?Object(a.jsx)(C.a,{color:"primary",size:16,variant:"indeterminate"}):Object(a.jsxs)(c.Fragment,{children:["\xa0",Object(a.jsx)(It.a,{color:"primary","aria-label":"retention",size:"small",className:t.propertiesIcon,onClick:function(){ht(!0)},children:Object(a.jsx)(Vt,{active:!0})})]})})]})})})]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsxs)(x.a,{container:!0,item:!0,xs:12,children:[Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsxs)($n.a,{value:Se,onChange:function(e,t){ke(t)},indicatorColor:"primary",textColor:"primary","aria-label":"cluster-tabs",children:[Object(a.jsx)(Xn.a,Object(j.a)({label:"Events"},wa(0))),Ft&&Object(a.jsx)(Xn.a,Object(j.a)({label:"Replication"},wa(1))),Object(a.jsx)(Xn.a,Object(j.a)({label:"Policies"},wa(2))),Object(a.jsx)(Xn.a,Object(j.a)({label:"Users"},wa(3)))]})}),Object(a.jsxs)(x.a,{item:!0,xs:6,className:t.actionsTray,children:[0===Se&&Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),size:"medium",onClick:function(){Ee(!0)},children:"Subscribe to Event"}),1===Se&&Object(a.jsx)(c.Fragment,{children:At&&Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),size:"medium",onClick:function(){$t(!0)},children:"Add Replication Rule"})})]})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(ka,{index:0,value:Se,children:Object(a.jsx)(ln,{itemActions:Xt,columns:[{label:"SQS",elementKey:"arn"},{label:"Events",elementKey:"events",renderFunction:function(e){return Object(a.jsx)(c.Fragment,{children:e.join(", ")})}},{label:"Prefix",elementKey:"prefix"},{label:"Suffix",elementKey:"suffix"}],isLoading:H,records:m,entityName:"Events",idField:"id"})}),Ft&&Object(a.jsx)(ka,{index:1,value:Se,children:Object(a.jsx)(ln,{itemActions:tn,columns:[{label:"ID",elementKey:"id"},{label:"Priority",elementKey:"priority"},{label:"Destination",elementKey:"destination",renderFunction:function(e){return Object(a.jsx)(c.Fragment,{children:e.bucket.replace("arn:aws:s3:::","")})}},{label:"Delete Marker Replication",elementKey:"delete_marker_replication",renderFunction:function(e){return Object(a.jsx)(c.Fragment,{children:e.status})}},{label:"Status",elementKey:"status"}],isLoading:H,records:f,entityName:"Replication Rules",idField:"id"})}),Object(a.jsx)(ka,{index:2,value:Se,children:Object(a.jsx)(ln,{itemActions:en,columns:[{label:"Name",elementKey:"name"}],isLoading:H,records:N,entityName:"Policies",idField:"name"})}),Object(a.jsx)(ka,{index:3,value:Se,children:Object(a.jsx)(ln,{columns:[{label:"User",elementKey:"accessKey"}],isLoading:P,records:D,entityName:"Users",idField:"accessKey"})})]})]})})]})}))),_a=Object(s.b)((function(e){return{open:e.system.sidebarOpen}}),{setMenuOpen:z}),Aa=Object(l.g)(_a((function(){return Object(a.jsx)(l.c,{history:u,children:Object(a.jsxs)(l.d,{children:[Object(a.jsx)(l.b,{path:"/buckets/:bucketName",component:Ea}),Object(a.jsx)(l.b,{path:"/",component:Zn}),Object(a.jsx)(l.b,{component:Ge})]})})}))),Ia={setErrorSnackMessage:q},Ma=Object(s.b)(null,Ia)((function(e){var t=e.closeDeleteModalAndRefresh,n=e.deleteOpen,i=e.selectedPolicy,r=e.setErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1];return Object(a.jsxs)(dn.a,{open:n,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete Policy"}),Object(a.jsxs)(bn.a,{children:[l&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to delete policy ",Object(a.jsx)("b",{children:i}),"?."]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:l,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){l||(d(!0),me.invoke("DELETE","/api/v1/policy?name=".concat(i)).then((function(e){d(!1),t(!0)})).catch((function(e){d(!1),r(e)})))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),La={setErrorSnackMessage:q},Da=Object(s.b)(null,La),Ba=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}}},Ae),Ie),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Da((function(e){var t=e.classes,n=e.setErrorSnackMessage,r=Object(c.useState)([]),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!1),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(!1),h=Object(b.a)(p,2),O=h[0],v=h[1],y=Object(c.useState)(!1),C=Object(b.a)(y,2),S=C[0],k=C[1],w=Object(c.useState)(""),N=Object(b.a)(w,2),T=N[0],E=N[1],_=Object(c.useState)(""),A=Object(b.a)(_,2),I=A[0],M=A[1],L=Object(c.useState)(null),D=Object(b.a)(L,2),B=D[0],F=D[1];Object(c.useEffect)((function(){R()}),[]),Object(c.useEffect)((function(){j&&me.invoke("GET","/api/v1/policies").then((function(e){var t=Z()(e,"policies",[]);t.sort((function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),m(!1),l(t)})).catch((function(e){m(!1),n(e)}))}),[j,m,l,n]);var R=function(){m(!0)},P=[{type:"view",onClick:function(e){v(!0),F(e)}},{type:"delete",onClick:function(e){k(!0),E(e)},sendOnlyId:!0}],z=s.filter((function(e){return e.name.includes(I)}));return Object(a.jsxs)(i.a.Fragment,{children:[O&&Object(a.jsx)(xa,{open:O,closeModalAndRefresh:function(e){v(!1),e&&R()},policyEdit:B}),S&&Object(a.jsx)(Ma,{deleteOpen:S,selectedPolicy:T,closeDeleteModalAndRefresh:function(e){k(!1),e&&R()}}),Object(a.jsx)(zn,{label:"IAM Policies"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(f.a,{placeholder:"Search Policies",className:t.searchField,id:"search-resource",label:"",onChange:function(e){M(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){v(!0),F(null)},children:"Create Policy"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{itemActions:P,columns:[{label:"Name",elementKey:"name"}],isLoading:j,records:z,entityName:"Policies",idField:"name"})})]})})]})}))),Fa=n(313),Ra=n.n(Fa);!function(e){e.singleValue="singleValue",e.linearGraph="linearGraph",e.barChart="barChart",e.pieChart="pieChart",e.singleRep="singleRep"}(Na||(Na={}));var Pa,za="dashboardConfig",Ka=[{w:1,h:2,x:0,y:0,minW:1,i:"panel-0",moved:!1,static:!1},{w:1,h:1,x:1,y:0,minW:1,i:"panel-1",moved:!1,static:!1},{w:1,h:1,x:1,y:1,minW:1,i:"panel-2",moved:!1,static:!1},{w:1,h:2,x:2,y:0,minW:1,i:"panel-3",moved:!1,static:!1},{w:2,h:2,x:3,y:0,minW:2,i:"panel-4",moved:!1,static:!1},{w:3,h:2,x:5,y:0,minW:2,i:"panel-5",moved:!1,static:!1},{w:1,h:1,x:0,y:2,minW:1,i:"panel-6",moved:!1,static:!1},{w:1,h:1,x:0,y:3,minW:1,i:"panel-7",moved:!1,static:!1},{w:1,h:1,x:1,y:2,minW:1,i:"panel-8",moved:!1,static:!1},{w:1,h:1,x:1,y:3,minW:1,i:"panel-9",moved:!1,static:!1},{w:1,h:1,x:2,y:2,minW:1,i:"panel-10",moved:!1,static:!1},{w:1,h:1,x:2,y:3,minW:1,i:"panel-11",moved:!1,static:!1},{w:4,h:2,x:3,y:2,minW:2,i:"panel-12",moved:!1,static:!1},{w:1,h:1,x:7,y:2,minW:1,i:"panel-13",moved:!1,static:!1},{w:1,h:1,x:7,y:3,minW:1,i:"panel-14",moved:!1,static:!1},{w:8,h:2,x:0,y:4,minW:2,i:"panel-15",moved:!1,static:!1},{w:4,h:2,x:0,y:5,minW:2,i:"panel-16",moved:!1,static:!1},{w:4,h:2,x:5,y:5,minW:2,i:"panel-17",moved:!1,static:!1},{w:8,h:2,x:0,y:7,minW:2,i:"panel-18",moved:!1,static:!1},{w:4,h:2,x:0,y:9,minW:2,i:"panel-19",moved:!1,static:!1},{w:4,h:2,x:5,y:9,minW:2,i:"panel-20",moved:!1,static:!1}],Ua=["#6992B7","#E2AD17","#22B573","#F7655E","#0071BC","#F9E6C5","#A6E8C4","#F4CECE","#ADD5E0"],Wa=[{title:"Uptime",data:"N/A",type:Na.singleValue,layoutIdentifier:"panel-0",labelDisplayFunction:function(e){var t=parseFloat(e),n=Math.floor(t/86400);t-=3600*n*24;var a=Math.floor(t/3600);t-=3600*a;var c=Math.floor(t/60);if(t-=60*c,n>365){var i=n/365;return"".concat(i," year").concat(1===Math.floor(i)?"":"s")}if(n>30){var r=Math.floor(n/30),o=n-30*r;return"".concat(r," month").concat(1===Math.floor(r)?"":"s"," ").concat(o>0?"".concat(o," day").concat(o>1?"s":""):"")}if(n>=7&&n<=30){var s=Math.floor(n/7);return"".concat(Math.floor(s)," week").concat(1===s?"":"s")}return n>=1&&n<=6?"".concat(n," day").concat(n>1?"s":""):"".concat(a>=1?"".concat(a," hour").concat(a>1?"s":""):""," ").concat(c>=1&&0===a?"".concat(c," minute").concat(c>1?"s":""):""," ").concat(t>=1&&0===c&&0===a?"".concat(t," second").concat(t>1?"s":""):"")}},{title:"Total Online disks",data:"N/A",type:Na.singleValue,layoutIdentifier:"panel-1"},{title:"Total Offline disks",data:"N/A",type:Na.singleValue,layoutIdentifier:"panel-2"},{title:"Total Data",data:[],dataOuter:[{name:"outer",value:100}],widgetConfiguration:{outerChart:{colorList:["#9c9c9c"],innerRadius:51,outerRadius:54,startAngle:-15,endAngle:195},innerChart:{colorList:Ua,innerRadius:35,outerRadius:50,startAngle:-15,endAngle:195}},type:Na.pieChart,layoutIdentifier:"panel-3",innerLabel:"N/A",labelDisplayFunction:ce},{title:"Data Growth",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:Na.linearGraph,layoutIdentifier:"panel-4",yAxisFormatter:ce,xAxisFormatter:ue},{title:"Object size distribution",data:[],widgetConfiguration:[{dataKey:"a",color:Ua[0],background:{fill:"rgba(0,0,0,0.1)"}}],customStructure:[{originTag:"LESS_THAN_1024_B",displayTag:"Less than 1024B"},{originTag:"BETWEEN_1024_B_AND_1_MB",displayTag:"Between 1024B and 1MB"},{originTag:"BETWEEN_1_MB_AND_10_MB",displayTag:"Between 1MB and 10MB"},{originTag:"BETWEEN_10_MB_AND_64_MB",displayTag:"Between 10MB and 64MB"},{originTag:"BETWEEN_64_MB_AND_128_MB",displayTag:"Between 64MB and 128MB"},{originTag:"BETWEEN_128_MB_AND_512_MB",displayTag:"Between 128MB and 512MB"},{originTag:"GREATER_THAN_512_MB",displayTag:"Greater than 512MB"}],type:Na.barChart,layoutIdentifier:"panel-5"},{title:"Total Online Servers",data:"N/A",type:Na.singleValue,layoutIdentifier:"panel-6"},{title:"Total Offline Servers",data:"N/A",type:Na.singleValue,layoutIdentifier:"panel-7"},{title:"Total S3 Traffic Inbound",data:[],innerLabel:"N/A",type:Na.singleRep,layoutIdentifier:"panel-8",color:"#22B573",fillColor:"#A6E8C4",labelDisplayFunction:ce},{title:"Total S3 Traffic Outbound",data:[],innerLabel:"N/A",type:Na.singleRep,layoutIdentifier:"panel-9",color:"#22B573",fillColor:"#A6E8C4",labelDisplayFunction:ce},{title:"Number of Buckets",data:[],innerLabel:"N/A",type:Na.singleRep,color:"#0071BC",fillColor:"#ADD5E0",layoutIdentifier:"panel-10"},{title:"Number of Objects",data:[],innerLabel:"N/A",type:Na.singleRep,color:"#0071BC",fillColor:"#ADD5E0",layoutIdentifier:"panel-11"},{title:"S3 API Request & Error Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:Na.linearGraph,layoutIdentifier:"panel-12",disableYAxis:!0,xAxisFormatter:ue},{title:"Total Open FDs",data:[],innerLabel:"N/A",type:Na.singleRep,layoutIdentifier:"panel-13",color:"#F7655E",fillColor:"#F4CECE"},{title:"Total Goroutines",data:[],innerLabel:"N/A",type:Na.singleRep,layoutIdentifier:"panel-14",color:"#F7655E",fillColor:"#F4CECE"},{title:"S3 API Data Transfer",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:Na.linearGraph,layoutIdentifier:"panel-15",disableYAxis:!0,xAxisFormatter:ue},{title:"Total S3 API Data Transfer",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:Na.linearGraph,layoutIdentifier:"panel-16",yAxisFormatter:ce,xAxisFormatter:ue},{title:"Active S3 Requests",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:Na.linearGraph,layoutIdentifier:"panel-17",xAxisFormatter:ue},{title:"Internode Data Transfer",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:Na.linearGraph,layoutIdentifier:"panel-18",yAxisFormatter:ce,xAxisFormatter:ue},{title:"Online Disks",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:Na.linearGraph,layoutIdentifier:"panel-19",disableYAxis:!0,xAxisFormatter:ue},{title:"Disk Usage",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:Na.linearGraph,layoutIdentifier:"panel-20",yAxisFormatter:ce,xAxisFormatter:ue}],qa=function(e,t){if(0===e.length)return["","0"];switch(t){case"mean":var n=e.reduce((function(e,t){return e+parseFloat(t[1])}),0);return["",Math.floor(n/e.length).toString()];default:var a=e.sort((function(e,t){return e[0]-t[0]}));return a[a.length-1]}},Va=function(e){return Wa.map((function(t){var n=e.find((function(e){return e.title===t.title}));if(!n)return t;var a=n.type;switch(t.type){case Na.singleValue:if("stat"===a||"singlestat"===a){var c=Z()(n,"targets[0].result[0].values",[]);null===c&&(c=[]);var i=Z()(n,"options.reduceOptions.calcs[0]","lastNotNull"),r=qa(c,i),o=t.labelDisplayFunction?t.labelDisplayFunction(r[1]):r[1];return Object(j.a)(Object(j.a)({},t),{},{data:o})}break;case Na.pieChart:if("gauge"===a){var s=Z()(n,"targets[0].result",[]);null===s&&(s=[]);var l=Z()(n,"options.reduceOptions.calcs[0]","lastNotNull"),d=s.length>0?s[0].values:[],u=qa(d,l),b=s.map((function(e){var t=Z()(e,"values",[]),n=Object.keys(e.metric),a=t.sort((function(e,t){return e[0]-t[0]})),c=e.metric[n[0]],i=a[a.length-1];return{name:c,value:parseInt(i)}})),m=t.labelDisplayFunction?t.labelDisplayFunction(u[1]):u[1];return Object(j.a)(Object(j.a)({},t),{},{data:b,innerLabel:m})}break;case Na.linearGraph:if("graph"===a){var p=Z()(n,"targets",[]);null===p&&(p=[]);var h=[],O=[];p.forEach((function(e,t){var n=Z()(e,"result",[]),a=e.legendFormat;null===n&&(n=[]),n.forEach((function(e){var n=function(e,t){var n=Object.keys(e),a=new RegExp("{{(".concat(n.join("|"),")}}"),"g");return t.replace(a,(function(t){var n=t.replace(/({{|}})/g,"");return e[n]})).replace(/{{(.*?)}}/g,"")}(e.metric,a),c="key_".concat(t).concat(n);h.push({dataKey:c,keyLabel:n,lineColor:"",fillColor:""});var i=Z()(e,"values",[]);null===i&&(i=[]),i.forEach((function(e){var t=O.findIndex((function(t){return t.name===e[0]}));if(-1===t){var n={name:e[0]};n[c]=e[1],O.push(n)}else O[t][c]=e[1]}))}))}));var g=h.sort((function(e,t){return e.keyLabel<t.keyLabel?-1:e.keyLabel>t.keyLabel?1:0})).map((function(e,t){return Object(j.a)(Object(j.a)({},e),{},{lineColor:Ua[t]||je(e.keyLabel),fillColor:Ua[t]||je(e.keyLabel)})})),f=O.sort((function(e,t){return e.name-t.name}));return Object(j.a)(Object(j.a)({},t),{},{widgetConfiguration:g,data:f})}break;case Na.barChart:if("bargauge"===a){var x=Z()(n,"targets[0].result",[]);null===x&&(x=[]);var v=function(e,t){return e[0]-t[0]},y=[];return y=t.customStructure?t.customStructure.map((function(e){var t=x.find((function(t){var n=Object.keys(t.metric);return t.metric[n[0]]===e.originTag})),n=Z()(t,"values",[]).sort(v),a=n[n.length-1]||["","0"];return{name:e.displayTag,a:parseInt(a[1])}})):x.map((function(e){var t=Object.keys(e.metric),n=e.metric[t[0]],a=Z()(e,"values",[]).sort(v),c=a[a.length-1]||["","0"];return{name:n,a:parseInt(c[1])}})),Object(j.a)(Object(j.a)({},t),{},{data:y})}break;case Na.singleRep:if("stat"===a){var C=Z()(n,"targets[0].result[0].values",[]);null===C&&(C=[]);var S=Z()(n,"options.reduceOptions.calcs[0]","lastNotNull"),k=qa(C,S),w=C.sort((function(e,t){return e[0]-t[0]})),N=[];1===w.length&&N.push({value:0}),w.forEach((function(e){N.push({value:parseInt(e[1])})}));var T=t.labelDisplayFunction?t.labelDisplayFunction(k[1]):k[1];return Object(j.a)(Object(j.a)({},t),{},{data:N,innerLabel:T})}}return t}))},Ga=function(e){localStorage.setItem(za,btoa(JSON.stringify(e)))},Ha=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Re),{},{contentContainer:Object(j.a)(Object(j.a)({},Re.contentContainer),{},{fontWeight:700,color:"#072045",fontSize:18,textAlign:"center"})}))}))((function(e){var t=e.title,n=e.data,c=e.classes;return Object(a.jsxs)("div",{className:c.singleValueContainer,children:[Object(a.jsx)("div",{className:c.titleContainer,children:t}),Object(a.jsx)("div",{className:c.contentContainer,children:n})]})})),Ya=n(661),Qa=n(643),Za=n(647),Ja=n(193),$a=n(194),Xa=n(323),ec=n(201),tc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},Pe))}))((function(e){var t=e.active,n=e.payload,c=e.label,i=e.linearConfiguration,r=e.yAxisFormatter,o=e.classes;return t?Object(a.jsxs)("div",{className:o.customTooltip,children:[Object(a.jsx)("div",{className:o.timeStampTitle,children:ue(c,!0)}),n&&n.map((function(e,t){return Object(a.jsxs)("div",{className:o.labelContainer,children:[Object(a.jsx)("div",{className:o.labelColor,style:{backgroundColor:i[t].lineColor}}),Object(a.jsx)("div",{className:o.itemValue,children:Object(a.jsxs)("span",{className:o.valueContainer,children:[i[t].keyLabel,":"," ",r(e.value)]})})]},"lbPl-".concat(t,"-").concat(i[t].keyLabel))}))]}):null})),nc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Re),{},{containerElements:{display:"flex",flexDirection:"column",height:"calc(100% - 18px)"},chartCont:{position:"relative",flexGrow:1,minHeight:"65%",height:1},legendChart:{display:"flex",flexWrap:"wrap",flex:"0 1 auto",maxHeight:"35%",margin:0,overflowY:"auto",position:"relative",textAlign:"center"}}))}))((function(e){var t=e.classes,n=e.title,c=e.linearConfiguration,i=e.data,r=e.hideYAxis,o=void 0!==r&&r,s=e.yAxisFormatter,l=void 0===s?function(e){return e}:s,d=e.xAxisFormatter,u=void 0===d?function(e){return e}:d,b=e.panelWidth,j=void 0===b?0:b,m=5;return 0!==j&&(m=j>400?5:j>350?10:j>300?15:j>250?20:30),Object(a.jsxs)("div",{className:t.singleValueContainer,children:[Object(a.jsx)("div",{className:t.titleContainer,children:n}),Object(a.jsxs)("div",{className:t.containerElements,children:[Object(a.jsx)("div",{className:t.chartCont,children:Object(a.jsx)(Ya.a,{children:Object(a.jsxs)(Qa.a,{data:i,margin:{top:5,right:20,left:o?20:5,bottom:0},children:[Object(a.jsx)(Za.a,{strokeDasharray:"3 3",strokeWidth:1,strokeOpacity:.5}),Object(a.jsx)(Ja.a,{dataKey:"name",tickFormatter:function(e){return u(e)},interval:m,tick:{fontSize:"70%"},tickCount:10}),Object(a.jsx)($a.a,{domain:[0,function(e){return 4*e}],hide:o,tickFormatter:function(e){return l(e)},tick:{fontSize:"70%"}}),c.map((function(e,t){return Object(a.jsx)(Xa.a,{type:"monotone",dataKey:e.dataKey,stroke:e.lineColor,fill:e.fillColor,fillOpacity:.3},"area-".concat(e.dataKey,"-").concat(t.toString()))})),Object(a.jsx)(ec.a,{content:Object(a.jsx)(tc,{linearConfiguration:c,yAxisFormatter:l}),wrapperStyle:{zIndex:5e3}})]})})}),Object(a.jsx)("div",{className:t.legendChart,children:c.map((function(e,n){return Object(a.jsxs)("div",{className:t.singleLegendContainer,children:[Object(a.jsx)("div",{className:t.colorContainer,style:{backgroundColor:e.lineColor}}),Object(a.jsx)("div",{className:t.legendLabel,children:e.keyLabel})]},"legend-".concat(e.keyLabel,"-").concat(n.toString()))}))})]})]})})),ac=n(648),cc=n(352),ic=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},Pe))}))((function(e){var t=e.active,n=e.payload,c=e.label,i=e.barChartConfiguration,r=e.classes;return t?Object(a.jsxs)("div",{className:r.customTooltip,children:[Object(a.jsx)("div",{className:r.timeStampTitle,children:c}),n&&n.map((function(e,t){return Object(a.jsxs)("div",{className:r.labelContainer,children:[Object(a.jsx)("div",{className:r.labelColor,style:{backgroundColor:i[t].color}}),Object(a.jsx)("div",{className:r.itemValue,children:Object(a.jsx)("span",{className:r.valueContainer,children:e.value})})]},"pltiem-".concat(t,"-").concat(c))}))]}):null})),rc=function(e){var t=e.x,n=e.y,c=e.payload;return Object(a.jsx)("text",{width:50,fontSize:"63%",textAnchor:"end",fill:"#333",transform:"translate(".concat(t,",").concat(n,")"),dy:3,children:c.value})},oc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},Re))}))((function(e){var t=e.classes,n=e.title,c=e.barChartConfiguration,i=e.data;return Object(a.jsxs)("div",{className:t.singleValueContainer,children:[Object(a.jsx)("div",{className:t.titleContainer,children:n}),Object(a.jsx)("div",{className:t.contentContainer,children:Object(a.jsx)(Ya.a,{children:Object(a.jsxs)(ac.a,{data:i,layout:"vertical",barCategoryGap:1,children:[Object(a.jsx)(Ja.a,{type:"number",hide:!0}),Object(a.jsx)($a.a,{dataKey:"name",type:"category",interval:0,tick:Object(a.jsx)(rc,{}),tickLine:!1,axisLine:!1,width:150}),c.map((function(e){return Object(a.jsx)(cc.a,{dataKey:e.dataKey,fill:e.color,background:e.background},"bar-".concat(e.dataKey))})),Object(a.jsx)(ec.a,{cursor:{fill:"rgba(255, 255, 255, 0.3)"},content:Object(a.jsx)(ic,{barChartConfiguration:c})})]})})})]})})),sc=n(663),lc=n(325),dc=n(195),uc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},Re))}))((function(e){var t=e.classes,n=e.title,c=e.pieChartConfiguration,i=e.dataInner,r=e.dataOuter,o=e.middleLabel,s=void 0===o?"":o,l=Z()(c,"innerChart.colorList",[]),d=Z()(c,"outerChart.colorList",[]);return Object(a.jsxs)("div",{className:t.singleValueContainer,children:[Object(a.jsx)("div",{className:t.titleContainer,children:n}),Object(a.jsx)("div",{className:t.contentContainer,children:Object(a.jsx)(Ya.a,{children:Object(a.jsxs)(sc.a,{margin:{top:5,bottom:5},children:[r&&Object(a.jsx)(lc.a,{data:r,cx:"50%",cy:"50%",dataKey:"value",innerRadius:Z()(c,"outerChart.innerRadius",0),outerRadius:Z()(c,"outerChart.outerRadius","80%"),startAngle:Z()(c,"outerChart.startAngle",0),endAngle:Z()(c,"outerChart.endAngle",360),fill:"#201763",children:r.map((function(e,t){return Object(a.jsx)(dc.a,{fill:"undefined"==typeof d[t]?"#393939":d[t]},"cellOuter-".concat(t))}))}),i&&Object(a.jsx)(lc.a,{data:i,dataKey:"value",cx:"50%",cy:"50%",innerRadius:Z()(c,"innerChart.innerRadius",0),outerRadius:Z()(c,"innerChart.outerRadius","80%"),startAngle:Z()(c,"innerChart.startAngle",0),endAngle:Z()(c,"innerChart.endAngle",360),fill:"#201763",children:i.map((function(e,t){return Object(a.jsx)(dc.a,{fill:"undefined"==typeof l[t]?"#393939":l[t]},"cell-".concat(t))}))}),s&&Object(a.jsx)("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",fontWeight:600,fontSize:14,children:s})]})})})]})})),bc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},Re))}))((function(e){var t=e.classes,n=e.title,c=e.data,i=e.color,r=e.fillColor,o=e.label;return Object(a.jsxs)("div",{className:t.singleValueContainer,children:[Object(a.jsx)("div",{className:t.titleContainer,children:n}),Object(a.jsx)("div",{className:t.contentContainer,children:Object(a.jsx)(Ya.a,{children:Object(a.jsxs)(Qa.a,{data:c,children:[Object(a.jsx)($a.a,{domain:[0,function(e){return 2*e}],hide:!0}),Object(a.jsx)(Xa.a,{type:"monotone",dataKey:"value",stroke:i,fill:r,fillOpacity:1}),Object(a.jsx)("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",fontWeight:600,fontSize:18,fill:i,children:o})]})})})]})})),jc=n(329),mc=n(58),pc=n(655),hc=n(330),Oc=n.n(hc),gc=Object(N.a)((function(e){return Object(k.a)({dateSelectorOverride:{height:40,border:"#EAEDEE 1px solid",marginLeft:15,backgroundColor:"#fff",padding:"0 16px",borderRadius:5,"&.MuiInput-underline:hover:not(.Mui-disabled):before":{borderBottom:0},"&:hover":{borderColor:"#000","&:before, &:after":{borderColor:"transparent",borderBottom:0}},"&:before, &:after":{borderColor:"transparent",borderBottom:0},"& input":{fontSize:12,fontWeight:600,color:"#393939"}},parentDateOverride:{flexGrow:1}})}))((function(e){var t=e.value,n=e.onChange,c=e.classes;return Object(a.jsx)(mc.a,{utils:jc.a,children:Object(a.jsx)(pc.a,{value:t,onChange:n,InputProps:{startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Oc.a,{})}),className:c.dateSelectorOverride},label:"",ampm:!1,variant:"inline",className:c.parentDateOverride,format:"MMMM Do YYYY, h:mm a"})})})),fc=Object(s.b)(null,{displayErrorMessage:q}),xc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({widgetsContainer:{height:"calc(100vh - 250px)",paddingBottom:235}},Ae),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(fc((function(e){var t=e.classes,n=e.displayErrorMessage,i=Object(c.useState)(null),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(null),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!0),p=Object(b.a)(m,2),h=p[0],O=p[1],f=Object(c.useState)(Wa),v=Object(b.a)(f,2),y=v[0],C=v[1],S=function(){var e=localStorage.getItem(za);if(!e)return Ka;var t=JSON.parse(atob(e));return 0===t.length||t.length>0&&!t[0].minW?Ka:t}(),k=Object(c.useCallback)((function(e){var t=e/8+5,n=function(e,n){switch(e.type){case Na.singleValue:return Object(a.jsx)(Ha,{title:e.title,data:e.data});case Na.pieChart:return Object(a.jsx)(uc,{title:e.title,dataInner:e.data,dataOuter:e.dataOuter||null,pieChartConfiguration:e.widgetConfiguration,middleLabel:e.innerLabel});case Na.linearGraph:return Object(a.jsx)(nc,{title:e.title,data:e.data,linearConfiguration:e.widgetConfiguration,hideYAxis:e.disableYAxis,xAxisFormatter:e.xAxisFormatter,yAxisFormatter:e.yAxisFormatter,panelWidth:t*S[n].w});case Na.barChart:return Object(a.jsx)(oc,{title:e.title,data:e.data,barChartConfiguration:e.widgetConfiguration});case Na.singleRep:var c=e.fillColor?e.fillColor:e.color;return Object(a.jsx)(bc,{title:e.title,data:e.data,label:e.innerLabel,color:e.color,fillColor:c});default:return null}};return y.map((function(e,t){return Object(a.jsx)("div",{children:n(e,t)},e.layoutIdentifier)}))}),[y,S]),w=Object(c.useCallback)((function(){var e=15;if(null!==o&&null!==u){var t=(u.unix()-o.unix())/60;e=t<1?15:t}me.invoke("GET","/api/v1/admin/info?step=".concat(e,"&").concat(null!==o?"&start=".concat(o.unix()):"").concat(null!==o&&null!==u?"&":"").concat(null!==u?"end=".concat(u.unix()):"")).then((function(e){if(e.widgets){var t=Va(e.widgets);C(t)}else n("Widget information could not be retrieved at this time. Please try again");O(!1)})).catch((function(e){n(e),O(!1)}))}),[o,u,n]);return Object(c.useEffect)((function(){h&&w()}),[h,w]),Object(a.jsxs)(x.a,{container:!0,className:t.container,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:"".concat(t.actionsTray," ").concat(t.timeContainers),children:[Object(a.jsx)("span",{className:t.label,children:"Start Time"}),Object(a.jsx)(gc,{value:o,onChange:s}),Object(a.jsx)("span",{className:t.label,children:"End Time"}),Object(a.jsx)(gc,{value:u,onChange:j}),Object(a.jsx)(g.a,{type:"button",variant:"contained",color:"primary",onClick:function(){O(!0)},children:"Get Information"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.widgetsContainer,children:Object(a.jsx)(Dt.a,{style:{width:"100%",height:"auto",paddingBottom:45},children:function(e){var t=e.width,n=e.height,c=n<600?600:n;c>380&&(c=480);var i=t>1920?1920:t;return Object(a.jsx)(Ra.a,{width:i,cols:8,containerPadding:[10,10],onLayoutChange:Ga,layout:S,rowHeight:c/6,style:{margin:"0 auto",width:i},children:k(t)})}})})]})}))),vc=function(){return Object(a.jsxs)(tt.a,{viewBox:"0 0 15.834 17.375",children:[Object(a.jsx)("defs",{children:Object(a.jsxs)("linearGradient",{id:"a",y1:"0.5",x2:"1",y2:"0.5",gradientUnits:"objectBoundingBox",children:[Object(a.jsx)("stop",{offset:"0.044",stopColor:"#362585"}),Object(a.jsx)("stop",{offset:"0.301",stopColor:"#281b6f"}),Object(a.jsx)("stop",{offset:"1",stopColor:"#1e1560"})]})}),Object(a.jsxs)("g",{transform:"translate(0 0.375)",children:[Object(a.jsx)("circle",{style:{opacity:.1,fill:"url(#a)"},cx:"6.625",cy:"6.625",r:"6.625",transform:"translate(0 3.75)"}),Object(a.jsxs)("g",{transform:"translate(3.092)",children:[Object(a.jsx)("ellipse",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.75px"},cx:"6.183",cy:"1.244",rx:"6.183",ry:"1.244",transform:"translate(0)"}),Object(a.jsx)("path",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.75px"},d:"M-3722.174,1225.225l-1.687,10.292a.858.858,0,0,1-.578.669,12.182,12.182,0,0,1-3.918.647,12.187,12.187,0,0,1-3.894-.639.878.878,0,0,1-.6-.678q-.843-5.145-1.687-10.291",transform:"translate(3734.541 -1223.981)"})]})]})]})},yc=function(){return Object(a.jsxs)(tt.a,{viewBox:"0 0 18.344 17.009",children:[Object(a.jsx)("defs",{children:Object(a.jsxs)("linearGradient",{id:"a",y1:"0.5",x2:"1",y2:"0.5",gradientUnits:"objectBoundingBox",children:[Object(a.jsx)("stop",{offset:"0.044",stopColor:"#362585"}),Object(a.jsx)("stop",{offset:"0.301",stopColor:"#281b6f"}),Object(a.jsx)("stop",{offset:"1",stopColor:"#1e1560"})]})}),Object(a.jsxs)("g",{transform:"translate(0 0.25)",children:[Object(a.jsx)("ellipse",{style:{opacity:.1,fill:"url(#a)"},cx:"7.462",cy:"7.462",rx:"7.462",ry:"7.462",transform:"translate(0 1.835)"}),Object(a.jsx)("rect",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.5px"},width:"9.323",height:"9.323",transform:"translate(4.083)"}),Object(a.jsx)("rect",{style:{fill:"none",stroke:"#707070",strokeMiterlimit:10,strokeWidth:"0.5px"},width:"8.223",height:"8.223",transform:"translate(9.871 5.307)"})]})]})},Cc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})),{},{paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column",border:"#eaedee 1px solid",borderRadius:5,boxShadow:"none"},fixedHeight:{height:165,minWidth:247,marginRight:20,padding:"25px 28px","& svg":{maxHeight:18}},consumptionValue:{color:"#000000",fontSize:"60px",fontWeight:"bold"},icon:{marginRight:10,color:"#777777"},notationContainer:{display:"flex"},dashboardBG:{width:390,height:255,zIndex:500,position:"absolute",backgroundSize:"fill",backgroundImage:"url(/images/BG_IllustrationDarker.svg)",backgroundPosition:"right bottom",right:0,bottom:0,backgroundRepeat:"no-repeat"},dashboardContainer:{zIndex:600,position:"absolute"},elementTitle:{fontWeight:500,color:"#777777",fontSize:14,marginTop:-9},smallUnit:{fontSize:20}}))}))((function(e){var t=e.classes,n=e.usage,i=Object(fe.a)(t.paper,t.fixedHeight),r=function(e){return void 0===e?0:e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")};return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)("div",{className:t.dashboardBG}),Object(a.jsx)(x.a,{container:!0,className:t.dashboardContainer,children:Object(a.jsx)(x.a,{container:!0,spacing:3,className:t.container,children:Object(a.jsxs)(x.a,{item:!0,className:t.notationContainer,children:[Object(a.jsxs)(S.a,{className:i,children:[Object(a.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(a.jsx)(x.a,{item:!0,className:t.icon,children:Object(a.jsx)(vc,{})}),Object(a.jsx)(x.a,{item:!0,children:Object(a.jsx)(v.a,{className:t.elementTitle,children:"All buckets"})})]}),Object(a.jsx)(v.a,{className:t.consumptionValue,children:n?r(n.buckets):0})]}),Object(a.jsxs)(S.a,{className:i,children:[Object(a.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(a.jsx)(x.a,{item:!0,className:t.icon,children:Object(a.jsx)(pa,{})}),Object(a.jsx)(x.a,{item:!0,children:Object(a.jsx)(v.a,{className:t.elementTitle,children:"Usage"})})]}),Object(a.jsx)(v.a,{className:t.consumptionValue,children:n?function(e){if(void 0===e)return"0";var n=ce(e).split(" ");return 2!==n.length?n.join(" "):Object(a.jsxs)(c.Fragment,{children:[n[0],Object(a.jsx)("span",{className:t.smallUnit,children:n[1]})]})}(n.usage+""):0})]}),Object(a.jsxs)(S.a,{className:i,children:[Object(a.jsxs)(x.a,{container:!0,direction:"row",alignItems:"center",children:[Object(a.jsx)(x.a,{item:!0,className:t.icon,children:Object(a.jsx)(yc,{})}),Object(a.jsx)(x.a,{item:!0,children:Object(a.jsxs)(v.a,{className:t.elementTitle,children:[" ","Total Objects"]})})]}),Object(a.jsx)(v.a,{className:t.consumptionValue,children:n?r(n.objects):0})]})]})})})]})})),Sc=Object(s.b)(null,{displayErrorMessage:q}),kc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Sc((function(e){var t=e.classes,n=e.displayErrorMessage,i=Object(c.useState)(!0),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(null),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useCallback)((function(){me.invoke("GET","/api/v1/admin/info").then((function(e){j(e),s(!1)})).catch((function(e){n(e),s(!1)}))}),[j,s,n]);Object(c.useEffect)((function(){o&&m()}),[o,m]);var p=Z()(u,"widgets",null);return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(zn,{label:"Dashboard"}),Object(a.jsx)(x.a,{container:!0,children:o?Object(a.jsx)(x.a,{item:!0,xs:12,className:t.container,children:Object(a.jsx)(y.a,{})}):Object(a.jsx)(c.Fragment,{children:null!==p?Object(a.jsx)(xc,{}):Object(a.jsx)(Cc,{usage:u})})})]})}))),wc=n(574),Nc=n(650),Tc=n(331),Ec=n.n(Tc),_c=n(649),Ac=n(651),Ic=n(620),Mc=n(652),Lc=n.p+"static/media/minio_console_logo.0837460e.svg",Dc=n.p+"static/media/minio_operator_logo.1312b7c9.svg",Bc=[{label:"",group:"common",collapsible:!1},{label:"User",group:"User",collapsible:!0},{label:"Admin",group:"Admin",collapsible:!0},{label:"Tools",group:"Tools",collapsible:!0},{label:"Operator",group:"Operator",collapsible:!1},{label:"",group:"License",collapsible:!1}],Fc=n(333),Rc=n.n(Fc),Pc=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 11",children:[Object(a.jsx)("path",{fill:"#fff",d:"M11 11H0V2h11v9zM2 8v1h7V8zm0-3v1h5V5z"}),Object(a.jsxs)("g",{fill:"#07274a",stroke:"#fdfdfd",strokeWidth:"0.5",transform:"translate(7)",children:[Object(a.jsx)("circle",{cx:"3",cy:"3",r:"3",stroke:"none"}),Object(a.jsx)("circle",{cx:"3",cy:"3",r:"2.75",fill:"none"})]}),Object(a.jsx)("path",{fill:"none",stroke:"#fff",strokeWidth:"0.5",d:"M8.73 2.794l.954.953 1.471-1.471"})]})})},zc=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12.122 10.571",children:Object(a.jsxs)("g",{transform:"translate(0 0.5)",children:[Object(a.jsx)("path",{style:{fill:"none",stroke:"rgba(255,255,255,0.8)"},d:"M4816.27,3755.205v-2.939h8.539v9.571h-8.539v-2.932",transform:"translate(-4813.187 -3752.266)"}),Object(a.jsx)("path",{style:{fill:"none",stroke:"rgba(255,255,255,0.8)"},d:"M4813.187,3757.052h8.081",transform:"translate(-4813.187 -3752.266)"}),Object(a.jsx)("path",{style:{fill:"none",stroke:"rgba(255,255,255,0.8)"},d:"M4806.5,3756.511l2.265,2.063-2.265,2.063",transform:"translate(-4800.808 -3753.863)"})]})})})},Kc=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 10",children:Object(a.jsxs)("g",{transform:"translate(-518 -361)",children:[Object(a.jsx)("path",{d:"M-126,0V10h10V0Zm1.5,8.5V2.95h7V8.5Z",transform:"translate(644 361)"}),Object(a.jsx)("rect",{width:"2",height:"1",transform:"translate(520.272 364.772)"})]})})})},Uc=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10.014 9.993",children:[Object(a.jsx)("path",{className:"a",d:"M9.162,5.971h0L8.192,5,9.346,3.846a2.257,2.257,0,0,0,0-3.192,2.311,2.311,0,0,0-3.192,0L5,1.808,4.029.837,3.846.654a2.311,2.311,0,0,0-3.192,0,2.257,2.257,0,0,0,0,3.192l.184.183h0L1.808,5,.654,6.154A2.257,2.257,0,0,0,3.846,9.346L5,8.192l.971.971.183.183A2.257,2.257,0,0,0,9.346,6.154Zm-2.29-4.6a1.27,1.27,0,0,1,1.757,0,1.242,1.242,0,0,1,0,1.757L7.475,4.283,5.717,2.525Zm-5.5,1.757A1.243,1.243,0,0,1,3.129,1.371l.183.183L1.555,3.312Zm1.757,5.5a1.27,1.27,0,0,1-1.757,0,1.242,1.242,0,0,1,0-1.757L2.525,5.717,4.283,7.475Zm2.843-.9-.254-.253L2.525,4.283l-.253-.254L4.029,2.272l.254.253L7.475,5.717l.253.254Zm2.657.9a1.271,1.271,0,0,1-1.757,0l-.183-.183L8.446,6.688l.183.183h0a1.241,1.241,0,0,1,0,1.757Z",transform:"translate(0.007 -0.014)"}),Object(a.jsx)("circle",{cx:"0.5",cy:"0.5",r:"0.5",transform:"translate(4.507 4.486)"}),Object(a.jsx)("circle",{cx:"0.5",cy:"0.5",r:"0.5",transform:"translate(3.507 3.486)"}),Object(a.jsx)("circle",{cx:"0.5",cy:"0.5",r:"0.5",transform:"translate(5.507 5.486)"})]})})},Wc=n(332),qc=n.n(Wc),Vc=Object(s.b)((function(e){return{open:e.system.loggedIn,operatorMode:e.system.operatorMode}}),{userLoggedIn:P}),Gc=Vc(Object(N.a)((function(e){return Object(k.a)({logo:{paddingTop:25,marginBottom:30,paddingLeft:45,"& img":{width:120}},menuList:{"& .active":{borderTopLeftRadius:2,borderBottomLeftRadius:2,color:"#fff",backgroundColor:"rgba(255, 255, 255, .18)","& .MuiSvgIcon-root":{color:"white"},"& .MuiTypography-root":{color:"#fff",fontWeight:700}},"& .MuiSvgIcon-root":{fontSize:16,color:"rgba(255, 255, 255, 0.8)",maxWidth:14},"& .MuiListItemIcon-root":{minWidth:25},"& .MuiTypography-root":{fontSize:12,color:"rgba(255, 255, 255, 0.8)"},"& .MuiListItem-gutters":{paddingRight:0,fontWeight:300},"& .MuiListItem-root":{padding:"2px 0 2px 16px",marginBottom:8,marginLeft:30,width:"calc(100% - 30px)"},"& .MuiCollapse-container .MuiCollapse-wrapper .MuiCollapse-wrapperInner .MuiDivider-root":{backgroundColor:"rgba(112,112,112,0.5)",marginBottom:12,height:1}},extraMargin:{"&.MuiListItem-gutters":{marginLeft:5}},groupTitle:{color:"#fff",fontSize:10,textTransform:"uppercase",fontWeight:700,marginBottom:3,cursor:"pointer",userSelect:"none",display:"flex",justifyContent:"space-between"},subTitleMenu:{fontWeight:700,marginLeft:10,"&.MuiTypography-root":{fontSize:13,color:"#fff"}},selectorArrow:{marginRight:20,marginTop:1,display:"inline-block",width:0,height:0,borderStyle:"solid",borderWidth:"4px 4px 0 4px",borderColor:"rgba(255, 255, 255, .29) transparent transparent transparent",transform:"rotateZ(0deg)",transitionDuration:"0.2s"},selectorArrowOpen:{transform:"rotateZ(180deg)"}})}))((function(e){var t=e.userLoggedIn,n=e.classes,r=e.pages,o=e.operatorMode,s=Object(c.useState)(function(){var e=[];return Bc.forEach((function(t){t.collapsible&&(e[t.group]=!0)})),e}()),l=Object(b.a)(s,2),d=l[0],m=l[1],p=[{group:"common",type:"item",component:$t.b,to:"/dashboard",name:"Dashboard",icon:Object(a.jsx)(it,{})},{group:"User",type:"item",component:$t.b,to:"/object-browser",name:"Object Browser",icon:Object(a.jsx)(Ec.a,{})},{group:"User",type:"item",component:$t.b,to:"/account",name:"Account",icon:Object(a.jsx)(st,{})},{group:"Admin",type:"item",component:$t.b,to:"/buckets",name:"Buckets",icon:Object(a.jsx)(rt,{})},{group:"Admin",type:"item",component:$t.b,to:"/users",name:"Users",icon:Object(a.jsx)(ot,{})},{group:"Admin",type:"item",component:$t.b,to:"/groups",name:"Groups",icon:Object(a.jsx)(lt,{})},{group:"Admin",type:"item",component:$t.b,to:"/policies",name:"IAM Policies",icon:Object(a.jsx)(dt,{})},{group:"Tools",type:"item",component:$t.b,to:"/logs",name:"Logs",icon:Object(a.jsx)(Kc,{})},{group:"Tools",type:"item",component:$t.b,to:"/watch",name:"Watch",icon:Object(a.jsx)(ht,{})},{group:"Tools",type:"item",component:$t.b,to:"/trace",name:"Trace",icon:Object(a.jsx)(ut,{})},{group:"Tools",type:"item",component:$t.b,to:"/heal",name:"Heal",icon:Object(a.jsx)(Uc,{})},{group:"Tools",type:"item",component:$t.b,to:"/health-info",name:"Diagnostic",icon:Object(a.jsx)(qc.a,{})},{group:"Admin",type:"item",component:$t.b,to:"/settings",name:"Settings",icon:Object(a.jsx)(bt,{})},{group:"Operator",type:"item",component:$t.b,to:"/tenants",name:"Tenants",icon:Object(a.jsx)(jt,{})},{group:"Operator",type:"item",component:$t.b,to:"/mirroring",name:"Mirroring",icon:Object(a.jsx)(mt,{})},{group:"Operator",type:"item",component:$t.b,to:"/warp",name:"Warp",icon:Object(a.jsx)(pt,{})}],h=r.reduce((function(e,t){return e[t]=!0,e}),{}),O={group:"License",type:"item",component:$t.b,to:"/documentation",name:"Documentation",icon:Object(a.jsx)(Rc.a,{}),forceDisplay:!0};h.hasOwnProperty("/tenants")?p.push({group:"Operator",type:"item",component:$t.b,to:"/license",name:"License",icon:Object(a.jsx)(Pc,{})},Object(j.a)(Object(j.a)({},O),{},{group:"Operator",onClick:function(e){e.preventDefault(),window.open("https://docs.min.io/?ref=".concat(o?"op":"con"),"_blank")}})):p.push({group:"License",type:"item",component:$t.b,to:"/license",name:"License",icon:Object(a.jsx)(Pc,{})},Object(j.a)(Object(j.a)({},O),{},{group:"License",onClick:function(e){e.preventDefault(),window.open("https://docs.min.io/?ref=".concat(o?"op":"con"),"_blank")}}));var g=p.filter((function(e){return h[e.to]||e.forceDisplay||"item"!==e.type}));return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)("div",{className:n.logo,children:Object(a.jsx)("img",{src:o?Dc:Lc,alt:"logo"})}),Object(a.jsxs)(Ic.a,{className:n.menuList,children:[Bc.map((function(e,t){var c=(g||[]).filter((function(t){return t.group===e.group}));return 0===c.filter((function(e){return"title"!==e.type})).length?null:Object(a.jsxs)(i.a.Fragment,{children:[""!==e.label&&Object(a.jsxs)(wc.a,{className:n.groupTitle,onClick:function(){e.collapsible&&function(e){var t=Object(j.a)({},d);t[e]=!t[e],m(t)}(e.group)},children:[Object(a.jsx)("span",{children:e.label}),e.collapsible&&Object(a.jsx)("span",{className:"".concat(n.selectorArrow," ").concat(d[e.group]?n.selectorArrowOpen:"")})]}),Object(a.jsxs)(_c.a,{in:!e.collapsible||d[e.group],timeout:"auto",unmountOnExit:!0,children:[c.map((function(e){switch(e.type){case"item":return Object(a.jsxs)(wc.a,{button:!0,onClick:e.onClick,component:e.component,to:e.to,className:e.extraMargin?n.extraMargin:null,children:[e.icon&&Object(a.jsx)(Nc.a,{children:e.icon}),e.name&&Object(a.jsx)(Ac.a,{primary:e.name})]},e.to);case"title":return Object(a.jsx)(wc.a,{component:e.component,className:n.subTitleMenu,children:e.name},e.name);default:return null}})),Object(a.jsx)(Mc.a,{})]},"menuGroup-".concat(e.group))]},"menuElem-".concat(t.toString()))})),Object(a.jsxs)(wc.a,{button:!0,onClick:function(){var e=function(){ie(),t(!1),localStorage.setItem("userLoggedIn",""),u.push("/login")};me.invoke("POST","/api/v1/logout").then((function(){e()})).catch((function(t){console.log(t),e()}))},children:[Object(a.jsx)(Nc.a,{children:Object(a.jsx)(zc,{})}),Object(a.jsx)(Ac.a,{primary:"Logout"})]})]})]})}))),Hc={setModalErrorSnackMessage:G},Yc=Object(s.b)(null,Hc),Qc=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({jsonPolicyEditor:{minHeight:400,width:"100%"},buttonContainer:{textAlign:"right"},infoDetails:{color:"#393939",fontSize:12,fontStyle:"italic"}},ke))}))(Yc((function(e){var t=e.classes,n=e.open,i=e.closeModalAndRefresh,r=e.setModalErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],p=j[1];Object(c.useEffect)((function(){l&&me.invoke("POST","/api/v1/service-accounts",{policy:m}).then((function(e){d(!1),i(e)})).catch((function(e){d(!1),r(e)}))}),[l,d,r,m,i]);return Object(a.jsx)(pn,{modalOpen:n,onClose:function(){i(null)},title:"Create Service Account",children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault(),d(!0)}(e)},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(a.jsx)("div",{className:t.infoDetails,children:"Service Accounts inherit the policy explicitly attached to the parent user and the policy attached to each group in which the parent user has membership. You can specify an optional JSON-formatted policy below to restrict the Service Account access to a subset of actions and resources explicitly allowed for the parent user. You cannot modify the Service Account optional policy after saving."}),Object(a.jsx)(Oa,{value:m,onBeforeChange:function(e,t,n){p(n)}})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){p("")},children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:l,children:"Create"})]}),l&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),Zc={setErrorSnackMessage:q},Jc=Object(s.b)(null,Zc),$c=Object(N.a)((function(e){return Object(k.a)({wrapText:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"}})}))(Jc((function(e){var t=e.classes,n=e.closeDeleteModalAndRefresh,i=e.deleteOpen,r=e.selectedServiceAccount,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];Object(c.useEffect)((function(){d&&me.invoke("DELETE","/api/v1/service-accounts/".concat(r)).then((function(){u(!1),n(!0)})).catch((function(e){u(!1),o(e)}))}),[d,n,r,o]);return Object(a.jsxs)(dn.a,{open:i,onClose:function(){n(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete ServiceAccount"}),Object(a.jsxs)(bn.a,{children:[d&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to delete service account"," ",Object(a.jsx)("b",{className:t.wrapText,children:r}),"?"]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){n(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){null!=r&&u(!0)},color:"secondary",autoFocus:!0,children:"Delete"})]})]})}))),Xc=Object(N.a)((function(e){return Object(k.a)({warningBlock:{color:"red"},buttonContainer:{textAlign:"right"}})}))((function(e){var t=e.classes,n=e.newServiceAccount,c=e.open,r=e.closeModal,o=e.entity;if(!n)return null;var s=Z()(n,"console",null);return Object(a.jsx)(pn,{modalOpen:c,onClose:function(){r()},title:"New ".concat(o," Created"),children:Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:["A new ",o," has been created with the following details:",s&&Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)("strong",{children:"Console Credentials"}),Object(a.jsxs)("ul",{children:[Object(a.jsxs)("li",{children:[Object(a.jsx)("b",{children:"Access Key:"})," ",s.accessKey]}),Object(a.jsxs)("li",{children:[Object(a.jsx)("b",{children:"Secret Key:"})," ",s.secretKey]})]})]})}),Object(a.jsx)(v.a,{component:"p",variant:"body1",className:t.warningBlock,children:"Write these down, as this is the only time the secret will be displayed."})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(a.jsx)(g.a,{onClick:function(){var e={};s&&(e={console:{access_key:s.accessKey,secret_key:s.secretKey}}),function(e,t){var n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}("credentials.json",JSON.stringify(Object(j.a)({},e)))},color:"primary",children:"Download"}),Object(a.jsx)(g.a,{onClick:function(){r()},color:"secondary",autoFocus:!0,children:"Done"})]})]})})})})),ei=function(e,t){return e.accessKey>t.accessKey?1:e.accessKey<t.accessKey?-1:0},ti=function(e,t){return e.name>t.name?1:e.name<t.name?-1:0},ni=function(e,t){return e>t?1:e<t?-1:0},ai=n(334),ci=n.n(ai),ii=Object(s.b)(null,{setModalErrorSnackMessage:G}),ri=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},Ae),ke),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(ii((function(e){var t=e.classes,n=e.open,i=e.closeModal,r=e.setModalErrorSnackMessage,o=Object(c.useState)(""),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(""),O=Object(b.a)(h,2),f=O[0],v=O[1],C=Object(c.useState)(!1),S=Object(b.a)(C,2),k=S[0],w=S[1];return n?Object(a.jsx)(pn,{title:"Change Password",modalOpen:n,onClose:function(){p(""),v(""),d(""),i()},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){if(e.preventDefault(),m===f){if(!k){w(!0);var t={current_secret_key:l,new_secret_key:m};me.invoke("POST","/api/v1/account/change-password",t).then((function(e){w(!1),p(""),v(""),d(""),i()})).catch((function(e){w(!1),p(""),v(""),d(""),r(e)}))}}else r("New passwords don't match")}(e)},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"current-password",name:"current-password",onChange:function(e){d(e.target.value)},label:"Current Password",type:"password",value:l})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"new-password",name:"new-password",onChange:function(e){p(e.target.value)},label:"New Password",type:"password",value:m})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"re-new-password",name:"re-new-password",onChange:function(e){v(e.target.value)},label:"Type New Password Again",type:"password",value:f})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:k||!(l.length>0&&m.length>0&&f.length>0),children:"Save"})}),k&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})}):null}))),oi=Object(s.b)(null,{displayErrorMessage:q}),si=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"480px",minWidth:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},imageIcon:{height:"100%"},iconRoot:{textAlign:"center"}},Ae),Ie),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(oi((function(e){var t=e.classes,n=e.displayErrorMessage,r=e.changePassword,o=Object(c.useState)([]),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(!1),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(""),O=Object(b.a)(h,2),y=O[0],C=O[1],S=Object(c.useState)(!1),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(!1),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(null),M=Object(b.a)(I,2),L=M[0],D=M[1],B=Object(c.useState)(!1),F=Object(b.a)(B,2),R=F[0],P=F[1],z=Object(c.useState)(null),K=Object(b.a)(z,2),U=K[0],W=K[1],q=Object(c.useState)(!1),V=Object(b.a)(q,2),G=V[0],H=V[1];Object(c.useEffect)((function(){Y()}),[]),Object(c.useEffect)((function(){m&&me.invoke("GET","/api/v1/service-accounts").then((function(e){var t=e.sort(ni);p(!1),d(t)})).catch((function(e){n(e),p(!1)}))}),[m,p,d,n]);var Y=function(){p(!0)},Q=[{type:"delete",onClick:function(e){D(e),A(!0)}}],Z=l.filter((function(e){return e.toLowerCase().includes(y.toLowerCase())}));return Object(a.jsxs)(i.a.Fragment,{children:[w&&Object(a.jsx)(Qc,{open:w,closeModalAndRefresh:function(e){!function(e){if(N(!1),Y(),null!==e){var t={console:{accessKey:"".concat(e.accessKey),secretKey:"".concat(e.secretKey)}};W(t),P(!0)}}(e)}}),_&&Object(a.jsx)($c,{deleteOpen:_,selectedServiceAccount:L,closeDeleteModalAndRefresh:function(e){!function(e){A(!1),e&&Y()}(e)}}),R&&Object(a.jsx)(Xc,{newServiceAccount:U,open:R,closeModal:function(){P(!1),W(null)},entity:"Service Account"}),Object(a.jsx)(zn,{label:"Account"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[r&&Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"h5",component:"h5",children:"Settings"})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(ri,{open:G,closeModal:function(){return H(!1)}}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(ci.a,{}),onClick:function(){return H(!0)},children:"Change Password"})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)("br",{}),Object(a.jsx)(Mc.a,{}),Object(a.jsx)("br",{})]})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"h5",component:"h5",children:"Service Accounts"})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(f.a,{placeholder:"Search Service Accounts",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})},onChange:function(e){C(e.target.value)}}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){N(!0),D(null)},children:"Create service account"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{isLoading:m,records:Z,entityName:"Service Accounts",idField:"",columns:[{label:"Service Account",elementKey:""}],itemActions:Q})})]})})]})}))),li=n(335),di=n.n(li),ui={setModalErrorSnackMessage:G},bi=Object(s.b)(null,ui),ji=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column",paddingTop:15,boxShadow:"none"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noFound:{textAlign:"center",padding:"10px 0"},tableContainer:{maxHeight:200},stickyHeader:{backgroundColor:"#fff"},actionsTitle:{fontWeight:600,color:"#000",fontSize:16,alignSelf:"center"},tableBlock:{marginTop:15},filterField:{width:375,fontWeight:600,"& .input":{"&::placeholder":{fontWeight:600,color:"#000"}}}},Ae),De))}))(bi((function(e){var t=e.classes,n=e.selectedGroups,r=e.setSelectedGroups,o=e.setModalErrorSnackMessage,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(""),g=Object(b.a)(O,2),v=g[0],C=g[1],k=Object(c.useCallback)((function(){me.invoke("GET","/api/v1/groups").then((function(e){var t=Z()(e,"groups",[]);t||(t=[]),u(t.sort(ni)),h(!1)})).catch((function(e){o(e),h(!1)}))}),[o]);Object(c.useEffect)((function(){h(!0)}),[]),Object(c.useEffect)((function(){p&&k()}),[p,k]);var w=n||[],N=d.filter((function(e){return e.includes(v)}));return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)(S.a,{className:t.paper,children:[p&&Object(a.jsx)(y.a,{}),null!=d&&d.length>0?Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)("span",{className:t.actionsTitle,children:"Assign Groups"}),Object(a.jsx)(f.a,{placeholder:"Filter by Group",className:t.filterField,id:"search-resource",label:"",InputProps:{startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})},onChange:function(e){C(e.target.value)}})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.tableBlock,children:Object(a.jsx)(ln,{columns:[{label:"Group",elementKey:""}],onSelect:function(e){var t=e.target,n=t.value,a=t.checked,c=Object(He.a)(w);return a?c.push(n):c=c.filter((function(e){return e!==n})),r(c),c},selectedItems:w,isLoading:p,records:N,entityName:"Groups",idField:"",customPaperHeight:t.multiSelectTable})})]}):Object(a.jsx)("div",{className:t.noFound,children:"No Groups Available"})]})})})}))),mi={setModalErrorSnackMessage:G},pi=Object(s.b)(null,mi),hi=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"}},ke))}))(pi((function(e){var t=e.classes,n=e.closeModalAndRefresh,r=e.selectedUser,o=e.open,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(""),p=Object(b.a)(m,2),h=p[0],O=p[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),C=v[0],S=v[1],k=Object(c.useState)(!1),w=Object(b.a)(k,2),N=w[0],T=w[1],E=Object(c.useState)([]),_=Object(b.a)(E,2),A=_[0],I=_[1],M=Object(c.useState)([]),L=Object(b.a)(M,2),D=L[0],B=L[1],F=Object(c.useCallback)((function(){if(!r)return null;me.invoke("GET","/api/v1/users/".concat(r.accessKey)).then((function(e){j(!1),O(e.accessKey),I(e.memberOf||[]),B(e.memberOf||[]),T("enabled"===e.status)})).catch((function(e){j(!1),s(e)}))}),[r,s]);Object(c.useEffect)((function(){null==r?(O(""),S(""),I([])):F()}),[r,F]);var R=""!==h.trim()&&(""!==C.trim()&&null===r||null!==r);return Object(a.jsxs)(pn,{onClose:function(){n()},modalOpen:o,title:null!==r?"Edit User":"Create User",children:[null!==r&&Object(a.jsx)("div",{className:t.floatingEnabled,children:Object(a.jsx)(Ln,{indicatorLabels:["Enabled","Disabled"],checked:N,value:"user_enabled",id:"user-status",name:"user-status",onChange:function(e){T(e.target.checked)},switchOnly:!0})}),Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),u||(j(!0),null!==r?me.invoke("PUT","/api/v1/users/".concat(r.accessKey),{status:N?"enabled":"disabled",groups:A}).then((function(e){j(!1),n()})).catch((function(e){j(!1),s(e)})):me.invoke("POST","/api/v1/users",{accessKey:h,secretKey:C,groups:A}).then((function(e){j(!1),n()})).catch((function(e){j(!1),s(e)})))},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.formScrollable,children:[Object(a.jsx)(gn,{id:"accesskey-input",name:"accesskey-input",label:"Access Key",value:h,onChange:function(e){O(e.target.value)},disabled:null!==r}),null!==r?Object(a.jsx)(Vn,{label:"Current Groups",content:D.join(", ")}):Object(a.jsx)(gn,{id:"standard-multiline-static",name:"standard-multiline-static",label:"Secret Key",type:"password",value:C,onChange:function(e){S(e.target.value)},autoComplete:"current-password"}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ji,{selectedGroups:A,setSelectedGroups:function(e){I(e)}})})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){null===r?(O(""),S(""),I([])):I([])},children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:u||!R,children:"Save"})]}),u&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})]})}))),Oi={setErrorSnackMessage:q},gi=Object(s.b)(null,Oi),fi=gi((function(e){var t=e.closeDeleteModalAndRefresh,n=e.deleteOpen,i=e.selectedUser,r=e.setErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1];return null===i?Object(a.jsx)("div",{}):Object(a.jsxs)(dn.a,{open:n,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete User"}),Object(a.jsxs)(bn.a,{children:[l&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to delete user ",Object(a.jsx)("b",{children:i.accessKey}),"?"]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:l,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){l||null!=i&&(d(!0),me.invoke("DELETE","/api/v1/users/".concat(i.accessKey),{id:i.id}).then((function(e){d(!1),t(!0)})).catch((function(e){d(!1),r(e)})))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})),xi={setModalErrorSnackMessage:G},vi=Object(s.b)(null,xi),yi=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"}},ke))}))(vi((function(e){var t=e.open,n=e.checkedUsers,r=e.closeModalAndRefresh,o=e.classes,s=e.setModalErrorSnackMessage,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),p=Object(b.a)(m,2),h=p[0],O=p[1],f=Object(c.useState)([]),v=Object(b.a)(f,2),C=v[0],S=v[1];Object(c.useEffect)((function(){u&&(C.length>0?me.invoke("PUT","/api/v1/users-groups-bulk",{groups:C,users:n}).then((function(){j(!1),O(!0)})).catch((function(e){j(!1),s(e)})):(j(!1),s("You need to select at least one group to assign")))}),[u,j,r,C,n,s]);return Object(a.jsx)(pn,{modalOpen:t,onClose:function(){r(h)},title:h?"The selected users were added to the following groups.":"Add Users to Group",children:h?Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(Vn,{label:"Groups",content:C.join(", ")}),Object(a.jsx)(Vn,{label:"Users",content:n.join(", ")})]}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{})]}):Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),j(!0)},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:o.formScrollable,children:[Object(a.jsx)(Vn,{label:"Selected Users",content:n.join(", ")}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ji,{selectedGroups:C,setSelectedGroups:S})})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:o.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:o.clearButton,onClick:function(){S([])},children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:u||C.length<1,children:"Save"})]}),u&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})}))),Ci=Object(s.b)(null,{setModalErrorSnackMessage:G}),Si=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column",paddingTop:15,boxShadow:"none"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noFound:{textAlign:"center",padding:"10px 0"},tableContainer:{maxHeight:200},stickyHeader:{backgroundColor:"#fff"},actionsTitle:{fontWeight:600,color:"#000",fontSize:16,alignSelf:"center"},tableBlock:{marginTop:15},filterField:{width:375,fontWeight:600,"& .input":{"&::placeholder":{fontWeight:600,color:"#000"}}}},Ae),De))}))(Ci((function(e){var t=e.classes,n=e.selectedPolicy,r=void 0===n?[]:n,o=e.setSelectedPolicy,s=e.setModalErrorSnackMessage,l=Object(c.useState)([]),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),p=Object(b.a)(m,2),h=p[0],O=p[1],g=Object(c.useState)(""),v=Object(b.a)(g,2),C=v[0],k=v[1],w=Object(c.useCallback)((function(){O(!0),me.invoke("GET","/api/v1/policies?limit=1000").then((function(e){var t=null===e.policies?[]:e.policies;O(!1),j(t.sort(ti))})).catch((function(e){O(!1),s(e)}))}),[s]);Object(c.useEffect)((function(){O(!0)}),[]),Object(c.useEffect)((function(){h&&w()}),[h,w]);var N=u.filter((function(e){return e.name.includes(C)}));return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)(S.a,{className:t.paper,children:[h&&Object(a.jsx)(y.a,{}),u.length>0?Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)("span",{className:t.actionsTitle,children:"Assign Policies"}),Object(a.jsx)(f.a,{placeholder:"Filter by Policy",className:t.filterField,id:"search-resource",label:"",InputProps:{startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})},onChange:function(e){k(e.target.value)}})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.tableBlock,children:Object(a.jsx)(ln,{columns:[{label:"Policy",elementKey:"name"}],onSelect:function(e){var t=e.target,n=t.value,a=t.checked,c=Object(He.a)(r);a?c.push(n):c=c.filter((function(e){return e!==n})),c=c.filter((function(e){return""!==e})),o(c)},selectedItems:r,isLoading:h,records:N,entityName:"Policies",idField:"name",customPaperHeight:t.multiSelectTable})})]}):Object(a.jsx)("div",{className:t.noFound,children:"No Policies Available"})]})})})}))),ki={setModalErrorSnackMessage:G},wi=Object(s.b)(null,ki),Ni=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},ke),{},{buttonContainer:{textAlign:"right"}}))}))(wi((function(e){var t=e.classes,n=e.closeModalAndRefresh,i=e.selectedUser,r=e.selectedGroup,o=e.setModalErrorSnackMessage,s=e.open,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)([]),p=Object(b.a)(m,2),h=p[0],O=p[1],f=Object(c.useState)([]),v=Object(b.a)(f,2),C=v[0],S=v[1];Object(c.useEffect)((function(){if(s){if(null!==r)return void(r&&me.invoke("GET","/api/v1/groups/".concat(r)).then((function(e){var t=Z()(e,"policy","");O(t.split(",")),S(t.split(","))})).catch((function(e){o(e),j(!1)})));var e=Z()(i,"policy","");O(e.split(",")),S(e.split(","))}}),[s,r,i]);var k=Z()(i,"accessKey","");return Object(a.jsxs)(pn,{onClose:function(){n()},modalOpen:s,title:"Set Policies",children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Vn,{label:"Selected ".concat(null!==r?"Group":"User"),content:null!==r?r:k})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Vn,{label:"Current Policy",content:h.join(", ")})}),Object(a.jsx)(Si,{selectedPolicy:C,setSelectedPolicy:S}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:function(){S(h)},children:"Clear"}),Object(a.jsx)(g.a,{type:"button",variant:"contained",color:"primary",disabled:u,onClick:function(){var e="user",t=null;null!==r?(e="group",t=r):null!==i&&(t=i.accessKey),j(!0),me.invoke("PUT","/api/v1/set-policy/".concat(C),{entityName:t,entityType:e}).then((function(){j(!1),n()})).catch((function(e){j(!1),o(e)}))},children:"Save"})]}),u&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})}))),Ti={setErrorSnackMessage:q},Ei=Object(s.b)(null,Ti),_i=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}}},Ae),Ie),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Ei((function(e){var t=e.classes,n=e.setErrorSnackMessage,r=Object(c.useState)([]),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!1),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(!1),h=Object(b.a)(p,2),O=h[0],v=h[1],y=Object(c.useState)(!1),C=Object(b.a)(y,2),S=C[0],k=C[1],w=Object(c.useState)(null),N=Object(b.a)(w,2),T=N[0],E=N[1],_=Object(c.useState)(!1),A=Object(b.a)(_,2),I=A[0],M=A[1],L=Object(c.useState)(""),D=Object(b.a)(L,2),B=D[0],F=D[1],R=Object(c.useState)([]),P=Object(b.a)(R,2),z=P[0],K=P[1],U=Object(c.useState)(!1),W=Object(b.a)(U,2),q=W[0],V=W[1],G=Object(c.useCallback)((function(){m(!0),me.invoke("GET","/api/v1/users").then((function(e){var t=null===e.users?[]:e.users;m(!1),l(t.sort(ei))})).catch((function(e){m(!1),n(e)}))}),[m,l,n]);Object(c.useEffect)((function(){G()}),[G]);var H=s.filter((function(e){return e.accessKey.includes(B)})),Y=atob(localStorage.getItem("userLoggedIn")||""),Q=[{type:"view",onClick:function(e){v(!0),E(e)}},{type:"description",onClick:function(e){V(!0),E(e)}},{type:"delete",onClick:function(e){k(!0),E(e)},hideButtonFunction:function(e){return e===Y}}];return Object(a.jsxs)(i.a.Fragment,{children:[O&&Object(a.jsx)(hi,{open:O,selectedUser:T,closeModalAndRefresh:function(){v(!1),G()}}),q&&Object(a.jsx)(Ni,{open:q,selectedUser:T,selectedGroup:null,closeModalAndRefresh:function(){V(!1),G()}}),S&&Object(a.jsx)(fi,{deleteOpen:S,selectedUser:T,closeDeleteModalAndRefresh:function(e){!function(e){k(!1),e&&G()}(e)}}),I&&Object(a.jsx)(yi,{open:I,checkedUsers:z,closeModalAndRefresh:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];M(!1),e&&K([])}(e)}}),Object(a.jsx)(zn,{label:"Users"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(f.a,{placeholder:"Search Users",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})},onChange:function(e){F(e.target.value)}}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(di.a,{}),disabled:z.length<=0,onClick:function(){z.length>0&&M(!0)},children:"Add to Group"}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){v(!0),E(null)},children:"Create User"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{itemActions:Q,columns:[{label:"Access Key",elementKey:"accessKey"}],onSelect:function(e){var t=e.target,n=t.value,a=t.checked,c=Object(He.a)(z);return a?c.push(n):c=c.filter((function(e){return e!==n})),K(c),c},selectedItems:z,isLoading:j,records:H,entityName:"Users",idField:"accessKey"})})]})})]})}))),Ai={setModalErrorSnackMessage:G},Ii=Object(s.b)(null,Ai),Mi=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column",paddingTop:15,boxShadow:"none"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},noFound:{textAlign:"center",padding:"10px 0"},tableContainer:{maxHeight:200},stickyHeader:{backgroundColor:"#fff"},actionsTitle:{fontWeight:600,color:"#000",fontSize:16,alignSelf:"center"},tableBlock:{marginTop:15},filterField:{width:375,fontWeight:600,"& .input":{"&::placeholder":{fontWeight:600,color:"#000"}}}},Ae),De))}))(Ii((function(e){var t=e.classes,n=e.selectedUsers,r=e.setSelectedUsers,o=e.editMode,s=void 0!==o&&o,l=e.setModalErrorSnackMessage,d=Object(c.useState)([]),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(!1),h=Object(b.a)(p,2),O=h[0],g=h[1],v=Object(c.useState)(""),C=Object(b.a)(v,2),k=C[0],w=C[1],N=Object(c.useCallback)((function(){me.invoke("GET","/api/v1/users").then((function(e){var t=Z()(e,"users",[]);t||(t=[]),m(t.sort(ei)),g(!1)})).catch((function(e){l(e),g(!1)}))}),[l]);Object(c.useEffect)((function(){g(!0)}),[]),Object(c.useEffect)((function(){O&&N()}),[O,N]);var T=n||[],E=j.filter((function(e){return e.accessKey.includes(k)}));return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)(S.a,{className:t.paper,children:[O&&Object(a.jsx)(y.a,{}),null!=j&&j.length>0?Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)("span",{className:t.actionsTitle,children:s?"Edit Members":"Assign Users"}),Object(a.jsx)(f.a,{placeholder:"Filter Users",className:t.filterField,id:"search-resource",label:"",InputProps:{startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})},onChange:function(e){w(e.target.value)}})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.tableBlock,children:Object(a.jsx)(ln,{columns:[{label:"Access Key",elementKey:"accessKey"}],onSelect:function(e){var t=e.target,n=t.value,a=t.checked,c=Object(He.a)(T);return a?c.push(n):c=c.filter((function(e){return e!==n})),r(c),c},selectedItems:T,isLoading:O,records:E,entityName:"Users",idField:"accessKey",customPaperHeight:t.multiSelectTable})})]}):Object(a.jsx)("div",{className:t.noFound,children:"No Users Available"})]})})})}))),Li={setModalErrorSnackMessage:G},Di=Object(s.b)(null,Li),Bi=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"}},ke))}))(Di((function(e){var t=e.open,n=e.selectedGroup,r=e.closeModalAndRefresh,o=e.classes,s=e.setModalErrorSnackMessage,l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),p=Object(b.a)(m,2),h=p[0],O=p[1],f=Object(c.useState)(!1),v=Object(b.a)(f,2),C=v[0],S=v[1],k=Object(c.useState)([]),w=Object(b.a)(k,2),N=w[0],T=w[1],E=Object(c.useState)(!1),_=Object(b.a)(E,2),A=_[0],I=_[1],M=Object(c.useState)(!1),L=Object(b.a)(M,2),D=L[0],B=L[1];Object(c.useEffect)((function(){null!==n?I(!0):(j(""),T([]))}),[n]),Object(c.useEffect)((function(){B(""!==u.trim())}),[u,N]),Object(c.useEffect)((function(){if(C){null!==n?me.invoke("PUT","/api/v1/groups/".concat(u),{group:u,members:N,status:h?"enabled":"disabled"}).then((function(e){S(!1),r()})).catch((function(e){S(!1),s(e)})):me.invoke("POST","/api/v1/groups",{group:u,members:N}).then((function(e){S(!1),r()})).catch((function(e){S(!1),s(e)}))}}),[C,u,N,h,n,r,s]),Object(c.useEffect)((function(){if(n&&A){me.invoke("GET","/api/v1/groups/".concat(n)).then((function(e){O("enabled"===e.status),j(e.name),T(e.members)})).catch((function(e){s(e),I(!1)}))}}),[A,n,s]);return Object(a.jsxs)(pn,{modalOpen:t,onClose:r,title:null!==n?"Edit Group":"Create Group",children:[null!==n&&Object(a.jsx)("div",{className:o.floatingEnabled,children:Object(a.jsx)(Ln,{indicatorLabels:["Enabled","Disabled"],checked:h,value:"group_enabled",id:"group-status",name:"group-status",onChange:function(e){O(e.target.checked)},switchOnly:!0})}),Object(a.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),S(!0)},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:o.formScrollable,children:[null===n?Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"group-name",name:"group-name",label:"Group Name",value:u,onChange:function(e){j(e.target.value)}})})}):Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(Vn,{label:"Group Name",content:n})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Mi,{selectedUsers:N,setSelectedUsers:T,editMode:null!==n})})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:o.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:o.clearButton,onClick:function(){null===n&&j(""),T([])},children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:C||!D,children:"Save"})]}),C&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})]})}))),Fi={setErrorSnackMessage:q},Ri=Object(s.b)(null,Fi),Pi=Ri((function(e){var t=e.selectedGroup,n=e.deleteOpen,r=e.closeDeleteModalAndRefresh,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];Object(c.useEffect)((function(){if(d){t&&me.invoke("DELETE","/api/v1/groups/".concat(t)).then((function(){u(!1),r(!0)})).catch((function(e){u(!1),o(e)}))}}),[d,t,r,o]);var j=function(){r(!1)};return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(dn.a,{open:n,onClose:j,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete User"}),Object(a.jsxs)(bn.a,{children:[d&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to delete group ",Object(a.jsx)("b",{children:t}),"?"]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:j,color:"primary",disabled:d,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){u(!0)},color:"secondary",autoFocus:!0,children:"Delete"})]})]})})})),zi={setErrorSnackMessage:q},Ki=Object(s.b)(null,zi),Ui=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},wrapCell:{maxWidth:"200px",whiteSpace:"normal",wordWrap:"break-word"},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}}},Ae),Ie),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Ki((function(e){var t=e.classes,n=e.setErrorSnackMessage,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(null),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(!1),h=Object(b.a)(p,2),O=h[0],v=h[1],y=Object(c.useState)(!1),C=Object(b.a)(y,2),S=C[0],k=C[1],w=Object(c.useState)([]),N=Object(b.a)(w,2),T=N[0],E=N[1],_=Object(c.useState)(""),A=Object(b.a)(_,2),I=A[0],M=A[1],L=Object(c.useState)(!1),D=Object(b.a)(L,2),B=D[0],F=D[1];Object(c.useEffect)((function(){k(!0)}),[]),Object(c.useEffect)((function(){k(!0)}),[]),Object(c.useEffect)((function(){if(S){me.invoke("GET","/api/v1/groups").then((function(e){var t=[];null!==e.groups&&(t=e.groups.sort(ni)),E(t),k(!1)})).catch((function(e){n(e),k(!1)}))}}),[S,n]);var R=T.filter((function(e){return e.includes(I)})),P=[{type:"view",onClick:function(e){l(!0),m(e)}},{type:"description",onClick:function(e){F(!0),m(e)}},{type:"delete",onClick:function(e){v(!0),m(e)}}];return Object(a.jsxs)(i.a.Fragment,{children:[s&&Object(a.jsx)(Bi,{open:s,selectedGroup:j,closeModalAndRefresh:function(){l(!1),k(!0)}}),O&&Object(a.jsx)(Pi,{deleteOpen:O,selectedGroup:j,closeDeleteModalAndRefresh:function(e){v(!1),e&&k(!0)}}),F&&Object(a.jsx)(Ni,{open:B,selectedGroup:j,selectedUser:null,closeModalAndRefresh:function(){F(!1)}}),Object(a.jsx)(zn,{label:"Groups"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(f.a,{placeholder:"Search Groups",className:t.searchField,id:"search-resource",label:"",InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})},onChange:function(e){M(e.target.value)}}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){m(null),l(!0)},children:"Create Group"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{itemActions:P,columns:[{label:"Name",elementKey:""}],isLoading:S,records:R,entityName:"Groups",idField:""})})]})})]})}))),Wi="notify_postgres",qi="notify_mysql",Vi="notify_kafka",Gi="notify_amqp",Hi="notify_mqtt",Yi="notify_redis",Qi="notify_nats",Zi="notify_elasticsearch",Ji="notify_webhooks",$i="notify_nsq",Xi=[{configuration_id:"region",configuration_label:"Edit Region Configuration"},{configuration_id:"cache",configuration_label:"Edit Cache Configuration"},{configuration_id:"compression",configuration_label:"Edit Compression Configuration"},{configuration_id:"etcd",configuration_label:"Edit Etcd Configuration"},{configuration_id:"identity_openid",configuration_label:"Edit Identity Openid Configuration"},{configuration_id:"identity_ldap",configuration_label:"Edit Identity LDAP Configuration"},{configuration_id:"logger_webhook",configuration_label:"Edit Logger Webhook Configuration"},{configuration_id:"audit_webhook",configuration_label:"Edit Audit Webhook Configuration"}],er={region:[{name:"name",required:!0,label:"Server Location",tooltip:'Name of the location of the server e.g. "us-west-rack2"',type:"string",placeholder:"e.g. us-west-rack-2"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",placeholder:"Enter Comment"}],cache:[{name:"drives",required:!0,label:"Drives",tooltip:'Mountpoints e.g. "/optane1" or "/optane2", you can write one per field',type:"csv",placeholder:"Enter Mount Point"},{name:"expiry",required:!1,label:"Expiry",tooltip:'Cache expiry duration in days e.g. "90"',type:"number",placeholder:"Enter Number of Days"},{name:"quota",required:!1,label:"Quota",tooltip:'Limit cache drive usage in percentage e.g. "90"',type:"number",placeholder:"Enter in %"},{name:"exclude",required:!1,label:"Exclude",tooltip:'Wildcard exclusion patterns e.g. "bucket/*.tmp" or "*.exe", you can write one per field',type:"csv",placeholder:"Enter Wildcard Exclusion Patterns"},{name:"after",required:!1,label:"After",tooltip:"Minimum number of access before caching an object",type:"number",placeholder:"Enter Number of Attempts"},{name:"watermark_low",required:!1,label:"Watermark Low",tooltip:"Watermark Low",type:"number",placeholder:"Enter Watermark Low"},{name:"watermark_high",required:!1,label:"Watermark High",tooltip:"Watermark High",type:"number",placeholder:"Enter Watermark High"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",multiline:!0,placeholder:"Enter Comment"}],compression:[{name:"extensions",required:!1,label:"Extensions",tooltip:'Extensions to compress e.g. ".txt",".log" or ".csv", you can write one per field',type:"csv",placeholder:"Enter an Extension",withBorder:!0},{name:"mime_types",required:!1,label:"Mime Types",tooltip:'Mime types e.g. "text/*","application/json" or "application/xml", you can write one per field',type:"csv",placeholder:"Enter a Mime Type",withBorder:!0}],etcd:[{name:"endpoints",required:!0,label:"Endpoints",tooltip:'List of etcd endpoints e.g. "http://localhost:2379", you can write one per field',type:"csv",placeholder:"Enter Endpoint"},{name:"path_prefix",required:!1,label:"Path Prefix",tooltip:'namespace prefix to isolate tenants e.g. "customer1/"',type:"string",placeholder:"Enter Path Prefix"},{name:"coredns_path",required:!1,label:"Coredns Path",tooltip:'Shared bucket DNS records, default is "/skydns"',type:"string",placeholder:"Enter Coredns Path"},{name:"client_cert",required:!1,label:"Client Cert",tooltip:"Client cert for mTLS authentication",type:"string",placeholder:"Enter Client Cert"},{name:"client_cert_key",required:!1,label:"Client Cert Key",tooltip:"Client cert key for mTLS authentication",type:"string",placeholder:"Enter Client Cert Key"},{name:"comment",required:!1,label:"Comment",tooltip:"You can add a comment to this setting",type:"comment",multiline:!0,placeholder:"Enter Comment"}],identity_openid:[{name:"config_url",required:!1,label:"Config URL",tooltip:"Config URL for Client ID configuration",type:"string",placeholder:"Enter Config URL"},{name:"client_id",required:!1,label:"Client ID",type:"string",placeholder:"Enter Client ID"},{name:"claim_name",required:!1,label:"Claim Name",tooltip:"Claim Name",type:"string",placeholder:"Enter Claim Name"},{name:"claim_prefix",required:!1,label:"Claim Prefix",tooltip:"Claim Prefix",type:"string",placeholder:"Enter Claim Prefix"}],identity_ldap:[{name:"server_addr",required:!0,label:"Server Addr",tooltip:'AD/LDAP server address e.g. "myldapserver.com:636"',type:"string",placeholder:"Enter Server Address"},{name:"username_format",required:!0,label:"Username Format",tooltip:'List of username bind DNs e.g. "uid=%s","cn=accounts","dc=myldapserver" or "dc=com", you can write one per field',type:"csv",placeholder:"Enter Username Format"},{name:"username_search_filter",required:!0,label:"Username Search Filter",tooltip:'User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"',type:"string",placeholder:"Enter Username Search Filter"},{name:"group_search_filter",required:!0,label:"Group Search Filter",tooltip:'Search filter for groups e.g. "(&(objectclass=groupOfNames)(memberUid=%s))"',type:"string",placeholder:"Enter Group Search Filter"},{name:"username_search_base_dn",required:!1,label:"Username Search Base DN",tooltip:"List of username search DNs, you can write one per field",type:"csv",placeholder:"Enter Username Search Base DN"},{name:"group_name_attribute",required:!1,label:"Group Name Attribute",tooltip:'Search attribute for group name e.g. "cn"',type:"string",placeholder:"Enter Group Name Attribute"},{name:"sts_expiry",required:!1,label:"STS Expiry",tooltip:'temporary credentials validity duration in s,m,h,d. Default is "1h"',type:"string",placeholder:"Enter STS Expiry"},{name:"tls_skip_verify",required:!1,label:"TLS Skip Verify",tooltip:'Trust server TLS without verification, defaults to "off" (verify)',type:"on|off"},{name:"server_insecure",required:!1,label:"Server Insecure",tooltip:'Allow plain text connection to AD/LDAP server, defaults to "off"',type:"on|off"},{name:"comment",required:!1,label:"Comment",tooltip:"Optionally add a comment to this setting",type:"comment",placeholder:"Enter Comment"}],logger_webhook:[{name:"endpoint",required:!0,label:"Endpoint",type:"string",placeholder:"Enter Endpoint"},{name:"auth_token",required:!0,label:"Auth Token",type:"string",placeholder:"Enter Auth Token"}],audit_webhook:[{name:"endpoint",required:!0,label:"Endpoint",type:"string",placeholder:"Enter Endpoint"},{name:"auth_token",required:!0,label:"Auth Token",type:"string",placeholder:"Enter Auth Token"}]},tr=[{name:"queue-dir",label:"Queue Directory",required:!0,tooltip:"staging dir for undelivered messages e.g. '/home/events'",type:"string",placeholder:"Enter Queue Directory"},{name:"queue-limit",label:"Queue Limit",required:!1,tooltip:"maximum limit for undelivered messages, defaults to '10000'",type:"number",placeholder:"Enter Queue Limit"},{name:"comment",label:"Comment",required:!1,type:"comment",placeholder:"Enter Comment"}],nr=(Pa={},Object(ge.a)(Pa,Vi,[{name:"brokers",label:"Brokers",required:!0,tooltip:"Comma separated list of Kafka broker addresses",type:"string",placeholder:"Enter Brokers"},{name:"topic",label:"Topic",tooltip:"Kafka topic used for bucket notifications",type:"string",placeholder:"Enter Topic"},{name:"sasl_username",label:"SASL Username",tooltip:"Username for SASL/PLAIN or SASL/SCRAM authentication",type:"string",placeholder:"Enter SASL Username"},{name:"sasl_password",label:"SASL Password",tooltip:"Password for SASL/PLAIN or SASL/SCRAM authentication",type:"string",placeholder:"Enter SASL Password"},{name:"sasl_mechanism",label:"SASL Mechanism",tooltip:"SASL authentication mechanism, default 'PLAIN'",type:"string"},{name:"tls_client_auth",label:"TLS Client Auth",tooltip:"Client Auth determines the Kafka server's policy for TLS client auth",type:"string",placeholder:"Enter TLS Client Auth"},{name:"sasl",label:"SASL",tooltip:"Set to 'on' to enable SASL authentication",type:"on|off"},{name:"tls",label:"TLS",tooltip:"Set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS skip verify",tooltip:'Trust server TLS without verification, defaults to "on" (verify)',type:"on|off"},{name:"client_tls_cert",label:"client TLS cert",tooltip:"Path to client certificate for mTLS auth",type:"path",placeholder:"Enter TLS Client Cert"},{name:"client_tls_key",label:"client TLS key",tooltip:"Path to client key for mTLS auth",type:"path",placeholder:"Enter TLS Client Key"},{name:"version",label:"Version",tooltip:"Specify the version of the Kafka cluster e.g '2.2.0'",type:"string",placeholder:"Enter Kafka Version"}].concat(tr)),Object(ge.a)(Pa,Gi,[{name:"url",required:!0,label:"URL",tooltip:"AMQP server endpoint e.g. `amqp://myuser:mypassword@localhost:5672`",type:"url"},{name:"exchange",label:"Exchange",tooltip:"Name of the AMQP exchange",type:"string",placeholder:"Enter Exchange"},{name:"exchange_type",label:"Exchange Type",tooltip:"AMQP exchange type",type:"string",placeholder:"Enter Exchange Type"},{name:"routing_key",label:"Routing Key",tooltip:"Routing key for publishing",type:"string",placeholder:"Enter Routing Key"},{name:"mandatory",label:"Mandatory",tooltip:"Quietly ignore undelivered messages when set to 'off', default is 'on'",type:"on|off"},{name:"durable",label:"Durable",tooltip:"Persist queue across broker restarts when set to 'on', default is 'off'",type:"on|off"},{name:"no_wait",label:"No Wait",tooltip:"Non-blocking message delivery when set to 'on', default is 'off'",type:"on|off"},{name:"internal",label:"Internal",tooltip:"Set to 'on' for exchange to be not used directly by publishers, but only when bound to other exchanges",type:"on|off"},{name:"auto_deleted",label:"Auto Deleted",tooltip:"Auto delete queue when set to 'on', when there are no consumers",type:"on|off"},{name:"delivery_mode",label:"Delivery Mode",tooltip:"Set to '1' for non-persistent or '2' for persistent queue",type:"number",placeholder:"Enter Delivery Mode"}].concat(tr)),Object(ge.a)(Pa,Yi,[{name:"address",required:!0,label:"Address",tooltip:"Redis server's address. For example: `localhost:6379`",type:"address",placeholder:"Enter Address"},{name:"key",required:!0,label:"Key",tooltip:"Redis key to store/update events, key is auto-created",type:"string",placeholder:"Enter Key"},{name:"password",label:"Password",tooltip:"Redis server password",type:"string",placeholder:"Enter Password"}].concat(tr)),Object(ge.a)(Pa,Hi,[{name:"broker",required:!0,label:"Broker",tooltip:"MQTT server endpoint e.g. `tcp://localhost:1883`",type:"uri",placeholder:"Enter Brokers"},{name:"topic",required:!0,label:"Topic",tooltip:"name of the MQTT topic to publish",type:"string",placeholder:"Enter Topic"},{name:"username",label:"Username",tooltip:"MQTT username",type:"string",placeholder:"Enter Username"},{name:"password",label:"Password",tooltip:"MQTT password",type:"string",placeholder:"Enter Password"},{name:"qos",label:"QOS",tooltip:"Set the quality of service priority, defaults to '0'",type:"number",placeholder:"Enter QOS"},{name:"keep_alive_interval",label:"Keep Alive Interval",tooltip:"Keep-alive interval for MQTT connections in s,m,h,d",type:"duration",placeholder:"Enter Keep Alive Internal"},{name:"reconnect_interval",label:"Reconnect Interval",tooltip:"Reconnect interval for MQTT connections in s,m,h,d",type:"duration",placeholder:"Enter Reconnect Interval"}].concat(tr)),Object(ge.a)(Pa,Qi,[{name:"address",required:!0,label:"Address",tooltip:"NATS server address e.g. '0.0.0.0:4222'",type:"address",placeholder:"Enter Address"},{name:"subject",required:!0,label:"Subject",tooltip:"NATS subscription subject",type:"string",placeholder:"Enter NATS Subject"},{name:"username",label:"Username",tooltip:"NATS username",type:"string",placeholder:"Enter NATS Username"},{name:"password",label:"Password",tooltip:"NATS password",type:"string",placeholder:"Enter NATS password"},{name:"token",label:"Token",tooltip:"NATS token",type:"string",placeholder:"Enter NATS token"},{name:"tls",label:"TLS",tooltip:"Set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS Skip Verify",tooltip:'Trust server TLS without verification, defaults to "on" (verify)',type:"on|off"},{name:"ping_interval",label:"Ping Interval",tooltip:"Client ping commands interval in s,m,h,d. Disabled by default",type:"duration",placeholder:"Enter Ping Interval"},{name:"streaming",label:"Streaming",tooltip:"Set to 'on', to use streaming NATS server",type:"on|off"},{name:"streaming_async",label:"Streaming async",tooltip:"Set to 'on', to enable asynchronous publish",type:"on|off"},{name:"streaming_max_pub_acks_in_flight",label:"Streaming max publish ACKS in flight",tooltip:"Number of messages to publish without waiting for ACKs",type:"number",placeholder:"Enter Streaming in flight value"},{name:"streaming_cluster_id",label:"Streaming Cluster ID",tooltip:"Unique ID for NATS streaming cluster",type:"string",placeholder:"Enter Streaming Cluster ID"},{name:"cert_authority",label:"Cert Authority",tooltip:"Path to certificate chain of the target NATS server",type:"string",placeholder:"Enter Cert Authority"},{name:"client_cert",label:"Client Cert",tooltip:"Client cert for NATS mTLS auth",type:"string",placeholder:"Enter Client Cert"},{name:"client_key",label:"Client Key",tooltip:"Client cert key for NATS mTLS auth",type:"string",placeholder:"Enter Client Key"}].concat(tr)),Object(ge.a)(Pa,Zi,[{name:"url",required:!0,label:"URL",tooltip:"Elasticsearch server's address, with optional authentication info",type:"url",placeholder:"Enter URL"},{name:"index",required:!0,label:"Index",tooltip:"Elasticsearch index to store/update events, index is auto-created",type:"string",placeholder:"Enter Index"},{name:"format",required:!0,label:"Format",tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",type:"enum",placeholder:"Enter Format"}].concat(tr)),Object(ge.a)(Pa,Ji,[{name:"endpoint",required:!0,label:"Endpoint",tooltip:"webhook server endpoint e.g. http://localhost:8080/minio/events",type:"url",placeholder:"Enter Endpoint"},{name:"auth_token",label:"Auth Token",tooltip:"opaque string or JWT authorization token",type:"string",placeholder:"Enter auth_token"}].concat(tr)),Object(ge.a)(Pa,$i,[{name:"nsqd_address",required:!0,label:"NSQD Address",tooltip:"NSQ server address e.g. '127.0.0.1:4150'",type:"address",placeholder:"Enter nsqd_address"},{name:"topic",required:!0,label:"Topic",tooltip:"NSQ topic",type:"string",placeholder:"Enter Topic"},{name:"tls",label:"TLS",tooltip:"set to 'on' to enable TLS",type:"on|off"},{name:"tls_skip_verify",label:"TLS Skip Verify",tooltip:'trust server TLS without verification, defaults to "on" (verify)',type:"on|off"}].concat(tr)),Pa),ar=function(e){return e.filter((function(e){return""!==e.value}))},cr=n(102),ir=n.n(cr),rr=function(){return Object(a.jsx)(tt.a,{viewBox:"0 0 12 12",children:Object(a.jsx)("path",{fill:"#081c42",className:"a",d:"M-13160.269,1885.114h-3.235v-4.381h-4.382V1877.5h4.382v-4.381h3.235v4.381h4.383v3.238h-4.383v4.38Z",transform:"translate(13167.886 -1873.114)"})})},or=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Se),we),{},{inputWithBorder:{border:"1px solid #EAEAEA",padding:15,height:150,overflowY:"auto",position:"relative",marginTop:15},labelContainer:{display:"flex"}}))}))((function(e){var t=e.elements,n=e.name,r=e.label,o=e.tooltip,s=void 0===o?"":o,l=e.commonPlaceholder,d=void 0===l?"":l,u=e.onChange,j=e.withBorder,m=void 0!==j&&j,p=e.classes,h=Object(c.useState)([""]),O=Object(b.a)(h,2),g=O[0],f=O[1],v=Object(c.createRef)();Object(c.useEffect)((function(){if(1===g.length&&""===g[0]&&t&&""!==t){var e=t.split(",");e.push(""),f(e)}}),[t,g]),Object(c.useEffect)((function(){if(g.length>1){var e=v.current;e&&e.scrollIntoView(!1)}}),[g,v]);var y=Object(c.useRef)(!0);Object(c.useLayoutEffect)((function(){y.current?y.current=!1:S()}),[g]);var C=function(e){e.persist();var t=Object(He.a)(g);t[Z()(e.target,"dataset.index",0)]=e.target.value,f(t)},S=ir()((function(){var e=g.filter((function(e){return""!==e.trim()})).join(",");u(e)}),500),k=g.map((function(e,t){return Object(a.jsx)(gn,{id:"".concat(n,"-").concat(t.toString()),label:"",name:"".concat(n,"-").concat(t.toString()),value:g[t],onChange:C,index:t,placeholder:d,overlayIcon:t===g.length-1?Object(a.jsx)(rr,{}):null,overlayAction:function(){!function(e){if(""!==e[e.length-1].trim()){var t=Object(He.a)(e);t.push(""),f(t)}}(g)}},"csv-".concat(n,"-").concat(t.toString()))}));return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:p.fieldContainer,children:[Object(a.jsxs)(tn.a,{className:p.inputLabel,children:[Object(a.jsx)("span",{children:r}),""!==s&&Object(a.jsx)("div",{className:p.tooltipContainer,children:Object(a.jsx)(nn.a,{title:s,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:p.tooltip})})})})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:"".concat(m?p.inputWithBorder:""),children:[k,Object(a.jsx)("div",{ref:v})]})]})})})),sr=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Se),we),{},{inputLabel:Object(j.a)(Object(j.a)({},Se.inputLabel),{},{marginBottom:16,fontSize:14}),textBoxContainer:{flexGrow:1,position:"relative"},errorState:{color:"#b53b4b",fontSize:14,position:"absolute",top:7,right:7},cssOutlinedInput:{borderColor:"#9C9C9C",padding:16},rootContainer:{"& .MuiOutlinedInput-inputMultiline":Object(j.a)(Object(j.a)({},Se.inputLabel),{},{fontSize:13,minHeight:150})}}))}))((function(e){var t=e.label,n=e.onChange,c=e.value,r=e.id,o=e.name,s=e.disabled,l=void 0!==s&&s,d=e.tooltip,u=void 0===d?"":d,b=e.index,j=void 0===b?0:b,m=e.error,p=void 0===m?"":m,h=e.required,O=void 0!==h&&h,g=e.placeholder,v=void 0===g?"":g,y=e.classes,C={"data-index":j};return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:"".concat(y.fieldContainer," ").concat(""!==p?y.errorInField:""),children:[""!==t&&Object(a.jsxs)(tn.a,{htmlFor:r,className:y.inputLabel,children:[Object(a.jsxs)("span",{children:[t,O?"*":""]}),""!==u&&Object(a.jsx)("div",{className:y.tooltipContainer,children:Object(a.jsx)(nn.a,{title:u,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:y.tooltip})})})})]}),Object(a.jsx)("div",{className:y.textBoxContainer,children:Object(a.jsx)(f.a,{id:r,name:o,fullWidth:!0,value:c,disabled:l,onChange:n,multiline:!0,inputProps:C,error:""!==p,helperText:p,placeholder:v,InputLabelProps:{shrink:!0},InputProps:{classes:{notchedOutline:y.cssOutlinedInput,root:y.rootContainer}},variant:"outlined"})})]})})})),lr=function(e,t,n){var a="on|off"===t?"false":"";if(n.length>0){var c=n.find((function(t){return t.key===e}));c&&(a=c.value)}return a},dr=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},ke))}))((function(e){var t=e.onChange,n=e.fields,i=e.defaultVals,r=(e.classes,Object(c.useState)([])),o=Object(b.a)(r,2),s=o[0],l=o[1],d=n||[],u=i||[];Object(c.useEffect)((function(){var e=[];n.forEach((function(t){var n={key:t.name,value:lr(t.name,t.type,u)};e.push(n)})),l(e)}),[n,i]),Object(c.useEffect)((function(){t(s)}),[s]);var j=function(e,t,n){var a=Object(He.a)(s);a[n]={key:e,value:t},l(a)},m=function(e,t){switch(e.type){case"on|off":var n=s[t]?s[t].value:"false";return Object(a.jsx)(Ln,{indicatorLabels:["On","Off"],onChange:function(n){var a=n.target.checked?"true":"false";j(e.name,a,t)},id:e.name,name:e.name,label:e.label,value:"switch_on",tooltip:e.tooltip,checked:"true"===n});case"csv":return Object(a.jsx)(or,{elements:s[t]?s[t].value:"",label:e.label,name:e.name,onChange:function(n){return j(e.name,n,t)},tooltip:e.tooltip,commonPlaceholder:e.placeholder,withBorder:!!e.withBorder});case"comment":return Object(a.jsx)(sr,{id:e.name,name:e.name,label:e.label,tooltip:e.tooltip,value:s[t]?s[t].value:"",onChange:function(n){return j(e.name,n.target.value,t)},placeholder:e.placeholder});default:return Object(a.jsx)(gn,{id:e.name,name:e.name,label:e.label,tooltip:e.tooltip,value:s[t]?s[t].value:"",onChange:function(n){return j(e.name,n.target.value,t)},multiline:!!e.multiline,placeholder:e.placeholder})}};return Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{xs:12,item:!0,children:d.map((function(e,t){return Object(a.jsx)(c.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,children:m(e,t)})},e.name)}))})})})),ur={serverNeedsRestart:K,setErrorSnackMessage:q},br=Object(s.b)(null,ur),jr=br(Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Se),Be),{},{strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"},logoButton:{height:"80px"},customTitle:Object(j.a)(Object(j.a)({},Be.customTitle),{},{marginTop:0})}))}))((function(e){var t=e.closeModalAndRefresh,n=e.serverNeedsRestart,i=e.selectedConfiguration,r=e.setErrorSnackMessage,o=e.classes,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(!0),f=Object(b.a)(O,2),v=f[0],C=f[1],S=Object(c.useState)([]),k=Object(b.a)(S,2),w=k[0],N=k[1];Object(c.useEffect)((function(){var e=Z()(i,"configuration_id",!1);e&&me.invoke("GET","/api/v1/configs/".concat(e)).then((function(e){var t=Z()(e,"key_values",[]);N(t)})).catch((function(e){C(!1),r(e)})),C(!1)}),[i,r]),Object(c.useEffect)((function(){if(p){var e={key_values:ar(d)};me.invoke("PUT","/api/v1/configs/".concat(i.configuration_id),e).then((function(){h(!1),n(!0),t()})).catch((function(e){h(!1),r(e)}))}}),[p,n,i,d,t,r]);var T=Object(c.useCallback)((function(e){u(e)}),[u]);return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:o.customTitle,children:i.configuration_label}),Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)("form",{noValidate:!0,onSubmit:function(e){e.preventDefault(),h(!0)},children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:o.settingsFormContainer,children:[v&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})}),Object(a.jsx)(dr,{fields:er[i.configuration_id],onChange:T,defaultVals:w})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:o.settingsButtonContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:p,children:"Save"})})]})})]})}))),mr=Object(N.a)((function(){return Object(k.a)({masterContainer:{overflowX:"hidden",overflowY:"auto"},sliderContainer:{width:"auto",transitionDuration:"0.3s",position:"relative"},slide:{float:"left"}})}))((function(e){var t=e.classes,n=e.slideOptions,i=e.currentSlide;return Object(a.jsx)(Dt.a,{children:function(e){var r=e.width,o=e.height,s=i*r,l=r*n.length;return Object(a.jsx)(c.Fragment,{children:Object(a.jsx)("div",{className:t.masterContainer,style:{width:r,height:o},children:Object(a.jsx)("div",{className:t.sliderContainer,style:{left:"-".concat(s,"px"),width:"".concat(l,"px")},children:n.map((function(e,n){return Object(a.jsx)("div",{className:t.slide,style:{width:r},children:e},"slide-panel-".concat(n.toString()))}))})})})}})})),pr=function(){return Object(a.jsx)(tt.a,{viewBox:"0 0 10.847 6.572",children:Object(a.jsxs)("g",{transform:"translate(-84.793 -81.193)",children:[Object(a.jsx)("line",{x2:"9.64",transform:"translate(85.5 84.5)",fill:"none",stroke:"#000",strokeLinecap:"round",strokeWidth:"1"}),Object(a.jsx)("line",{y1:"2.558",x2:"2.645",transform:"translate(85.5 81.9)",fill:"none",stroke:"#000",strokeLinecap:"round",strokeWidth:"1"}),Object(a.jsx)("line",{x2:"2.645",y2:"2.558",transform:"translate(85.5 84.5)",fill:"none",stroke:"#000",strokeLinecap:"round",strokeWidth:"1"})]})})},hr={configuration_id:"",configuration_label:""},Or=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},iconText:{lineHeight:"24px"},customConfigurationPage:{height:"calc(100vh - 324px)",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},Ie),Ae),Be),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=Object(c.useState)(hr),i=Object(b.a)(n,2),r=i[0],o=i[1],s=Object(c.useState)(0),l=Object(b.a)(s,2),d=l[0],j=l[1],m=[{type:"edit",onClick:function(e){var t=Z()(e,"url","");""!==t?u.push(t):(j(1),o(e))}}];return Object(a.jsx)(c.Fragment,{children:Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("div",{className:t.settingsOptionsContainer,children:Object(a.jsx)(mr,{slideOptions:[Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.customTitle,children:"Configuration Types"}),Object(a.jsx)(ln,{itemActions:m,columns:[{label:"Configuration",elementKey:"configuration_id"}],isLoading:!1,records:Xi,entityName:"Configurations",idField:"configuration_id",customPaperHeight:t.customConfigurationPage,noBackground:!0})]}),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(a.jsxs)("button",{onClick:function(){j(0),o(hr)},className:t.backButton,children:[Object(a.jsx)(pr,{}),"Back To Configurations"]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:1===d?Object(a.jsx)(jr,{closeModalAndRefresh:function(){j(0)},selectedConfiguration:r}):null})]})],currentSlide:d})})})})})})})),gr=n(198),fr=n(336),xr=n.n(fr),vr=[{actionTrigger:Wi,targetTitle:"Postgres SQL",logo:"/postgres.png"},{actionTrigger:Vi,targetTitle:"Kafka",logo:"/kafka.png"},{actionTrigger:Gi,targetTitle:"AMQP",logo:"/amqp.png"},{actionTrigger:Hi,targetTitle:"MQTT",logo:"/mqtt.png"},{actionTrigger:Yi,targetTitle:"Redis",logo:"/redis.png"},{actionTrigger:Qi,targetTitle:"NATS",logo:"/nats.png"},{actionTrigger:qi,targetTitle:"Mysql",logo:"/mysql.png"},{actionTrigger:Zi,targetTitle:"Elastic Search",logo:"/elasticsearch.png"},{actionTrigger:Ji,targetTitle:"Webhook",logo:""},{actionTrigger:$i,targetTitle:"NSQ",logo:""}],yr=n(51),Cr=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},ke))}))((function(e){var t=e.onChange,n=e.classes,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(""),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(""),h=Object(b.a)(p,2),O=h[0],g=h[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),y=v[0],C=v[1],S=Object(c.useState)(""),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),L=M[0],D=M[1],B=Object(c.useState)(" "),F=Object(b.a)(B,2),R=F[0],P=F[1],z=Object(c.useState)(""),K=Object(b.a)(z,2),U=K[0],W=K[1],q=Object(c.useState)("namespace"),V=Object(b.a)(q,2),G=V[0],H=V[1],Y=Object(c.useState)(""),Q=Object(b.a)(Y,2),Z=Q[0],J=Q[1],$=Object(c.useState)(""),X=Object(b.a)($,2),ee=X[0],te=X[1],ne=Object(c.useState)(""),ae=Object(b.a)(ne,2),ce=ae[0],ie=ae[1],re=Object(c.useCallback)((function(){var e="";return""!==O&&(e="".concat(e," host=").concat(O)),""!==y&&(e="".concat(e," dbname=").concat(y)),""!==_&&(e="".concat(e," user=").concat(_)),""!==L&&(e="".concat(e," password=").concat(L)),""!==w&&(e="".concat(e," port=").concat(w))," "!==R&&(e="".concat(e," sslmode=").concat(R)),(e="".concat(e," ")).trim()}),[O,y,_,L,w,R]);return Object(c.useEffect)((function(){""!==j&&t([{key:"connection_string",value:j},{key:"table",value:U},{key:"format",value:G},{key:"queue_dir",value:Z},{key:"queue_limit",value:ee},{key:"comment",value:ce}])}),[j,U,G,Z,ee,ce,t]),Object(c.useEffect)((function(){var e=re();m(e)}),[_,y,L,w,R,O,m,re]),Object(c.useEffect)((function(){if(s){var e=re();m(e)}else{var t=function(e,t){var n,a=[],c=Object(yr.a)(t);try{for(c.s();!(n=c.n()).done;){var i=n.value,r=e.indexOf(i+"=");-1!==r&&a.push(r)}}catch(h){c.e(h)}finally{c.f()}a.sort((function(e,t){return e-t}));for(var o=new Map,s=new Array(a.length),l=0;l<a.length;l++){var d=l+1;d<a.length?s[l]=e.substr(a[l],a[d]-a[l]):s[l]=e.substr(a[l])}for(var u=0,b=s;u<b.length;u++){var j=b[u];if(void 0!==j){var m=j.substr(0,j.indexOf("=")),p=j.substr(j.indexOf("=")+1).trim();o.set(m,p)}}return o}(j,["host","port","dbname","user","password","sslmode"]);g(t.get("host")?t.get("host")+"":""),N(t.get("port")?t.get("port")+"":""),C(t.get("dbname")?t.get("dbname")+"":""),A(t.get("user")?t.get("user")+"":""),D(t.get("password")?t.get("password")+"":""),P(t.get("sslmode")?t.get("sslmode")+"":" ")}}),[s]),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{label:"Manually Configure String",checked:s,id:"manualString",name:"manualString",onChange:function(e){l(e.target.checked)},value:"manualString",indicatorLabels:["On","Off"]})}),s?Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"connection-string",name:"connection_string",label:"Connection String",value:j,onChange:function(e){m(e.target.value)}})})}):Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:n.configureString,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"host",name:"host",label:"",placeholder:"Enter Host",value:O,onChange:function(e){g(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"db-name",name:"db-name",label:"",placeholder:"Enter DB Name",value:y,onChange:function(e){C(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"port",name:"port",label:"",placeholder:"Enter Port",value:w,onChange:function(e){N(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Sn,{value:R,label:"",id:"sslmode",name:"sslmode",onChange:function(e){void 0!==e.target.value&&P(e.target.value+"")},options:[{label:"Enter SSL Mode",value:" "},{label:"Require",value:"require"},{label:"Disable",value:"disable"},{label:"Verify CA",value:"verify-ca"},{label:"Verify Full",value:"verify-full"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"user",name:"user",label:"",placeholder:"Enter User",value:_,onChange:function(e){A(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"password",name:"password",label:"",type:"password",placeholder:"Enter Password",value:L,onChange:function(e){D(e.target.value)}})})]})}),Object(a.jsx)(Vn,{label:"Connection String",content:j}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"table",name:"table",label:"Table",placeholder:"Enter Table Name",value:U,tooltip:"DB table name to store/update events, table is auto-created",onChange:function(e){W(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:G,id:"format",name:"format",label:"Format",onChange:function(e){H(e.target.value)},tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",selectorOptions:[{label:"Namespace",value:"namespace"},{label:"Access",value:"access"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"queue-dir",name:"queue_dir",label:"Queue Dir",placeholder:"Enter Queue Directory",value:Z,tooltip:"staging dir for undelivered messages e.g. '/home/events'",onChange:function(e){J(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"queue-limit",name:"queue_limit",label:"Queue Limit",placeholder:"Enter Queue Limit",type:"number",value:ee,tooltip:"maximum limit for undelivered messages, defaults to '10000'",onChange:function(e){te(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(sr,{id:"comment",name:"comment",label:"Comment",placeholder:"Enter Comment",value:ce,onChange:function(e){ie(e.target.value)}})})]})})),Sr=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},ke))}))((function(e){var t=e.onChange,n=e.classes,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(""),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(""),h=Object(b.a)(p,2),O=h[0],g=h[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),y=v[0],C=v[1],S=Object(c.useState)(""),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),L=M[0],D=M[1],B=Object(c.useState)(""),F=Object(b.a)(B,2),R=F[0],P=F[1],z=Object(c.useState)("namespace"),K=Object(b.a)(z,2),U=K[0],W=K[1],q=Object(c.useState)(""),V=Object(b.a)(q,2),G=V[0],H=V[1],Y=Object(c.useState)(""),Q=Object(b.a)(Y,2),Z=Q[0],J=Q[1],$=Object(c.useState)(""),X=Object(b.a)($,2),ee=X[0],te=X[1],ne=Object(c.useCallback)((function(){return"".concat(_,":").concat(L,"@tcp(").concat(O,":").concat(w,")/").concat(y)}),[_,L,O,w,y]);Object(c.useEffect)((function(){""!==j&&t([{key:"dsn_string",value:j},{key:"table",value:R},{key:"format",value:U},{key:"queue_dir",value:G},{key:"queue_limit",value:Z},{key:"comment",value:ee}])}),[j,R,U,G,Z,ee,t]),Object(c.useEffect)((function(){var e=ne();m(e)}),[_,y,L,w,O,m,ne]);return Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{label:"Enter DNS String",checked:s,id:"checkedB",name:"checkedB",onChange:function(e){if(e.target.checked){var t=ne();m(t)}else{var n=function(e,t){for(var n,a=new Map,c=/(.*?):(.*?)@tcp\((.*?):(.*?)\)\/(.*?)$/gm;null!==(n=c.exec(e));)n.index===c.lastIndex&&c.lastIndex++,a.set("user",n[1]),a.set("password",n[2]),a.set("host",n[3]),a.set("port",n[4]),a.set("dbname",n[5]);return a}(j);g(n.get("host")?n.get("host")+"":""),N(n.get("port")?n.get("port")+"":""),C(n.get("dbname")?n.get("dbname")+"":""),A(n.get("user")?n.get("user")+"":""),D(n.get("password")?n.get("password")+"":"")}l(e.target.checked)},value:"dnsString",indicatorLabels:["On","Off"]})}),s?Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"dsn-string",name:"dsn_string",label:"DSN String",value:j,onChange:function(e){m(e.target.value)}})})}):Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:n.configureString,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"host",name:"host",label:"",placeholder:"Enter Host",value:O,onChange:function(e){g(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"db-name",name:"db-name",label:"",placeholder:"Enter DB Name",value:y,onChange:function(e){C(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"port",name:"port",label:"",placeholder:"Enter Port",value:w,onChange:function(e){N(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"user",name:"user",label:"",placeholder:"Enter User",value:_,onChange:function(e){A(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"password",name:"password",label:"",placeholder:"Enter Password",type:"password",value:L,onChange:function(e){D(e.target.value)}})})]})}),Object(a.jsx)(Vn,{label:"Connection String",content:j}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"table",name:"table",label:"Table",placeholder:"Enter Table Name",value:R,tooltip:"DB table name to store/update events, table is auto-created",onChange:function(e){P(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:U,id:"format",name:"format",label:"Format",onChange:function(e){W(e.target.value)},tooltip:"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",selectorOptions:[{label:"Namespace",value:"namespace"},{label:"Access",value:"access"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"queue-dir",name:"queue_dir",label:"Queue Dir",placeholder:"Enter Queue Dir",value:G,tooltip:"staging dir for undelivered messages e.g. '/home/events'",onChange:function(e){H(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"queue-limit",name:"queue_limit",label:"Queue Limit",placeholder:"Enter Queue Limit",type:"number",value:Z,tooltip:"maximum limit for undelivered messages, defaults to '10000'",onChange:function(e){J(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(sr,{id:"comment",name:"comment",label:"Comment",placeholder:"Enter Comment",value:ee,onChange:function(e){te(e.target.value)}})})]})})),kr={serverNeedsRestart:K,setErrorSnackMessage:q},wr=Object(s.b)(null,kr)(Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},ke),Be),{},{strongText:{fontWeight:700},keyName:{marginLeft:5},buttonContainer:{textAlign:"right"},lambdaFormIndicator:{display:"flex",marginBottom:40},customTitle:Object(j.a)(Object(j.a)({},Be.customTitle),{},{marginTop:0}),settingsFormContainer:Object(j.a)(Object(j.a)({},Be.settingsFormContainer),{},{height:"calc(100vh - 422px)"})}))}))((function(e){var t=e.service,n=e.saveAndRefresh,i=e.serverNeedsRestart,r=e.classes,o=e.setErrorSnackMessage,s=Object(c.useState)([]),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),p=m[0],h=m[1];Object(c.useEffect)((function(){if(p){var e={key_values:ar(d)};me.invoke("PUT","/api/v1/configs/".concat(t),e).then((function(){h(!1),i(!0),n()})).catch((function(e){h(!1),o(e)}))}}),[p,i,t,d,n,o]);var O,f=Object(c.useCallback)((function(e){u(e)}),[u]);switch(t){case Wi:O=Object(a.jsx)(Cr,{onChange:f});break;case qi:O=Object(a.jsx)(Sr,{onChange:f});break;default:var v=Z()(nr,t,[]);O=Object(a.jsx)(dr,{fields:v,onChange:f})}var y=vr.find((function(e){return e.actionTrigger===t}));return Object(a.jsx)(c.Fragment,{children:""!==t&&Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)("form",{noValidate:!0,onSubmit:function(e){e.preventDefault(),h(!0)},children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:r.customTitle,children:[y?y.targetTitle:""," - Add Lambda Notification Target"]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:r.settingsFormContainer,children:O}),Object(a.jsx)(x.a,{item:!0,xs:12,className:r.settingsButtonContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:p,children:"Save"})}),Object(a.jsx)(x.a,{item:!0,xs:9})]})})})}))),Nr=vr.filter((function(e){return""===e.logo})),Tr=vr.filter((function(e){return""!==e.logo})),Er=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({},Be),{},{logoButton:{height:"80px"},lambdaNotif:{backgroundColor:"#fff",border:"#393939 1px solid",borderRadius:5,width:101,height:91,display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16,cursor:"pointer","& img":{maxWidth:71,maxHeight:71}},iconContainer:{display:"flex",flexDirection:"row",maxWidth:455,justifyContent:"space-between",flexWrap:"wrap"},nonIconContainer:{marginBottom:16,width:455,marginTop:15,"& button":{marginRight:16}},pickTitle:{fontWeight:600,color:"#393939",fontSize:14,marginBottom:16},centerElements:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},customTitle:Object(j.a)(Object(j.a)({},Be.customTitle),{},{marginTop:0})}))}))((function(e){var t=e.classes,n=e.setService;return Object(a.jsx)(c.Fragment,{children:Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.customTitle,children:"Pick a supported service"}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.centerElements,children:[Object(a.jsx)("div",{className:t.nonIconContainer,children:Nr.map((function(e){return Object(a.jsx)(g.a,{variant:"contained",color:"primary",onClick:function(){n(e.actionTrigger)},children:e.targetTitle.toUpperCase()},"non-icon-".concat(e.targetTitle))}))}),Object(a.jsx)("div",{className:t.iconContainer,children:Tr.map((function(e){return Object(a.jsx)("button",{className:t.lambdaNotif,onClick:function(){n(e.actionTrigger)},children:Object(a.jsx)("img",{src:e.logo,className:t.logoButton,alt:e.targetTitle})},"icon-".concat(e.targetTitle))}))})]})]})})})})),_r={setErrorSnackMessage:q},Ar=Object(s.b)(null,_r),Ir=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Ae),Ie),Be),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})),{},{strongText:{fontWeight:700},keyName:{marginLeft:5},iconText:{lineHeight:"24px"},customConfigurationPage:{height:"calc(100vh - 410px)",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},lambdaContainer:{padding:"15px 0"},actionsTray:Object(j.a)(Object(j.a)({},Ae.actionsTray),{},{padding:"0 38px"})}))}))(Ar((function(e){var t=e.classes,n=e.setErrorSnackMessage,i=Object(c.useState)([]),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(!1),p=Object(b.a)(m,2),h=p[0],O=p[1],v=Object(c.useState)(0),y=Object(b.a)(v,2),C=y[0],S=y[1],k=Object(c.useState)(""),w=Object(b.a)(k,2),N=w[0],T=w[1];Object(c.useEffect)((function(){if(h){me.invoke("GET","/api/v1/admin/notification_endpoints").then((function(e){var t=[];null!==e.notification_endpoints&&(t=e.notification_endpoints),s(t.map((function(e){return{service_name:"".concat(e.service,":").concat(e.account_id),status:e.status}}))),O(!1)})).catch((function(e){n(e),O(!1)}))}}),[h,n]),Object(c.useEffect)((function(){O(!0)}),[]);var E=o.filter((function(e){return""===u||e.service_name.indexOf(u)>=0})),_=function(){T(""),S(C-1)};return Object(a.jsx)(c.Fragment,{children:Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("div",{className:t.settingsOptionsContainer,children:Object(a.jsx)(mr,{slideOptions:[Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.customTitle,children:"Lambda Notification Targets"}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.lambdaContainer,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(f.a,{placeholder:"Filter",className:t.searchField,id:"search-resource",label:"",onChange:function(e){j(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){S(1)},children:"Add Notification Target"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{itemActions:[],columns:[{label:"Status",elementKey:"status",renderFunction:function(e){return Object(a.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(a.jsx)(xr.a,{style:"Offline"===e?{color:gr.a[500]}:{}}),e]})},width:150},{label:"Service",elementKey:"service_name"}],isLoading:h,records:E,entityName:"Notification Endpoints",idField:"service_name",customPaperHeight:t.customConfigurationPage,noBackground:!0})})]})]}),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(a.jsxs)("button",{onClick:_,className:t.backButton,children:[Object(a.jsx)(pr,{}),"Back To Lambda Notifications"]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Er,{setService:function(e){T(e),S(2)}})})]}),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(a.jsxs)("button",{onClick:_,className:t.backButton,children:[Object(a.jsx)(pr,{}),"Back To Supported Services"]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(wr,{service:N,saveAndRefresh:function(){O(!0),S(0),T("")}})})]})],currentSlide:C})})})})})})}))),Mr=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=Object(c.useState)(0),i=Object(b.a)(n,2),r=i[0],o=i[1];return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(zn,{label:"Settings"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.headerLabel,children:"All Settings"}),Object(a.jsxs)($n.a,{value:r,indicatorColor:"primary",textColor:"primary",onChange:function(e,t){o(t)},"aria-label":"tenant-tabs",children:[Object(a.jsx)(Xn.a,{label:"Configurations"}),Object(a.jsx)(Xn.a,{label:"Lambda Notifications"})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[0===r&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Or,{})}),1===r&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ir,{})})]})]})})]})})),Lr=n(196),Dr=n.n(Lr),Br={logger:{main:"logger",title:"Logger Webhook Configuration",modalTitle:"Logger Webhook",apiURL:"",configuration:{configuration_id:"logger_webhook",configuration_label:"Logger Webhook"}},audit:{main:"audit",title:"Audit Webhook Configuration",modalTitle:"Audit Webhook",apiURL:"",configuration:{configuration_id:"audit_webhook",configuration_label:"Audit Webhook"}}},Fr=Object(N.a)((function(e){return Object(k.a)({strongText:{fontWeight:700},keyName:{marginLeft:5},actionsTray:{textAlign:"right","& button":{marginLeft:10}},searchField:{background:"#FFFFFF",padding:12,borderRadius:5,boxShadow:"0px 3px 6px #00000012"},iconText:{lineHeight:"24px"}})}))((function(e){var t=e.match,n=e.classes,r=Object(c.useState)(!1),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(""),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(!1),h=Object(b.a)(p,2),O=h[0],y=h[1],C=Z()(t,"path","").split("/"),S=Z()(Br,C[2],!1);if(!S)return null;var k=[].filter((function(e){return e.name.toLocaleLowerCase().includes(j.toLocaleLowerCase())}));return Object(a.jsxs)(i.a.Fragment,{children:[s&&Object(a.jsx)(jr,{closeModalAndRefresh:function(){y(!0),l(!1)},selectedConfiguration:S.configuration}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"h6",children:S.title})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:n.actionsTray,children:[Object(a.jsx)(f.a,{placeholder:"Filter",className:n.searchField,id:"search-resource",label:"",onChange:function(e){m(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(Dr.a,{}),onClick:function(){l(!0)},children:"Add Webhook Configuration"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{itemActions:[{type:"edit",onClick:function(){}}],columns:[{label:"Name",elementKey:"name"}],isLoading:O,records:k,entityName:"Webhook Configurations",idField:"name"})})]})]})})),Rr=Object(s.b)(null,{setErrorSnackMessage:q})((function(e){var t=e.deleteOpen,n=e.selectedTenant,i=e.closeDeleteModalAndRefresh,r=e.setErrorSnackMessage,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],p=j[1];Object(c.useEffect)((function(){l&&me.invoke("DELETE","/api/v1/namespaces/".concat(n.namespace,"/tenants/").concat(n.name)).then((function(){d(!1),i(!0)})).catch((function(e){d(!1),r(e)}))}),[l]);return Object(a.jsxs)(dn.a,{open:t,onClose:function(){i(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete Tenant"}),Object(a.jsxs)(bn.a,{children:[l&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["To continue please type ",Object(a.jsx)("b",{children:n.name})," in the box.",Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"retype-tenant",name:"retype-tenant",onChange:function(e){p(e.target.value)},label:"",value:m})})]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){i(!1)},color:"primary",disabled:l,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){m===n.name?d(!0):r("Tenant name is not correct")},color:"secondary",autoFocus:!0,disabled:""===m,children:"Delete"})]})]})})),Pr=function(e,t){return{podAntiAffinity:{requiredDuringSchedulingIgnoredDuringExecution:[{labelSelector:{matchExpressions:[{key:"v1.min.io/tenant",operator:"In",values:[e]},{key:"v1.min.io/pool",operator:"In",values:[t]}]},topologyKey:"kubernetes.io/hostname"}]}}},zr="ADD_TENANT/SET_CURRENT_PAGE",Kr="ADD_TENANT/SET_ADVANCED_MODE",Ur="ADD_TENANT/UPDATE_FIELD",Wr="ADD_TENANT/SET_PAGE_VALID",qr="ADD_TENANT/RESET_FORM",Vr="ADD_TENANT/SET_STORAGE_CLASSES_LIST",Gr="ADD_TENANT/ADD_MINIO_KEYPAIR",Hr="ADD_TENANT/ADD_FILE_MINIO_KEYPAIR",Yr="ADD_TENANT/DELETE_MINIO_KEYPAIR",Qr="ADD_TENANT/ADD_CA_KEYPAIR",Zr="ADD_TENANT/ADD_FILE_TO_CA_KEYPAIR",Jr="ADD_TENANT/DELETE_CA_KEYPAIR",$r="ADD_TENANT/ADD_CONSOLE_CERT",Xr="ADD_TENANT/ENCRYPTION_SERVER_CERT",eo="ADD_TENANT/ENCRYPTION_CLIENT_CERT",to="ADD_TENANT/ENCRYPTION_VAULT_CERT",no="ADD_TENANT/ENCRYPTION_VAULT_CA",ao="ADD_TENANT/ENCRYPTION_GEMALTO_CA",co=function(e,t,n){return{type:Ur,pageName:e,field:t,value:n}},io=function(e,t){return{type:Wr,pageName:e,valid:t}},ro=function(e,t,n){return{type:$r,key:e,fileName:t,value:n}},oo=function(e){var t={};return e.forEach((function(e){if(e.required&&""===e.value.trim())t[e.fieldKey]="Field cannot be empty";else if(e.customValidation&&e.customValidationMessage)t[e.fieldKey]=e.customValidationMessage;else if(e.pattern&&e.customPatternMessage){var n=new RegExp(e.pattern,"g");e.value.match(n)||(t[e.fieldKey]=e.customPatternMessage)}else;})),t},so=function(e,t){var n=Object(j.a)({},e);return delete n[t],n},lo=Object(s.b)((function(e){return{advancedMode:e.tenants.createTenant.advancedModeOn,tenantName:e.tenants.createTenant.fields.nameTenant.tenantName,namespace:e.tenants.createTenant.fields.nameTenant.namespace,selectedStorageClass:e.tenants.createTenant.fields.nameTenant.selectedStorageClass,storageClasses:e.tenants.createTenant.storageClasses}}),{setModalErrorSnackMessage:G,setAdvancedMode:function(e){return{type:Kr,state:e}},updateAddField:co,setStorageClassesList:function(e){return{type:Vr,storageClasses:e}},setLimitSize:function(e){return{type:"ADD_TENANT/SET_LIMIT_SIZE",limitSize:e}},isPageValid:io}),uo=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke),Ke))}))(lo((function(e){var t=e.classes,n=e.storageClasses,r=e.advancedMode,o=e.tenantName,s=e.namespace,l=e.selectedStorageClass,d=e.setAdvancedMode,u=e.updateAddField,j=e.setStorageClassesList,m=e.setLimitSize,p=e.isPageValid,h=Object(c.useState)({}),O=Object(b.a)(h,2),g=O[0],f=O[1],v=Object(c.useCallback)((function(e,t){u("nameTenant",e,t)}),[u]),y=Object(c.useCallback)((function(){v("selectedStorageClass",""),j([]),me.invoke("GET","/api/v1/namespaces/".concat(s,"/resourcequotas/").concat(s,"-storagequota")).then((function(e){var t=Z()(e,"elements",[]);m(function(e){var t=Z()(e,"elements",[]),n={};return t.forEach((function(e){var t=e.name.split(".storageclass.storage.k8s.io/requests.storage")[0],a=Z()(e,"hard",0),c=Z()(e,"used",0);n[t]=a-c})),n}(e));var n=t.map((function(e){var t=Z()(e,"name","").split(".storageclass.storage.k8s.io/requests.storage")[0];return{label:t,value:t}}));j(n),n.length>0&&v("selectedStorageClass",n[0].value)})).catch((function(e){console.error(e)}))}),[s,m,j,v]),C=Object(c.useMemo)((function(){return ir()(y,500)}),[y]);Object(c.useEffect)((function(){if(""!==s)return C(),C.cancel}),[C,s]),Object(c.useEffect)((function(){var e=oo([{fieldKey:"tenant-name",required:!0,pattern:/^[a-z0-9-]{3,63}$/,customPatternMessage:"Name only can contain lowercase letters, numbers and '-'. Min. Length: 3",value:o},{fieldKey:"namespace",required:!0,value:s,customValidation:n.length<1,customValidationMessage:"Please enter a valid namespace"}]),t=!("tenant-name"in e)&&!("namespace"in e)&&n.length>0;p("nameTenant",t),f(e)}),[n,s,o,p]);var S=function(e){f(so(g,e))};return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsxs)("div",{className:t.headerElement,children:[Object(a.jsx)("h3",{className:t.h3Section,children:"Name Tenant"}),Object(a.jsx)("span",{className:t.descriptionText,children:"How would you like to name this new tenant?"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"tenant-name",name:"tenant-name",onChange:function(e){v("tenantName",e.target.value),S("tenant-name")},label:"Name",value:o,required:!0,error:g["tenant-name"]||""})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"namespace",name:"namespace",onChange:function(e){v("namespace",e.target.value),S("namespace")},label:"Namespace",value:s,error:g.namespace||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Sn,{id:"storage_class",name:"storage_class",onChange:function(e){v("selectedStorageClass",e.target.value)},label:"Storage Class",value:l,options:n,disabled:n.length<1})}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)("br",{}),Object(a.jsxs)("span",{className:t.descriptionText,children:["Check 'Advanced Mode' for additional configuration options, such as configuring an Identity Provider, Encryption at rest, and customized TLS/SSL Certificates.",Object(a.jsx)("br",{}),"Leave 'Advanced Mode' unchecked to use the secure default settings for the tenant."]}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)(Ln,{value:"adv_mode",id:"adv_mode",name:"adv_mode",checked:r,onChange:function(e){var t=e.target.checked;d(t)},label:"Advanced Mode"})]})]})}))),bo=Object(s.b)((function(e){return{customImage:e.tenants.createTenant.fields.configure.customImage,imageName:e.tenants.createTenant.fields.configure.imageName,consoleImage:e.tenants.createTenant.fields.configure.consoleImage,customDockerhub:e.tenants.createTenant.fields.configure.customDockerhub,imageRegistry:e.tenants.createTenant.fields.configure.imageRegistry,imageRegistryUsername:e.tenants.createTenant.fields.configure.imageRegistryUsername,imageRegistryPassword:e.tenants.createTenant.fields.configure.imageRegistryPassword,exposeMinIO:e.tenants.createTenant.fields.configure.exposeMinIO,exposeConsole:e.tenants.createTenant.fields.configure.exposeConsole}}),{updateAddField:co,isPageValid:io}),jo=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke),Ke))}))(bo((function(e){var t=e.classes,n=e.customImage,i=e.imageName,r=e.consoleImage,o=e.customDockerhub,s=e.imageRegistry,l=e.imageRegistryUsername,d=e.imageRegistryPassword,u=e.exposeMinIO,j=e.exposeConsole,m=e.updateAddField,p=e.isPageValid,h=Object(c.useState)({}),O=Object(b.a)(h,2),g=O[0],f=O[1],v=Object(c.useCallback)((function(e,t){m("configure",e,t)}),[m]);Object(c.useEffect)((function(){var e=[];n&&(e=[].concat(Object(He.a)(e),[{fieldKey:"image",required:!0,value:i,pattern:/^((.*?)\/(.*?):(.+))$/,customPatternMessage:"Format must be of form: 'minio/minio:VERSION'"},{fieldKey:"consoleImage",required:!0,value:r,pattern:/^((.*?)\/(.*?):(.+))$/,customPatternMessage:"Format must be of form: 'minio/console:VERSION'"}]),o&&(e=[].concat(Object(He.a)(e),[{fieldKey:"registry",required:!0,value:s},{fieldKey:"registryUsername",required:!0,value:l},{fieldKey:"registryPassword",required:!0,value:d}])));var t=oo(e);p("configure",0===Object.keys(t).length),f(t)}),[n,i,r,o,s,l,d,p]);var y=function(e){f(so(g,e))};return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsxs)("div",{className:t.headerElement,children:[Object(a.jsx)("h3",{className:t.h3Section,children:"Configure"}),Object(a.jsx)("span",{className:t.descriptionText,children:"Basic configurations for tenant management"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"custom_image",id:"custom_image",name:"custom_image",checked:n,onChange:function(e){var t=e.target.checked;v("customImage",t)},label:"Use custom image"})}),n&&Object(a.jsxs)(c.Fragment,{children:["Please enter the MinIO image from dockerhub to use",Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"image",name:"image",onChange:function(e){v("imageName",e.target.value),y("image")},label:"MinIO's Image",value:i,error:g.image||"",placeholder:"E.g. minio/minio:RELEASE.2020-05-08T02-40-49Z",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"consoleImage",name:"consoleImage",onChange:function(e){v("consoleImage",e.target.value),y("consoleImage")},label:"Console's Image",value:r,error:g.consoleImage||"",placeholder:"E.g. minio/console:v0.3.13",required:!0})})]}),n&&Object(a.jsx)(c.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"custom_docker_hub",id:"custom_docker_hub",name:"custom_docker_hub",checked:o,onChange:function(e){var t=e.target.checked;v("customDockerhub",t)},label:"Set/Update Image Registry"})})}),o&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"registry",name:"registry",onChange:function(e){v("imageRegistry",e.target.value)},label:"Endpoint",value:s,error:g.registry||"",placeholder:"E.g. https://index.docker.io/v1/",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"registryUsername",name:"registryUsername",onChange:function(e){v("imageRegistryUsername",e.target.value)},label:"Username",value:l,error:g.registryUsername||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"registryPassword",name:"registryPassword",onChange:function(e){v("imageRegistryPassword",e.target.value)},label:"Password",value:d,error:g.registryPassword||"",required:!0})})]}),Object(a.jsxs)("div",{className:t.headerElement,children:[Object(a.jsx)("h3",{className:t.h3Section,children:"Expose Services"}),Object(a.jsx)("span",{className:t.descriptionText,children:"Whether the tenant's services should request an external IP."})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"expose_minio",id:"expose_minio",name:"expose_minio",checked:u,onChange:function(e){var t=e.target.checked;v("exposeMinIO",t)},label:"Expose MiniO Service"})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"expose_console",id:"expose_console",name:"expose_console",checked:j,onChange:function(e){var t=e.target.checked;v("exposeConsole",t)},label:"Expose Console Service"})})]})}))),mo=Object(s.b)((function(e){return{idpSelection:e.tenants.createTenant.fields.identityProvider.idpSelection,openIDURL:e.tenants.createTenant.fields.identityProvider.openIDURL,openIDClientID:e.tenants.createTenant.fields.identityProvider.openIDClientID,openIDSecretID:e.tenants.createTenant.fields.identityProvider.openIDSecretID,ADURL:e.tenants.createTenant.fields.identityProvider.ADURL,ADSkipTLS:e.tenants.createTenant.fields.identityProvider.ADSkipTLS,ADServerInsecure:e.tenants.createTenant.fields.identityProvider.ADServerInsecure,ADUserNameFilter:e.tenants.createTenant.fields.identityProvider.ADUserNameFilter,ADGroupBaseDN:e.tenants.createTenant.fields.identityProvider.ADGroupBaseDN,ADGroupSearchFilter:e.tenants.createTenant.fields.identityProvider.ADGroupSearchFilter,ADNameAttribute:e.tenants.createTenant.fields.identityProvider.ADNameAttribute}}),{updateAddField:co,isPageValid:io}),po=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke),Ke))}))(mo((function(e){var t=e.classes,n=e.idpSelection,i=e.openIDURL,r=e.openIDClientID,o=e.openIDSecretID,s=e.ADURL,l=e.ADSkipTLS,d=e.ADServerInsecure,u=e.ADUserNameFilter,j=e.ADGroupBaseDN,m=e.ADGroupSearchFilter,p=e.ADNameAttribute,h=e.updateAddField,O=e.isPageValid,g=Object(c.useState)({}),f=Object(b.a)(g,2),y=f[0],C=f[1],S=Object(c.useCallback)((function(e,t){h("identityProvider",e,t)}),[h]),k=function(e){C(so(y,e))};return Object(c.useEffect)((function(){var e=[];if("Built-in"===n)return O("identityProvider",!0),void C({});"OpenID"===n&&(e=[].concat(Object(He.a)(e),[{fieldKey:"openID_URL",required:!0,value:i},{fieldKey:"openID_clientID",required:!0,value:r},{fieldKey:"openID_secretID",required:!0,value:o}])),"AD"===n&&(e=[].concat(Object(He.a)(e),[{fieldKey:"AD_URL",required:!0,value:s},{fieldKey:"ad_userNameFilter",required:!0,value:u},{fieldKey:"ad_groupBaseDN",required:!0,value:j},{fieldKey:"ad_groupSearchFilter",required:!0,value:m},{fieldKey:"ad_nameAttribute",required:!0,value:p}]));var t=oo(e);O("identityProvider",0===Object.keys(t).length),C(t)}),[n,i,r,o,s,u,j,m,p,O]),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsxs)("div",{className:t.headerElement,children:[Object(a.jsx)("h3",{className:t.h3Section,children:"Identity Provider"}),Object(a.jsx)("span",{className:t.descriptionText,children:"Access to the tenant can be controlled via an external Identity Manager."})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(_n,{currentSelection:n,id:"idp-options",name:"idp-options",label:"Protocol",onChange:function(e){S("idpSelection",e.target.value)},selectorOptions:[{label:"Built-in",value:"Built-in"},{label:"OpenID",value:"OpenID"},{label:"Active Directory",value:"AD"}]}),"MinIO supports both OpenID and Active Directory"]}),"OpenID"===n&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"openID_URL",name:"openID_URL",onChange:function(e){S("openIDURL",e.target.value),k("openID_URL")},label:"URL",value:i,error:y.openID_URL||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"openID_clientID",name:"openID_clientID",onChange:function(e){S("openIDClientID",e.target.value),k("openID_clientID")},label:"Client ID",value:r,error:y.openID_clientID||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"openID_secretID",name:"openID_secretID",onChange:function(e){S("openIDSecretID",e.target.value),k("openID_secretID")},label:"Secret ID",value:o,error:y.openID_secretID||"",required:!0})})]}),"AD"===n&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"AD_URL",name:"AD_URL",onChange:function(e){S("ADURL",e.target.value),k("AD_URL")},label:"URL",value:s,error:y.AD_URL||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"ad_skipTLS",id:"ad_skipTLS",name:"ad_skipTLS",checked:l,onChange:function(e){var t=e.target.checked;S("ADSkipTLS",t)},label:"Skip TLS Verification"})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"ad_serverInsecure",id:"ad_serverInsecure",name:"ad_serverInsecure",checked:d,onChange:function(e){var t=e.target.checked;S("ADServerInsecure",t)},label:"Server Insecure"})}),d?Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(v.a,{className:t.error,variant:"caption",display:"block",gutterBottom:!0,children:"Warning: All traffic with Active Directory will be unencrypted"}),Object(a.jsx)("br",{})]}):null,Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"ad_userNameFilter",name:"ad_userNameFilter",onChange:function(e){S("ADUserNameFilter",e.target.value),k("ad_userNameFilter")},label:"User Search Filter",value:u,error:y.ad_userNameFilter||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"ad_groupBaseDN",name:"ad_groupBaseDN",onChange:function(e){S("ADGroupBaseDN",e.target.value),k("ad_groupBaseDN")},label:"Group Search Base DN",value:j,error:y.ad_groupBaseDN||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"ad_groupSearchFilter",name:"ad_groupSearchFilter",onChange:function(e){S("ADGroupSearchFilter",e.target.value),k("ad_groupSearchFilter")},label:"Group Search Filter",value:m,error:y.ad_groupSearchFilter||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"ad_nameAttribute",name:"ad_nameAttribute",onChange:function(e){S("ADNameAttribute",e.target.value),k("ad_nameAttribute")},label:"Group Name Attribute",value:p,error:y.ad_nameAttribute||"",required:!0})})]})]})}))),ho=n(338),Oo=n.n(ho),go=n(337),fo=n.n(go),xo=Object(N.a)((function(e){return Object(k.a)({errorBlock:{color:e.palette.error.main}})}))((function(e){var t=e.classes,n=e.errorMessage,c=e.withBreak,r=void 0===c||c;return Object(a.jsxs)(i.a.Fragment,{children:[r&&Object(a.jsx)("br",{}),Object(a.jsx)(v.a,{component:"p",variant:"body1",className:t.errorBlock,children:n})]})})),vo=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Se),we),{},{textBoxContainer:{flexGrow:1,position:"relative",flexDirection:"column"},errorState:{color:"#b53b4b",fontSize:14,position:"absolute",top:7,right:7},errorText:{margin:"0",fontSize:"0.75rem",marginTop:3,textAlign:"left",fontFamily:"Lato,sans-serif",fontWeight:400,lineHeight:"1.66",color:"#dc1f2e"},valueString:{maxWidth:350,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:2},fileReselect:{display:"flex",alignItems:"center"},fieldBottom:{borderBottom:"#9c9c9c 1px solid"},fileInputField:{margin:"13px 0"}}))}))((function(e){var t=e.label,n=e.classes,r=e.onChange,o=e.id,s=e.name,l=e.disabled,d=void 0!==l&&l,u=e.tooltip,j=void 0===u?"":u,m=e.required,p=e.error,h=void 0===p?"":p,O=e.accept,g=void 0===O?"":O,f=e.value,v=void 0===f?"":f,y=Object(c.useState)(!1),C=Object(b.a)(y,2),S=C[0],k=C[1];return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:"".concat(n.fieldBottom," ").concat(n.fieldContainer," ").concat(""!==h?n.errorInField:""),children:[""!==t&&Object(a.jsxs)(tn.a,{htmlFor:o,className:"".concat(""!==h?n.fieldLabelError:""," ").concat(n.inputLabel),children:[Object(a.jsxs)("span",{children:[t,m?"*":""]}),""!==j&&Object(a.jsx)("div",{className:n.tooltipContainer,children:Object(a.jsx)(nn.a,{title:j,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:n.tooltip})})})})]}),S||""===v?Object(a.jsxs)("div",{className:n.textBoxContainer,children:[Object(a.jsx)("input",{type:"file",name:s,onChange:function(e){var t=Z()(e,"target.files[0].name","");!function(e,t){var n=e.target.files[0],a=new FileReader;a.readAsDataURL(n),a.onload=function(){var e=a.result;if(e){var n=e.toString().split("base64,");2===n.length&&t(n[1])}}}(e,(function(e){r(e,t)}))},accept:g,required:m,disabled:d,className:n.fileInputField}),""!==v&&Object(a.jsx)(It.a,{color:"primary","aria-label":"upload picture",component:"span",onClick:function(){k(!1)},disableRipple:!1,disableFocusRipple:!1,children:Object(a.jsx)(fo.a,{})}),""!==h&&Object(a.jsx)(xo,{errorMessage:h})]}):Object(a.jsxs)("div",{className:n.fileReselect,children:[Object(a.jsx)("div",{className:n.valueString,children:v}),Object(a.jsx)(It.a,{color:"primary","aria-label":"upload picture",component:"span",onClick:function(){k(!0)},disableRipple:!1,disableFocusRipple:!1,children:Object(a.jsx)(Oo.a,{})})]})]})})})),yo=Object(s.b)((function(e){return{enableTLS:e.tenants.createTenant.fields.security.enableTLS,enableAutoCert:e.tenants.createTenant.fields.security.enableAutoCert,enableCustomCerts:e.tenants.createTenant.fields.security.enableCustomCerts,minioCertificates:e.tenants.createTenant.certificates.minioCertificates,caCertificates:e.tenants.createTenant.certificates.caCertificates,consoleCertificate:e.tenants.createTenant.certificates.consoleCertificate}}),{updateAddField:co,isPageValid:io,addFileToCaCertificates:function(e,t,n,a){return{type:Zr,id:e,key:t,fileName:n,value:a}},deleteCaCertificate:function(e){return{type:Jr,id:e}},addCaCertificate:function(){return{type:Qr}},addKeyPair:function(){return{type:Gr}},addFileToKeyPair:function(e,t,n,a){return{type:Hr,id:e,key:t,fileName:n,value:a}},deleteKeyPair:function(e){return{type:Yr,id:e}},addConsoleCertificate:ro}),Co=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke),Ke))}))(yo((function(e){var t=e.classes,n=e.enableTLS,i=e.enableAutoCert,r=e.enableCustomCerts,o=e.minioCertificates,s=e.caCertificates,l=e.consoleCertificate,d=e.updateAddField,u=e.isPageValid,b=e.addFileToCaCertificates,j=e.deleteCaCertificate,m=e.addCaCertificate,p=e.addKeyPair,h=e.addFileToKeyPair,O=e.deleteKeyPair,f=Object(c.useCallback)((function(e,t){d("security",e,t)}),[d]);return Object(c.useEffect)((function(){u("security",!n||(!!i||!!r))}),[n,i,r,u]),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)("div",{className:t.headerElement,children:Object(a.jsx)("h3",{className:t.h3Section,children:"Security"})}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(Ln,{value:"enableTLS",id:"enableTLS",name:"enableTLS",checked:n,onChange:function(e){var t=e.target.checked;f("enableTLS",t)},label:"Enable TLS"}),"Enable TLS for the tenant, this is required for Encryption Configuration",n&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)(v.a,{variant:"caption",display:"block",gutterBottom:!0,children:"AutoCert: MinIO Operator will generate all TLS certificates automatically"}),Object(a.jsx)(v.a,{variant:"caption",display:"block",gutterBottom:!0,children:"Custom certificates: Allow user to provide your own certificates"}),Object(a.jsx)("br",{})]})]}),n&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(Ln,{value:"enableAutoCert",id:"enableAutoCert",name:"enableAutoCert",checked:i,onChange:function(e){var t=e.target.checked;f("enableAutoCert",t)},label:"Enable AutoCert"}),Object(a.jsx)(Ln,{value:"enableCustomCerts",id:"enableCustomCerts",name:"enableCustomCerts",checked:r,onChange:function(e){var t=e.target.checked;f("enableCustomCerts",t)},label:"Custom Certificates"})]}),r&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"MinIO Certificates"})}),o.map((function(e){return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:5,children:Object(a.jsx)(vo,{onChange:function(t,n){h(e.id,"key",n,t)},accept:".key,.pem",id:"tlsKey",name:"tlsKey",label:"Key",value:e.key})}),Object(a.jsx)(x.a,{item:!0,xs:5,children:Object(a.jsx)(vo,{onChange:function(t,n){h(e.id,"cert",n,t)},accept:".cer,.crt,.cert,.pem",id:"tlsCert",name:"tlsCert",label:"Cert",value:e.cert})}),Object(a.jsx)(x.a,{item:!0,xs:1,children:Object(a.jsx)(g.a,{onClick:function(){O(e.id)},color:"secondary",children:"Remove"})})]},e.id)})),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(g.a,{onClick:p,color:"primary",children:"Add More"})})]}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)("br",{}),Object(a.jsx)(Mc.a,{}),Object(a.jsx)("br",{})]})}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"CA Certificates"})}),s.map((function(e){return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:10,children:Object(a.jsx)(vo,{onChange:function(t,n){b(e.id,"cert",n,t)},accept:".cer,.crt,.cert,.pem",id:"tlsCert",name:"tlsCert",label:"Cert",value:e.cert})}),Object(a.jsx)(x.a,{item:!0,xs:1,children:Object(a.jsx)(g.a,{onClick:function(){j(e.id)},color:"secondary",children:"Remove"})})]},e.id)})),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(g.a,{onClick:m,color:"primary",children:"Add More"})})]}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)("br",{}),Object(a.jsx)(Mc.a,{}),Object(a.jsx)("br",{})]})}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"Console Certificates"})}),Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsx)(vo,{onChange:function(e,t){ro("key",t,e)},accept:".key,.pem",id:"consoleKey",name:"consoleKey",label:"Key",value:l.key})}),Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsx)(vo,{onChange:function(e,t){ro("cert",t,e)},accept:".cer,.crt,.cert,.pem",id:"consoleCert",name:"consoleCert",label:"Cert",value:l.cert})})]})]})]})]})}))),So=Object(s.b)((function(e){return{enableEncryption:e.tenants.createTenant.fields.encryption.enableEncryption,encryptionType:e.tenants.createTenant.fields.encryption.encryptionType,gemaltoEndpoint:e.tenants.createTenant.fields.encryption.gemaltoEndpoint,gemaltoToken:e.tenants.createTenant.fields.encryption.gemaltoToken,gemaltoDomain:e.tenants.createTenant.fields.encryption.gemaltoDomain,gemaltoRetry:e.tenants.createTenant.fields.encryption.gemaltoRetry,awsEndpoint:e.tenants.createTenant.fields.encryption.awsEndpoint,awsRegion:e.tenants.createTenant.fields.encryption.awsRegion,awsKMSKey:e.tenants.createTenant.fields.encryption.awsKMSKey,awsAccessKey:e.tenants.createTenant.fields.encryption.awsAccessKey,awsSecretKey:e.tenants.createTenant.fields.encryption.awsSecretKey,awsToken:e.tenants.createTenant.fields.encryption.awsToken,vaultEndpoint:e.tenants.createTenant.fields.encryption.vaultEndpoint,vaultEngine:e.tenants.createTenant.fields.encryption.vaultEngine,vaultNamespace:e.tenants.createTenant.fields.encryption.vaultNamespace,vaultPrefix:e.tenants.createTenant.fields.encryption.vaultPrefix,vaultAppRoleEngine:e.tenants.createTenant.fields.encryption.vaultAppRoleEngine,vaultId:e.tenants.createTenant.fields.encryption.vaultId,vaultSecret:e.tenants.createTenant.fields.encryption.vaultSecret,vaultRetry:e.tenants.createTenant.fields.encryption.vaultRetry,vaultPing:e.tenants.createTenant.fields.encryption.vaultPing,gcpProjectID:e.tenants.createTenant.fields.encryption.gcpProjectID,gcpEndpoint:e.tenants.createTenant.fields.encryption.gcpEndpoint,gcpClientEmail:e.tenants.createTenant.fields.encryption.gcpClientEmail,gcpClientID:e.tenants.createTenant.fields.encryption.gcpClientID,gcpPrivateKeyID:e.tenants.createTenant.fields.encryption.gcpPrivateKeyID,gcpPrivateKey:e.tenants.createTenant.fields.encryption.gcpPrivateKey,enableCustomCertsForKES:e.tenants.createTenant.fields.encryption.enableCustomCertsForKES,enableAutoCert:e.tenants.createTenant.fields.security.enableAutoCert,enableTLS:e.tenants.createTenant.fields.security.enableTLS,minioCertificates:e.tenants.createTenant.certificates.minioCertificates,serverCertificate:e.tenants.createTenant.certificates.serverCertificate,clientCertificate:e.tenants.createTenant.certificates.clientCertificate,vaultCertificate:e.tenants.createTenant.certificates.vaultCertificate,vaultCA:e.tenants.createTenant.certificates.vaultCA,gemaltoCA:e.tenants.createTenant.certificates.gemaltoCA,enableCustomCerts:e.tenants.createTenant.fields.security.enableCustomCerts}}),{updateAddField:co,isPageValid:io,addFileServerCert:function(e,t,n){return{type:Xr,key:e,fileName:t,value:n}},addFileClientCert:function(e,t,n){return{type:eo,key:e,fileName:t,value:n}},addFileVaultCert:function(e,t,n){return{type:to,key:e,fileName:t,value:n}},addFileVaultCa:function(e,t){return{type:no,fileName:e,value:t}},addFileGemaltoCa:function(e,t){return{type:ao,fileName:e,value:t}}}),ko=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke),Ke))}))(So((function(e){var t=e.classes,n=e.updateAddField,i=e.isPageValid,r=e.addFileServerCert,o=e.addFileClientCert,s=e.addFileVaultCert,l=e.addFileVaultCa,d=e.addFileGemaltoCa,u=e.enableEncryption,j=e.enableCustomCerts,m=e.encryptionType,p=e.gemaltoEndpoint,h=e.gemaltoToken,O=e.gemaltoDomain,g=e.gemaltoRetry,f=e.awsEndpoint,y=e.awsRegion,C=e.awsKMSKey,S=e.awsAccessKey,k=e.awsSecretKey,w=e.awsToken,N=e.vaultEndpoint,T=e.vaultEngine,E=e.vaultNamespace,_=e.vaultPrefix,A=e.vaultAppRoleEngine,I=e.vaultId,M=e.vaultSecret,L=e.vaultRetry,D=e.vaultPing,B=e.gcpProjectID,F=e.gcpEndpoint,R=e.gcpClientEmail,P=e.gcpClientID,z=e.gcpPrivateKeyID,K=e.gcpPrivateKey,U=e.enableCustomCertsForKES,W=e.enableAutoCert,q=e.enableTLS,V=e.minioCertificates,G=e.serverCertificate,H=e.clientCertificate,Y=e.vaultCertificate,Q=e.vaultCA,Z=e.gemaltoCA,J=Object(c.useState)({}),$=Object(b.a)(J,2),X=$[0],ee=$[1],te=!1;q&&(W||V&&V.filter((function(e){return e.encoded_key&&e.encoded_cert})).length>0)&&(te=!0);var ne=Object(c.useCallback)((function(e,t){n("encryption",e,t)}),[n]),ae=function(e){ee(so(X,e))};return Object(c.useEffect)((function(){var e=[];u&&(j&&(e=[].concat(Object(He.a)(e),[{fieldKey:"serverKey",required:!W,value:G.encoded_key},{fieldKey:"serverCert",required:!W,value:G.encoded_cert},{fieldKey:"clientKey",required:!W,value:H.encoded_key},{fieldKey:"clientCert",required:!W,value:H.encoded_cert}])),"vault"===m&&(e=[].concat(Object(He.a)(e),[{fieldKey:"vault_endpoint",required:!0,value:N},{fieldKey:"vault_id",required:!0,value:I},{fieldKey:"vault_secret",required:!0,value:M},{fieldKey:"vault_ping",required:!1,value:D,customValidation:parseInt(D)<0,customValidationMessage:"Value needs to be 0 or greater"},{fieldKey:"vault_retry",required:!1,value:L,customValidation:parseInt(L)<0,customValidationMessage:"Value needs to be 0 or greater"}])),"aws"===m&&(e=[].concat(Object(He.a)(e),[{fieldKey:"aws_endpoint",required:!0,value:f},{fieldKey:"aws_region",required:!0,value:y},{fieldKey:"aws_accessKey",required:!0,value:S},{fieldKey:"aws_secretKey",required:!0,value:k}])),"gemalto"===m&&(e=[].concat(Object(He.a)(e),[{fieldKey:"gemalto_endpoint",required:!0,value:p},{fieldKey:"gemalto_token",required:!0,value:h},{fieldKey:"gemalto_domain",required:!0,value:O},{fieldKey:"gemalto_retry",required:!1,value:g,customValidation:parseInt(g)<0,customValidationMessage:"Value needs to be 0 or greater"}])));var t=oo(e);i("encryption",0===Object.keys(t).length),ee(t)}),[u,m,N,T,I,M,D,L,f,y,k,S,p,h,O,g,B,i,W,j,G.encoded_key,G.encoded_cert,H.encoded_key,H.encoded_cert]),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsxs)("div",{className:t.headerElement,children:[Object(a.jsx)("h3",{className:t.h3Section,children:"Encryption"}),Object(a.jsx)("span",{className:t.descriptionText,children:"How would you like to encrypt the information at rest."})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"enableEncryption",id:"enableEncryption",name:"enableEncryption",checked:u,onChange:function(e){var t=e.target.checked;ne("enableEncryption",t)},label:"Enable Server Side Encryption",disabled:!te})}),u&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:m,id:"encryptionType",name:"encryptionType",label:"Encryption Options",onChange:function(e){ne("encryptionType",e.target.value)},selectorOptions:[{label:"Vault",value:"vault"},{label:"AWS",value:"aws"},{label:"Gemalto",value:"gemalto"},{label:"GCP",value:"gcp"}]})}),"vault"===m&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"enableCustomCertsForKES",id:"enableCustomCertsForKES",name:"enableCustomCertsForKES",checked:U||!W,onChange:function(e){var t=e.target.checked;ne("enableCustomCertsForKES",t)},label:"Custom Certificates",disabled:!W})}),(U||!W)&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"Encryption Service Certificates"})}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsx)(vo,{onChange:function(e,t){r("key",t,e),ae("serverKey")},accept:".key,.pem",id:"serverKey",name:"serverKey",label:"Key",error:X.serverKey||"",value:G.key,required:!W})}),Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsx)(vo,{onChange:function(e,t){r("cert",t,e),ae("serverCert")},accept:".cer,.crt,.cert,.pem",id:"serverCert",name:"serverCert",label:"Cert",error:X.serverCert||"",value:G.cert,required:!W})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,children:"Mutual TLS authentication"})}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsx)(vo,{onChange:function(e,t){o("key",t,e),ae("clientKey")},accept:".key,.pem",id:"clientKey",name:"clientKey",label:"Key",error:X.clientKey||"",value:H.key,required:!W})}),Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsx)(vo,{onChange:function(e,t){o("cert",t,e),ae("clientCert")},accept:".cer,.crt,.cert,.pem",id:"clientCert",name:"clientCert",label:"Cert",error:X.clientCert||"",value:H.cert,required:!W})})]})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"vault_endpoint",name:"vault_endpoint",onChange:function(e){ne("vaultEndpoint",e.target.value),ae("vault_endpoint")},label:"Endpoint",value:N,error:X.vault_endpoint||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"vault_engine",name:"vault_engine",onChange:function(e){ne("vaultEngine",e.target.value),ae("vault_engine")},label:"Engine",value:T})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"vault_namespace",name:"vault_namespace",onChange:function(e){ne("vaultNamespace",e.target.value)},label:"Namespace",value:E})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"vault_prefix",name:"vault_prefix",onChange:function(e){ne("vaultPrefix",e.target.value)},label:"Prefix",value:_})}),Object(a.jsx)("h5",{children:"App Role"}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"vault_approle_engine",name:"vault_approle_engine",onChange:function(e){ne("vaultAppRoleEngine",e.target.value)},label:"Engine",value:A})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"vault_id",name:"vault_id",onChange:function(e){ne("vaultId",e.target.value),ae("vault_id")},label:"AppRole ID",value:I,error:X.vault_id||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"vault_secret",name:"vault_secret",onChange:function(e){ne("vaultSecret",e.target.value),ae("vault_secret")},label:"AppRole Secret",value:M,error:X.vault_secret||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{type:"number",min:"0",id:"vault_retry",name:"vault_retry",onChange:function(e){ne("vaultRetry",e.target.value),ae("vault_retry")},label:"Retry (Seconds)",value:L,error:X.vault_retry||""})}),Object(a.jsx)("h5",{children:"Mutual TLS authentication (optional)"}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsx)(vo,{onChange:function(e,t){s("key",t,e),ae("vault_key")},accept:".key,.pem",id:"vault_key",name:"vault_key",label:"Key",value:Y.key})}),Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsx)(vo,{onChange:function(e,t){s("cert",t,e),ae("vault_cert")},accept:".cer,.crt,.cert,.pem",id:"vault_cert",name:"vault_cert",label:"Cert",value:Y.cert})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(vo,{onChange:function(e,t){l(t,e),ae("vault_ca")},accept:".cer,.crt,.cert,.pem",id:"vault_ca",name:"vault_ca",label:"CA",value:Q.cert})}),Object(a.jsx)("h5",{children:"Status"}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{type:"number",min:"0",id:"vault_ping",name:"vault_ping",onChange:function(e){ne("vaultPing",e.target.value),ae("vault_ping")},label:"Ping (Seconds)",value:D,error:X.vault_ping||""})})]}),"gcp"===m&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gcp_project_id",name:"gcp_project_id",onChange:function(e){ne("gcpProjectID",e.target.value)},label:"Project ID",value:B})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gcp_endpoint",name:"gcp_endpoint",onChange:function(e){ne("gcpEndpoint",e.target.value)},label:"Endpoint",value:F})}),Object(a.jsx)("h5",{children:"Credentials"}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gcp_client_email",name:"gcp_client_email",onChange:function(e){ne("gcpClientEmail",e.target.value)},label:"Client Email",value:R})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gcp_client_id",name:"gcp_client_id",onChange:function(e){ne("gcpClientID",e.target.value)},label:"Client ID",value:P})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gcp_private_key_id",name:"gcp_private_key_id",onChange:function(e){ne("gcpPrivateKeyID",e.target.value)},label:"Private Key ID",value:z})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gcp_private_key",name:"gcp_private_key",onChange:function(e){ne("gcpPrivateKey",e.target.value)},label:"Private Key",value:K})})]}),"aws"===m&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"aws_endpoint",name:"aws_endpoint",onChange:function(e){ne("awsEndpoint",e.target.value),ae("aws_endpoint")},label:"Endpoint",value:f,error:X.aws_endpoint||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"aws_region",name:"aws_region",onChange:function(e){ne("awsRegion",e.target.value),ae("aws_region")},label:"Region",value:y,error:X.aws_region||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"aws_kmsKey",name:"aws_kmsKey",onChange:function(e){ne("awsKMSKey",e.target.value)},label:"KMS Key",value:C})}),Object(a.jsx)("h5",{children:"Credentials"}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"aws_accessKey",name:"aws_accessKey",onChange:function(e){ne("awsAccessKey",e.target.value),ae("aws_accessKey")},label:"Access Key",value:S,error:X.aws_accessKey||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"aws_secretKey",name:"aws_secretKey",onChange:function(e){ne("awsSecretKey",e.target.value),ae("aws_secretKey")},label:"Secret Key",value:k,error:X.aws_secretKey||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"aws_token",name:"aws_token",onChange:function(e){ne("awsToken",e.target.value)},label:"Token",value:w})})]}),"gemalto"===m&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gemalto_endpoint",name:"gemalto_endpoint",onChange:function(e){ne("gemaltoEndpoint",e.target.value),ae("gemalto_endpoint")},label:"Endpoint",value:p,error:X.gemalto_endpoint||"",required:!0})}),Object(a.jsx)("h5",{children:"Credentials"}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gemalto_token",name:"gemalto_token",onChange:function(e){ne("gemaltoToken",e.target.value),ae("gemalto_token")},label:"Token",value:h,error:X.gemalto_token||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"gemalto_domain",name:"gemalto_domain",onChange:function(e){ne("gemaltoDomain",e.target.value),ae("gemalto_domain")},label:"Domain",value:O,error:X.gemalto_domain||"",required:!0})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{type:"number",min:"0",id:"gemalto_retry",name:"gemalto_retry",onChange:function(e){ne("gemaltoRetry",e.target.value),ae("gemalto_retry")},label:"Retry (seconds)",value:g,error:X.gemalto_retry||""})}),Object(a.jsx)("h5",{children:"Custom CA Root certificate verification"}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(vo,{onChange:function(e,t){d(t,e),ae("gemalto_ca")},accept:".cer,.crt,.cert,.pem",id:"gemalto_ca",name:"gemalto_ca",label:"CA",value:Z.cert})})]})]})]})}))),wo=Object(s.b)((function(e){return{advancedMode:e.tenants.createTenant.advancedModeOn,volumeSize:e.tenants.createTenant.fields.tenantSize.volumeSize,sizeFactor:e.tenants.createTenant.fields.tenantSize.sizeFactor,drivesPerServer:e.tenants.createTenant.fields.tenantSize.drivesPerServer,nodes:e.tenants.createTenant.fields.tenantSize.nodes,memoryNode:e.tenants.createTenant.fields.tenantSize.memoryNode,ecParity:e.tenants.createTenant.fields.tenantSize.ecParity,ecParityChoices:e.tenants.createTenant.fields.tenantSize.ecParityChoices,cleanECChoices:e.tenants.createTenant.fields.tenantSize.cleanECChoices,maxAllocableMemo:e.tenants.createTenant.fields.tenantSize.maxAllocableMemo,memorySize:e.tenants.createTenant.fields.tenantSize.memorySize,distribution:e.tenants.createTenant.fields.tenantSize.distribution,ecParityCalc:e.tenants.createTenant.fields.tenantSize.ecParityCalc,limitSize:e.tenants.createTenant.fields.tenantSize.limitSize,selectedStorageClass:e.tenants.createTenant.fields.nameTenant.selectedStorageClass}}),{updateAddField:co,isPageValid:io}),No=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke),Ke))}))(wo((function(e){var t=e.classes,n=e.updateAddField,i=e.isPageValid,r=e.advancedMode,o=e.volumeSize,s=e.sizeFactor,l=e.drivesPerServer,d=e.nodes,u=e.memoryNode,j=e.ecParity,m=e.ecParityChoices,p=e.cleanECChoices,h=e.maxAllocableMemo,O=e.memorySize,g=e.distribution,f=e.ecParityCalc,v=e.limitSize,y=e.selectedStorageClass,C=Object(c.useState)({}),S=Object(b.a)(C,2),k=S[0],w=S[1],N=f.storageFactors.find((function(e){return e.erasureCode===j})),T=Object(c.useCallback)((function(e,t){n("tenantSize",e,t)}),[n]),E=function(e){w(so(k,e))},_=Object(c.useCallback)((function(){var e=parseInt(u)||0,t=h||0,n=s,a=function(e,t,n){var a=oe(e.toString(10),"Gi",!0),c=parseInt(a,10);if(0===n)return{error:"There is no memory available for the selected number of nodes",request:0,limit:0};if(n<ee)return{error:"There are not enough memory resources available",request:0,limit:0};if(c<ee)return{error:"The requested memory size must be greater than 2Gi",request:0,limit:0};if(c>n)return{error:"The requested memory is greater than the max available memory for the selected number of nodes",request:0,limit:0};var i=parseInt(t,10),r=c;return i>=parseInt(oe("1","Pi",!0),10)?r=Math.max(c,parseInt(oe("64","Gi",!0),10)):i>=parseInt(oe("100","Ti"),10)?r=Math.max(c,parseInt(oe("32","Gi",!0),10)):i>=parseInt(oe("10","Ti"),10)?r=Math.max(c,parseInt(oe("16","Gi",!0),10)):i>=parseInt(oe("1","Ti"),10)&&(r=Math.max(c,parseInt(oe("8","Gi",!0),10))),{error:"",request:c,limit:r}}(e,oe((o||0).toString(10),n),t);T("memorySize",a)}),[h,u,s,T,o]);Object(c.useEffect)((function(){_()}),[u,_]),Object(c.useEffect)((function(){_()}),[h,_]),Object(c.useEffect)((function(){if(m.length>0&&""===g.error){var e=function(e,t,n,a){if(e.length<1)return{error:1,defaultEC:"",erasureCodeSet:0,maxEC:"",rawCapacity:"0",storageFactors:[]};var c=t*n,i=e[0],r=2*parseInt(i.split(":")[1],10),o=e.map((function(e){var n=parseInt(e.split(":")[1],10),a=r/(r-n),i=Math.floor(c/a),o=t-Math.floor(t/a);return{erasureCode:e,storageFactor:a,maxCapacity:i.toString(10),maxFailureTolerations:o}})),s=i,l=e.find((function(e){return"EC:4"===e}));return t>=8&&a>16&&l&&(s="EC:4"),{error:0,storageFactors:o,maxEC:i,rawCapacity:c.toString(10),erasureCodeSet:r,defaultEC:s}}(p,g.persistentVolumes,g.pvSize,g.nodes);T("ecParityCalc",e),T("ecParity",e.defaultEC)}}),[m.length,g,p,T]),Object(c.useEffect)((function(){A(),I(),function(e){""===e||isNaN(parseInt(e))||me.invoke("GET","/api/v1/cluster/max-allocatable-memory?num_nodes=".concat(e)).then((function(e){var t=e.max_memory?e.max_memory:0;T("maxAllocableMemo",t)})).catch((function(e){T("maxAllocableMemo",0),console.error(e)}))}(d)}),[d,o,s,l]);var A=function(){var e=o,t=s,n=oe("12","Ti",!0),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=oe(e.value,e.unit,!0);return parseInt(c,10)<X?{error:"The pool size must be greater than 1Gi",nodes:0,persistentVolumes:0,disks:0,pvSize:0}:t<4?{error:"Number of nodes cannot be less than 4",nodes:0,persistentVolumes:0,disks:0,pvSize:0}:a<=0?{error:"Number of drives must be at least 1",nodes:0,persistentVolumes:0,disks:0,pvSize:0}:se(c,t,n,a)}({unit:t,value:e.toString()},parseInt(d),parseInt(n),parseInt(l));T("distribution",a)},I=function(){T("ecParity",""),""!==d.trim()&&""!==l.trim()&&me.invoke("GET","/api/v1/get-parity/".concat(d,"/").concat(l)).then((function(e){T("ecParityChoices",function(e){return e.map((function(e){return{label:e,value:e}}))}(e)),T("cleanECChoices",e)})).catch((function(e){T("ecparityChoices",[]),i("tenantSize",!1),T("ecParity","")}))};return Object(c.useEffect)((function(){var e=oe(o,s,!0),t=oo([{fieldKey:"nodes",required:!0,value:d,customValidation:parseInt(d)<4,customValidationMessage:"Number of nodes cannot be less than 4"},{fieldKey:"volume_size",required:!0,value:o,customValidation:parseInt(e)<1073741824||parseInt(e)>v[y],customValidationMessage:"Volume size must be greater than 1Gi and less than ".concat(ce(v[y],!0))},{fieldKey:"memory_per_node",required:!0,value:u,customValidation:parseInt(u)<2,customValidationMessage:"Memory size must be greater than 2Gi"},{fieldKey:"drivesps",required:!0,value:l,customValidation:parseInt(l)<1,customValidationMessage:"There must be at least one drive"}]);i("tenantSize",!("nodes"in t)&&!("volume_size"in t)&&!("memory_per_node"in t)&&!("drivesps"in t)&&""===g.error&&0===f.error&&""===O.error),w(t)}),[d,o,s,u,g,l,f,O,v,y,i]),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsxs)("div",{className:t.headerElement,children:[Object(a.jsx)("h3",{className:t.h3Section,children:"Tenant Size"}),Object(a.jsx)("span",{className:t.descriptionText,children:"Please select the desired capacity"})]}),Object(a.jsx)("span",{className:t.error,children:g.error}),Object(a.jsx)("span",{className:t.error,children:O.error}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"nodes",name:"nodes",type:"number",onChange:function(e){T("nodes",e.target.value),E("nodes")},label:"Number of Servers",value:d,min:"4",required:!0,error:k.nodes||""})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"drivesps",name:"drivesps",type:"number",onChange:function(e){T("drivesPerServer",e.target.value),E("drivesps")},label:"Number of Drives per Server",value:l,min:"1",required:!0,error:k.drivesps||""})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)("div",{className:t.multiContainer,children:[Object(a.jsx)("div",{children:Object(a.jsx)(gn,{type:"number",id:"volume_size",name:"volume_size",onChange:function(e){T("volumeSize",e.target.value),E("volume_size")},label:"Total Size",value:o,required:!0,error:k.volume_size||"",min:"0"})}),Object(a.jsx)("div",{className:t.sizeFactorContainer,children:Object(a.jsx)(Sn,{label:"Unit",id:"size_factor",name:"size_factor",value:s,onChange:function(e){T("sizeFactor",e.target.value)},options:ne.map((function(e){return{label:e,value:e}}))})})]})}),r&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{type:"number",id:"memory_per_node",name:"memory_per_node",onChange:function(e){T("memoryNode",e.target.value),E("memory_per_node")},label:"Memory per Node [Gi]",value:u,required:!0,error:k.memory_per_node||"",min:"2"})}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(Sn,{id:"ec_parity",name:"ec_parity",onChange:function(e){T("ecParity",e.target.value)},label:"Erasure Code Parity",value:j,options:m}),Object(a.jsx)("span",{className:t.descriptionText,children:"Please select the desired parity. This setting will change the max usable capacity in the cluster"})]})]}),Object(a.jsx)("h4",{children:"Resource Allocation"}),Object(a.jsx)(ra.a,{className:t.table,"aria-label":"simple table",children:Object(a.jsxs)(ia.a,{children:[Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"Number of Servers"}),Object(a.jsx)(ca.a,{align:"right",children:parseInt(d)>0?d:"-"})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"Drives per Server"}),Object(a.jsx)(ca.a,{align:"right",children:g?g.disks:"-"})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"Drive Capacity"}),Object(a.jsx)(ca.a,{align:"right",children:g?ce(g.pvSize):"-"})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"Total Number of Volumes"}),Object(a.jsx)(ca.a,{align:"right",children:g?g.persistentVolumes:"-"})]}),!r&&Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"Memory per Node"}),Object(a.jsxs)(ca.a,{align:"right",children:[u," Gi"]})]})]})}),0===f.error&&N&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)("h4",{children:"Erasure Code Configuration"}),Object(a.jsx)(ra.a,{className:t.table,"aria-label":"simple table",children:Object(a.jsxs)(ia.a,{children:[Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"EC Parity"}),Object(a.jsx)(ca.a,{align:"right",children:""!==j?j:"-"})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"Raw Capacity"}),Object(a.jsx)(ca.a,{align:"right",children:ce(f.rawCapacity)})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"Usable Capacity"}),Object(a.jsx)(ca.a,{align:"right",children:ce(N.maxCapacity)})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{component:"th",scope:"row",children:"Number of server failures to tolerate"}),Object(a.jsx)(ca.a,{align:"right",children:g?Math.floor(N.maxFailureTolerations/g.disks):"-"})]})]})})]})]})}))),To=Object(s.b)((function(e){return{advancedMode:e.tenants.createTenant.advancedModeOn,enableTLS:e.tenants.createTenant.fields.security.enableTLS,tenantName:e.tenants.createTenant.fields.nameTenant.tenantName,selectedStorageClass:e.tenants.createTenant.fields.nameTenant.selectedStorageClass,customImage:e.tenants.createTenant.fields.configure.customImage,imageName:e.tenants.createTenant.fields.configure.imageName,consoleImage:e.tenants.createTenant.fields.configure.consoleImage,namespace:e.tenants.createTenant.fields.nameTenant.namespace,volumeSize:e.tenants.createTenant.fields.tenantSize.volumeSize,sizeFactor:e.tenants.createTenant.fields.tenantSize.sizeFactor}}),{}),Eo=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke),Ke))}))(To((function(e){var t=e.classes,n=e.tenantName,i=e.customImage,r=e.imageName,o=e.consoleImage,s=e.namespace,l=e.selectedStorageClass,d=e.volumeSize,u=e.sizeFactor,b=e.advancedMode,j=e.enableTLS;return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsxs)("div",{className:t.headerElement,children:[Object(a.jsx)("h3",{className:t.h3Section,children:"Review"}),Object(a.jsx)("span",{className:t.descriptionText,children:"Review the details of the new tenant"})]}),Object(a.jsx)(ra.a,{size:"small",children:Object(a.jsxs)(ia.a,{children:[Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{align:"right",className:t.tableTitle,children:"Tenant Name"}),Object(a.jsx)(ca.a,{children:n})]}),i&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{align:"right",className:t.tableTitle,children:"MinIO Image"}),Object(a.jsx)(ca.a,{children:r})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{align:"right",className:t.tableTitle,children:"Console Image"}),Object(a.jsx)(ca.a,{children:o})]})]}),""!==s&&Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{align:"right",className:t.tableTitle,children:"Namespace"}),Object(a.jsx)(ca.a,{children:s})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{align:"right",className:t.tableTitle,children:"Storage Class"}),Object(a.jsx)(ca.a,{children:l})]}),Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{align:"right",className:t.tableTitle,children:"Total Size"}),Object(a.jsxs)(ca.a,{children:[d," ",u]})]}),b&&Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)(aa.a,{children:[Object(a.jsx)(ca.a,{align:"right",className:t.tableTitle,children:"Enable TLS"}),Object(a.jsx)(ca.a,{children:j?"Enabled":"Disabled"})]})})]})})]})}))),_o=Object(s.b)((function(e){return{advancedMode:e.tenants.createTenant.advancedModeOn,namespace:e.tenants.createTenant.fields.nameTenant.namespace,validPages:e.tenants.createTenant.validPages,fields:e.tenants.createTenant.fields,certificates:e.tenants.createTenant.certificates}}),{setModalErrorSnackMessage:G,updateAddField:co}),Ao=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke),Ke),Be))}))(_o((function(e){var t=e.classes,n=e.advancedMode,i=e.fields,r=e.certificates,o=e.namespace,s=e.validPages,l=e.setModalErrorSnackMessage,d=e.closeAndRefresh,u=Object(c.useState)(!1),m=Object(b.a)(u,2),p=m[0],h=m[1],O=Object(c.useState)(null),g=Object(b.a)(O,2),f=g[0],v=g[1],C=Object(c.useState)(!1),S=Object(b.a)(C,2),k=S[0],w=S[1];Object(c.useEffect)((function(){var e=i.nameTenant.tenantName,t=i.nameTenant.selectedStorageClass,n=i.configure.imageName,a=i.configure.consoleImage,c=i.configure.customDockerhub,s=i.configure.imageRegistry,d=i.configure.imageRegistryUsername,u=i.configure.imageRegistryPassword,b=i.configure.exposeMinIO,m=i.configure.exposeConsole,p=i.identityProvider.idpSelection,O=i.identityProvider.openIDURL,g=i.identityProvider.openIDClientID,f=i.identityProvider.openIDSecretID,x=i.identityProvider.ADURL,y=i.identityProvider.ADSkipTLS,C=i.identityProvider.ADServerInsecure,S=i.identityProvider.ADUserNameFilter,N=i.identityProvider.ADGroupBaseDN,T=i.identityProvider.ADGroupSearchFilter,E=i.identityProvider.ADNameAttribute,_=r.minioCertificates,A=r.caCertificates,I=r.consoleCertificate,M=r.serverCertificate,L=r.clientCertificate,D=r.vaultCertificate,B=r.vaultCA,F=r.gemaltoCA,R=i.encryption.enableEncryption,P=i.encryption.encryptionType,z=i.encryption.gemaltoEndpoint,K=i.encryption.gemaltoToken,U=i.encryption.gemaltoDomain,W=i.encryption.gemaltoRetry,q=i.encryption.awsEndpoint,V=i.encryption.awsRegion,G=i.encryption.awsKMSKey,H=i.encryption.awsAccessKey,Y=i.encryption.awsSecretKey,Q=i.encryption.awsToken,Z=i.encryption.vaultEndpoint,J=i.encryption.vaultEngine,$=i.encryption.vaultNamespace,X=i.encryption.vaultPrefix,ee=i.encryption.vaultAppRoleEngine,te=i.encryption.vaultId,ne=i.encryption.vaultSecret,ae=i.encryption.vaultRetry,ce=i.encryption.vaultPing,ie=i.encryption.gcpProjectID,re=i.encryption.gcpEndpoint,oe=i.encryption.gcpClientEmail,se=i.encryption.gcpClientID,le=i.encryption.gcpPrivateKeyID,ue=i.encryption.gcpPrivateKey,be=i.security.enableAutoCert,je=i.security.enableTLS,pe=i.tenantSize.ecParity,he=i.tenantSize.distribution,Oe=i.tenantSize.memorySize;if(k){var ge=de([]),fe=Pr(e,ge),xe=pe.split(":")[1],ve={name:e,namespace:o,access_key:"",secret_key:"",enable_tls:je&&be,enable_console:!0,enable_prometheus:!0,service_name:"",image:n,console_image:a,expose_minio:b,expose_console:m,pools:[{name:ge,servers:he.nodes,volumes_per_server:he.disks,volume_configuration:{size:he.pvSize,storage_class_name:t},resources:{requests:{memory:Oe.request},limits:{memory:Oe.limit}},affinity:fe}],erasureCodingParity:parseInt(xe,10)};c&&(ve=Object(j.a)(Object(j.a)({},ve),{},{image_registry:{registry:s,username:d,password:u}}));var ye=null,Ce=null,Se=null;if(A.length>0&&(Se={ca_certificates:A.map((function(e){return e.encoded_cert})).filter((function(e){return e}))}),je&&_.length>0&&(ye={minio:_.map((function(e){return{crt:e.encoded_cert,key:e.encoded_key}})).filter((function(e){return e.crt&&e.key}))}),je&&""!==I.encoded_cert&&""!==I.encoded_key&&(Ce={console:{crt:I.encoded_cert,key:I.encoded_key}}),(ye||Ce||Se)&&(ve=Object(j.a)(Object(j.a)({},ve),{},{tls:Object(j.a)(Object(j.a)(Object(j.a)({},ye),Ce),Se)})),R){var ke={};switch(P){case"gemalto":var we={};""!==F.encoded_cert&&(we={ca:F.encoded_cert}),ke={gemalto:{keysecure:{endpoint:z,credentials:{token:K,domain:U,retry:parseInt(W)},tls:Object(j.a)({},we)}}};break;case"aws":ke={aws:{secretsmanager:{endpoint:q,region:V,kmskey:G,credentials:{accesskey:H,secretkey:Y,token:Q}}}};break;case"gcp":ke={gcp:{secretmanager:{project_id:ie,endpoint:re,credentials:{client_email:oe,client_id:se,private_key_id:le,private_key:ue}}}};break;case"vault":var Ne=null,Te=null;""!==D.encoded_key&&""!==D.encoded_cert&&(Ne={key:D.encoded_key,crt:D.encoded_cert}),""!==B.encoded_cert&&(Te={ca:B.encoded_cert});var Ee=null;(Ne||B)&&(Ee={tls:Object(j.a)(Object(j.a)({},Ne),Te)}),ke={vault:Object(j.a)(Object(j.a)({endpoint:Z,engine:J,namespace:$,prefix:X,approle:{engine:ee,id:te,secret:ne,retry:parseInt(ae)}},Ee),{},{status:{ping:parseInt(ce)}})}}var _e={},Ae={};""!==L.encoded_key&&""!==L.encoded_cert&&(Ae={client:{key:L.encoded_key,crt:L.encoded_cert}}),""!==M.encoded_key&&""!==M.encoded_cert&&(_e={server:{key:M.encoded_key,crt:M.encoded_cert}}),ve=Object(j.a)(Object(j.a)({},ve),{},{encryption:Object(j.a)(Object(j.a)(Object(j.a)({},Ae),_e),ke)})}if("Built-in"!==p){var Ie={};switch(p){case"OpenID":Ie={oidc:{url:O,client_id:g,secret_id:f}};break;case"AD":Ie={active_directory:{url:x,skip_tls_verification:y,server_insecure:C,username_format:"",user_search_filter:S,group_search_base_dn:N,group_search_filter:T,group_name_attribute:E}}}ve=Object(j.a)(Object(j.a)({},ve),{},{idp:Object(j.a)({},Ie)})}me.invoke("POST","/api/v1/tenants",ve).then((function(e){var t={console:{accessKey:e.console.access_key,secretKey:e.console.secret_key}};w(!1),h(!0),v(t)})).catch((function(e){w(!1),l(e)}))}}),[k]);var N={label:"Cancel",type:"other",enabled:!0,action:function(){d(!1)}},T=[{label:"Name Tenant",componentRender:Object(a.jsx)(uo,{}),buttons:[N,{label:"Next",type:"next",enabled:s.includes("nameTenant")}]},{label:"Configure",advancedOnly:!0,componentRender:Object(a.jsx)(jo,{}),buttons:[N,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("configure")}]},{label:"Identity Provider",advancedOnly:!0,componentRender:Object(a.jsx)(po,{}),buttons:[N,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("identityProvider")}]},{label:"Security",advancedOnly:!0,componentRender:Object(a.jsx)(Co,{}),buttons:[N,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("security")}]},{label:"Encryption",advancedOnly:!0,componentRender:Object(a.jsx)(ko,{}),buttons:[N,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("encryption")}]},{label:"Tenant Size",componentRender:Object(a.jsx)(No,{}),buttons:[N,{label:"Back",type:"back",enabled:!0},{label:"Next",type:"next",enabled:s.includes("tenantSize")}]},{label:"Preview Configuration",componentRender:Object(a.jsx)(Eo,{}),buttons:[N,{label:"Back",type:"back",enabled:!0},{label:"Create",type:"submit",enabled:!k,action:function(){w(!0)}}]}],E=T;n||(E=T.filter((function(e){return!e.advancedOnly})));return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.customTitle,children:"Create New Tenant"}),k&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})}),p&&Object(a.jsx)(Xc,{newServiceAccount:f,open:p,closeModal:function(){d(!0)},entity:"Tenant"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Hn,{wizardSteps:E})})})]})}))),Io=n(339),Mo=n.n(Io),Lo=Object(s.b)(null,{setErrorSnackMessage:q,resetAddTenantForm:function(){return{type:qr}}}),Do=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({},Ae),Ie),Be),{},{seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},actionsTray:Object(j.a)(Object(j.a)({},Ae.actionsTray),{},{padding:"0 38px"}),tenantsContainer:{padding:"15px 0"},customConfigurationPage:{height:"calc(100vh - 440px)",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}}))}))(Lo((function(e){var t=e.classes,n=e.setErrorSnackMessage,i=e.resetAddTenantForm,r=Object(c.useState)(0),o=Object(b.a)(r,2),s=o[0],l=o[1],d=Object(c.useState)(!1),j=Object(b.a)(d,2),m=j[0],p=j[1],h=Object(c.useState)(null),O=Object(b.a)(h,2),v=O[0],y=O[1],C=Object(c.useState)(!1),S=Object(b.a)(C,2),k=S[0],w=S[1],N=Object(c.useState)(""),T=Object(b.a)(N,2),E=T[0],_=T[1],A=Object(c.useState)([]),I=Object(b.a)(A,2),M=I[0],L=I[1],D=Object(c.useState)(!1),B=Object(b.a)(D,2),F=B[0],R=B[1],P=Object(c.useState)(null),z=Object(b.a)(P,2),K=z[0],U=z[1],W=[{type:"view",onClick:function(e){u.push("/namespaces/".concat(e.namespace,"/tenants/").concat(e.name))}},{type:"delete",onClick:function(e){y(e),p(!0)}}],q=M.filter((function(e){return""===E||e.name.indexOf(E)>=0}));Object(c.useEffect)((function(){if(k){me.invoke("GET","/api/v1/tenants").then((function(e){if(null!==e){var t=[];null!==e.tenants&&(t=e.tenants);for(var n=0;n<t.length;n++)t[n].capacity=ce(t[n].total_size+"");L(t),w(!1)}else w(!1)})).catch((function(e){n(e),w(!1)}))}}),[k,n]),Object(c.useEffect)((function(){w(!0)}),[]);return Object(a.jsxs)(c.Fragment,{children:[m&&Object(a.jsx)(Rr,{deleteOpen:m,selectedTenant:v,closeDeleteModalAndRefresh:function(e){p(!1),e&&w(!0)}}),F&&Object(a.jsx)(Xc,{newServiceAccount:K,open:F,closeModal:function(){R(!1),U(null)},entity:"Tenant"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("div",{className:t.settingsOptionsContainer,children:Object(a.jsx)(mr,{slideOptions:[Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.tenantsContainer,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(f.a,{placeholder:"Search Tenants",className:t.searchField,id:"search-resource",label:"",onChange:function(e){_(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}}),Object(a.jsx)(It.a,{color:"primary","aria-label":"Refresh Tenant List",component:"span",onClick:function(){w(!0)},children:Object(a.jsx)(Mo.a,{})}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){l(1)},children:"Create Tenant"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.tenantsContainer,children:Object(a.jsx)(ln,{itemActions:W,columns:[{label:"Name",elementKey:"name"},{label:"Namespace",elementKey:"namespace"},{label:"Capacity",elementKey:"capacity"},{label:"# of Pools",elementKey:"pool_count"},{label:"State",elementKey:"currentState"}],isLoading:k,records:q,entityName:"Tenants",idField:"name",customPaperHeight:t.customConfigurationPage,noBackground:!0})})]})}),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.backContainer,children:Object(a.jsxs)("button",{onClick:function(){l(s-1),i()},className:t.backButton,children:[Object(a.jsx)(pr,{}),"Back To Tenants List"]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:1===s&&Object(a.jsx)(Ao,{closeAndRefresh:function(e){l(0),i(),e&&w(!0)}})})]})],currentSlide:s})})})})})]})}))),Bo=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes;return Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(zn,{label:"Tenants"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,className:t.container,children:Object(a.jsx)(Do,{})})})]})})),Fo=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8},bottomContainer:{display:"flex",flexGrow:1,alignItems:"center","& div":{flexGrow:1,width:"100%"}},factorElements:{display:"flex",justifyContent:"flex-start"},sizeNumber:{fontSize:35,fontWeight:700,textAlign:"center"},sizeDescription:{fontSize:14,color:"#777",textAlign:"center"}},ke))}))((function(e){var t=e.tenant,n=e.classes,i=e.open,r=e.onClosePoolAndReload,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(0),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(0),O=Object(b.a)(h,2),f=O[0],v=O[1],C=Object(c.useState)(0),S=Object(b.a)(C,2),k=S[0],w=S[1],N=1073741824*f*k,T=N*m;return Object(a.jsx)(pn,{onClose:function(){return r(!1)},modalOpen:i,title:"Add Pool",children:Object(a.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d(!0);var n=de(t.pools),a=Pr(t.name,n),c={name:n,servers:m,volumes_per_server:k,volume_configuration:{size:1073741824*f,storage_class:"",labels:null},affinity:a};me.invoke("POST","/api/v1/namespaces/".concat(t.namespace,"/tenants/").concat(t.name,"/pools"),c).then((function(){d(!1),r(!0)})).catch((function(e){d(!1)}))},children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"number_of_nodes",name:"number_of_nodes",type:"number",onChange:function(e){p(parseInt(e.target.value))},label:"Number o Nodes",value:m.toString(10)})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"pool_size",name:"pool_size",type:"number",onChange:function(e){v(parseInt(e.target.value))},label:"Volume Size (Gi)",value:f.toString(10)})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"volumes_per_sever",name:"volumes_per_sever",type:"number",onChange:function(e){w(parseInt(e.target.value))},label:"Volumes per Server",value:k.toString(10)})}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:n.bottomContainer,children:[Object(a.jsxs)("div",{className:n.factorElements,children:[Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:n.sizeNumber,children:ce(N.toString(10))}),Object(a.jsx)("div",{className:n.sizeDescription,children:"Instance Capacity"})]}),Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:n.sizeNumber,children:ce(T.toString(10))}),Object(a.jsx)("div",{className:n.sizeDescription,children:"Total Capacity"})]})]}),Object(a.jsx)("div",{className:n.buttonContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:l,children:"Save"})})]}),l&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})]})})})),Ro=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8}},ke))}))((function(e){var t=e.classes,n=e.open,r=e.closeModalAndRefresh,o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(0),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(""),O=Object(b.a)(h,2),f=O[0],v=O[1],C=Object(c.useState)(""),S=Object(b.a)(C,2),k=S[0],w=S[1],N=Object(c.useState)(""),T=Object(b.a)(N,2),E=T[0],_=T[1],A=Object(c.useState)(""),I=Object(b.a)(A,2),M=I[0],L=I[1],D=Object(c.useState)(""),B=Object(b.a)(D,2),F=B[0],R=B[1],P=Object(c.useState)(""),z=Object(b.a)(P,2),K=z[0],U=z[1],W=Object(c.useState)(""),q=Object(b.a)(W,2),V=q[0],G=q[1];return Object(a.jsx)(pn,{modalOpen:n,title:"Add Pool",onClose:function(){r(!1)},children:Object(a.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),d(!0)},children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Sn,{label:"Source Bucket",options:[],onChange:function(e){v(e.target.value)},value:f,name:"source_bucket",id:"source_bucket"})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsxs)($n.a,{value:m,indicatorColor:"primary",textColor:"primary",onChange:function(e,t){p(t)},"aria-label":"cluster-tabs",children:[Object(a.jsx)(Xn.a,{label:"Local Cluster"}),Object(a.jsx)(Xn.a,{label:"Remote Cluster"})]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),0===m&&Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Sn,{label:"Cluster",options:[],onChange:function(e){w(e.target.value)},value:k,name:"cluster",id:"cluster"})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Sn,{label:"Destination Bucket",options:[],onChange:function(e){_(e.target.value)},value:E,name:"destination_bucket",id:"destination_bucket"})})]}),1===m&&Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"address",name:"address",onChange:function(e){L(e.target.value)},label:"Address",value:M})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"bucket",name:"bucket",onChange:function(e){R(e.target.value)},label:"Bucket",value:F})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"accessKey",name:"accessKey",onChange:function(e){U(e.target.value)},label:"Access Key",value:K})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{id:"secretKey",name:"secretKey",onChange:function(e){G(e.target.value)},label:"Secret Key",value:V})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:l,children:"Save"})}),l&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]})})})),Po=Object(N.a)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:"#F4F4F4"},bar:{borderRadius:5,backgroundColor:"#081C42"}}}))(y.a),zo=Object(N.a)((function(e){return Object(k.a)({paperContainer:{padding:15},allValue:{fontSize:16,fontWeight:700,marginBottom:8},currentUsage:{fontSize:12,marginTop:8},centerItem:{textAlign:"center"}})}))((function(e){var t=e.classes,n=e.maxValue,c=e.currValue,r=e.label,o=e.renderFunction,s=e.loading,l=e.error,d=100*c/n;return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(S.a,{className:t.paperContainer,children:[s&&Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(x.a,{item:!0,xs:12,className:t.centerItem,children:Object(a.jsx)(C.a,{color:"primary",size:40,variant:"indeterminate"})})}),s?null:""!==l?Object(a.jsx)(xo,{errorMessage:l,withBreak:!1}):Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.allValue,children:[r," ",o?o(n.toString()):n]}),Object(a.jsx)(Po,{variant:"determinate",value:d}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.currentUsage,children:["Used:"," ",o?o(c.toString()):c]})]})]})})})),Ko=Object(s.b)(null,{setModalErrorSnackMessage:G}),Uo=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"}},ke))}))(Ko((function(e){var t=e.open,n=e.closeModalAndRefresh,i=e.namespace,r=e.idTenant,o=e.setModalErrorSnackMessage,s=e.classes,l=Object(c.useState)(!1),d=Object(b.a)(l,2),u=d[0],m=d[1],p=Object(c.useState)(""),h=Object(b.a)(p,2),O=h[0],f=h[1],v=Object(c.useState)(""),y=Object(b.a)(v,2),C=y[0],S=y[1],k=Object(c.useState)(!1),w=Object(b.a)(k,2),N=w[0],T=w[1],E=Object(c.useState)(""),_=Object(b.a)(E,2),A=_[0],I=_[1],M=Object(c.useState)(""),L=Object(b.a)(M,2),D=L[0],B=L[1],F=Object(c.useState)(""),R=Object(b.a)(F,2),P=R[0],z=R[1],K=Object(c.useState)(!0),U=Object(b.a)(K,2),W=U[0],q=U[1],V=Object(c.useState)(!0),G=Object(b.a)(V,2),H=G[0],Y=G[1],Q=Object(c.useCallback)((function(e){var t=new RegExp("^$|^((.*?)/(.*?):(.+))$");switch(e){case"consoleImage":Y(t.test(C));break;case"minioImage":q(t.test(O))}}),[C,O]);Object(c.useEffect)((function(){Q("minioImage")}),[O,Q]),Object(c.useEffect)((function(){Q("consoleImage")}),[C,Q]);return Object(a.jsx)(pn,{title:"Update MinIO Version",modalOpen:t,onClose:function(){n(!1)},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:s.formScrollable,children:[Object(a.jsx)("span",{children:"Please enter the MinIO image from dockerhub to use. If blank, then latest build will be used."}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{value:O,label:"MinIO's Image",id:"minioImage",name:"minioImage",placeholder:"E.g. minio/minio:RELEASE.2020-05-08T02-40-49Z",onChange:function(e){f(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{value:C,label:"Console's Image",id:"consoleImage",name:"consoleImage",placeholder:"E.g. minio/console:v0.3.13",onChange:function(e){S(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"imageRegistry",id:"setImageRegistry",name:"setImageRegistry",checked:N,onChange:function(e){T(!N)},label:"Set Custom Image Registry",indicatorLabels:["Yes","No"]})}),N&&Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{value:A,label:"Endpoint",id:"imageRegistry",name:"imageRegistry",placeholder:"E.g. https://index.docker.io/v1/",onChange:function(e){I(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{value:D,label:"Username",id:"imageRegistryUsername",name:"imageRegistryUsername",placeholder:"Enter image registry username",onChange:function(e){B(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{value:P,label:"Password",id:"imageRegistryPassword",name:"imageRegistryPassword",placeholder:"Enter image registry password",onChange:function(e){z(e.target.value)}})})]})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:s.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:s.clearButton,onClick:function(){f(""),S(""),T(!1),I(""),B(""),z("")},children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:!W||!H||N&&(""===A.trim()||""===D.trim()||""===P.trim())||u,onClick:function(){m(!0);var e={image:O,console_image:C,enable_prometheus:!0};if(N){var t={image_registry:{registry:A,username:D,password:P}};e=Object(j.a)(Object(j.a)({},e),t)}me.invoke("PUT","/api/v1/namespaces/".concat(i,"/tenants/").concat(r),e).then((function(){m(!1),n(!0)})).catch((function(e){o(e),m(!1)}))},children:"Save"})]})]})})}))),Wo=Object(s.b)(null,{setErrorSnackMessage:q}),qo=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},sizeFactorContainer:{marginLeft:8},containerHeader:{display:"flex",justifyContent:"space-between"},paperContainer:{padding:"15px 15px 15px 50px"},infoGrid:{display:"grid",gridTemplateColumns:"auto auto auto auto",gridGap:8,"& div":{display:"flex",alignItems:"center"},"& div:nth-child(odd)":{justifyContent:"flex-end",fontWeight:700},"& div:nth-child(2n)":{paddingRight:35}},masterActions:{width:"25%",minWidth:"120px","& div":{margin:"5px 0px"}},actionsTray:{textAlign:"right"},updateButton:{backgroundColor:"transparent",border:0,padding:"0 6px",cursor:"pointer","&:focus, &:active":{outline:"none"},"& svg":{height:12}},noUnderLine:{textDecoration:"none"},poolLabel:{color:"#666666"},licenseContainer:{position:"relative",padding:"20px 52px 0px 28px",background:"#032F51",boxShadow:"0px 3px 7px #00000014","& h2":{color:"#FFF",marginBottom:67},"& a":{textDecoration:"none"},"& h3":{color:"#FFFFFF",marginBottom:"30px",fontWeight:"bold"},"& h6":{color:"#FFFFFF !important"}},licenseInfo:{color:"#FFFFFF",position:"relative"},licenseInfoTitle:{textTransform:"none",color:"#BFBFBF",fontSize:11},licenseInfoValue:{textTransform:"none",fontSize:14,fontWeight:"bold"},verifiedIcon:{width:96,position:"absolute",right:0,bottom:29},breadcrumLink:{textDecoration:"none",color:"black"}},ke),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(Wo((function(e){var t=e.classes,n=e.match,r=e.setErrorSnackMessage,o=Object(c.useState)(0),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(0),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(0),O=Object(b.a)(h,2),f=O[0],y=O[1],C=Object(c.useState)([]),k=Object(b.a)(C,2),w=k[0],N=k[1],T=Object(c.useState)(0),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(0),M=Object(b.a)(I,2),L=M[0],D=M[1],B=Object(c.useState)(!1),F=Object(b.a)(B,2),R=F[0],P=F[1],z=Object(c.useState)(!1),K=Object(b.a)(z,2),U=K[0],W=K[1],q=Object(c.useState)(!1),V=Object(b.a)(q,2),G=V[0],H=V[1],Y=Object(c.useState)(null),Q=Object(b.a)(Y,2),J=Q[0],$=Q[1],X=Object(c.useState)(!0),ee=Object(b.a)(X,2),te=ee[0],ne=ee[1],ae=Object(c.useState)(""),ie=Object(b.a)(ae,2),re=ie[0],oe=ie[1],se=Object(c.useState)(0),le=Object(b.a)(se,2),de=le[0],ue=le[1],be=Object(c.useState)(!1),je=Object(b.a)(be,2),pe=je[0],he=je[1],Oe=Object(c.useState)(),ge=Object(b.a)(Oe,2),fe=ge[0],xe=ge[1],ve=Object(c.useState)(!0),ye=Object(b.a)(ve,2),Ce=ye[0],Se=ye[1],ke=Object(c.useState)(!1),we=Object(b.a)(ke,2),Ne=we[0],Te=we[1],Ee=n.params.tenantName,_e=n.params.tenantNamespace,Ae=function(){me.invoke("GET","/api/v1/namespaces/".concat(_e,"/tenants/").concat(Ee)).then((function(e){var t,n=e.pools?e.pools:[],a=0,c=0,i=0,r=Object(yr.a)(n);try{for(r.s();!(t=r.n()).done;){var o=t.value,s=o.volumes_per_server*o.servers*o.volume_configuration.size;o.label="pool-".concat(i),void 0!==o.name&&""!==o.name||(o.name=o.label),o.capacity=ce(s+""),o.volumes=o.servers*o.volumes_per_server,a+=o.servers,c+=o.volumes,i+=1}}catch(l){r.e(l)}finally{r.f()}p(e.total_size),y(n.length),D(c),A(a),N(n),$(e)})).catch((function(e){r(e)}))},Ie=function(){me.invoke("GET","/api/v1/namespaces/".concat(_e,"/tenants/").concat(Ee,"/usage")).then((function(e){var t=Z()(e,"disk_used","0");ue(parseInt(t)),oe(""),ne(!1)})).catch((function(e){oe(e),ue(0),ne(!1)}))};return Object(c.useEffect)((function(){Ae(),Ie(),Se(!0),me.invoke("GET","/api/v1/subscription/info").then((function(e){xe(e),Se(!1)})).catch((function(e){Se(!1)}))}),[]),Object(a.jsxs)(i.a.Fragment,{children:[R&&null!==J&&Object(a.jsx)(Fo,{open:R,onClosePoolAndReload:function(e){P(!1),e&&(Ae(),Ie())},tenant:J}),U&&Object(a.jsx)(Dn,{open:U,closeModalAndRefresh:function(){W(!1)}}),G&&Object(a.jsx)(Ro,{open:G,closeModalAndRefresh:function(e){H(!1),e&&(Ae(),Ie())}}),pe&&Object(a.jsx)(Uo,{open:pe,closeModalAndRefresh:function(){he(!1)},idTenant:Ee,namespace:_e}),Object(a.jsx)(zn,{label:Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)($t.a,{to:"/tenants",className:t.breadcrumLink,children:"Tenant"})," > ".concat(n.params.tenantName)]})}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.container}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:9,className:t.containerHeader,children:Object(a.jsx)(S.a,{className:t.paperContainer,children:Object(a.jsxs)("div",{className:t.infoGrid,children:[Object(a.jsx)("div",{children:"Capacity:"}),Object(a.jsx)("div",{children:ce(m.toString(10))}),Object(a.jsx)("div",{children:"Minio:"}),Object(a.jsxs)("div",{children:[J?J.image:""," ",Object(a.jsx)("button",{className:t.updateButton,onClick:function(){he(!0)},children:Object(a.jsx)(Vt,{active:!1})})]}),Object(a.jsx)("div",{children:"Clusters:"}),Object(a.jsx)("div",{children:f}),Object(a.jsx)("div",{children:"Console:"}),Object(a.jsx)("div",{children:J?J.console_image:""}),Object(a.jsx)("div",{children:"Instances:"}),Object(a.jsx)("div",{children:_}),Object(a.jsx)("div",{children:"Volumes:"}),Object(a.jsx)("div",{children:L}),(null===J||void 0===J?void 0:J.endpoints)&&Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)("div",{children:"Endpoint:"}),Object(a.jsx)("div",{children:Object(a.jsx)("a",{href:null===J||void 0===J?void 0:J.endpoints.minio,target:"_blank",rel:"noopener noreferrer",children:null===J||void 0===J?void 0:J.endpoints.minio})}),Object(a.jsx)("div",{children:"Console:"}),Object(a.jsx)("div",{children:Object(a.jsx)("a",{href:null===J||void 0===J?void 0:J.endpoints.console,target:"_blank",rel:"noopener noreferrer",children:null===J||void 0===J?void 0:J.endpoints.console})})]})]})})}),Object(a.jsx)(x.a,{item:!0,xs:3,children:Object(a.jsx)(zo,{currValue:de,maxValue:J?J.total_size:0,label:"Storage",renderFunction:ce,error:re,loading:te})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:6,children:Object(a.jsxs)($n.a,{value:l,indicatorColor:"primary",textColor:"primary",onChange:function(e,t){d(t)},"aria-label":"tenant-tabs",children:[Object(a.jsx)(Xn.a,{label:"Clusters"}),Object(a.jsx)(Xn.a,{label:"License"})]})}),Object(a.jsx)(x.a,{item:!0,xs:6,className:t.actionsTray,children:Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){P(!0)},children:"Expand Tenant"})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[0===l&&Object(a.jsx)(ln,{itemActions:[{type:"delete",onClick:function(e){console.log(e)},sendOnlyId:!0}],columns:[{label:"Name",elementKey:"name"},{label:"Capacity",elementKey:"capacity"},{label:"# of Instances",elementKey:"servers"},{label:"# of Drives",elementKey:"volumes"}],isLoading:!1,records:w,entityName:"Servers",idField:"name"}),1===l&&Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(S.a,{className:J&&J.subnet_license?t.licenseContainer:"",children:J&&J.subnet_license?Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{container:!0,className:t.licenseInfo,children:[Object(a.jsxs)(x.a,{item:!0,xs:6,children:[Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"License"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:"Commercial License"}),Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Organization"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:J.subnet_license.organization}),Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Registered Capacity"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:ce((1099511627776*J.subnet_license.storage_capacity).toString(10))}),Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Expiry Date"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:Object(a.jsx)(et.a,{format:"YYYY-MM-DD",children:J.subnet_license.expires_at})})]}),Object(a.jsxs)(x.a,{item:!0,xs:6,children:[Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Subscription Plan"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:J.subnet_license.plan}),Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Requester"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:J.subnet_license.email})]}),Object(a.jsx)("img",{className:t.verifiedIcon,src:"/verified.svg"})]})}):!Ce&&Object(a.jsxs)(x.a,{className:t.paperContainer,children:[!fe&&Object(a.jsx)($t.a,{to:"/license",onClick:function(e){e.stopPropagation()},className:t.noUnderLine,children:Object(a.jsx)(g.a,{className:t.licenseButton,variant:"contained",color:"primary",children:"Activate Product"})}),fe&&J&&Object(a.jsx)(g.a,{disabled:Ne,className:t.licenseButton,variant:"contained",color:"primary",onClick:function(){return function(e,t){Ne||(Te(!0),me.invoke("POST","/api/v1/subscription/namespaces/".concat(e,"/tenants/").concat(t,"/activate"),{}).then((function(){Te(!1),Ae()})).catch((function(e){Te(!1),r(e)})))}(J.namespace,J.name)},children:"Attach License"})]})})})})})]})]})]})}))),Vo="OBJECT_BROWSER/ADD_ROUTE",Go="OBJECT_BROWSER/RESET_ROUTES_LIST",Ho="OBJECT_BROWSER/REMOVE_ROUTE_LEVEL",Yo="OBJECT_BROWSER/SET_ALL_ROUTES",Qo="OBJECT_BROWSER/CREATE_FOLDER",Zo="OBJECT_BROWSER/SET_LAST_AS_FILE",Jo="OBJECT_BROWSER/DOWNLOAD_FILE_LOADER",$o="OBJECT_BROWSER/DOWNLOADED_FILE",Xo=function(e,t,n){return{type:Vo,route:e,label:t,routeType:n}},es=function(e){return{type:Ho,toRoute:e}},ts=function(e){return{type:Yo,currentRoute:e}},ns=function(e){return{type:Jo,path:e}},as=function(e){return{type:$o,path:e}},cs={removeRouteLevel:es},is=Object(s.b)((function(e){var t=e.objectBrowser;return{objectsList:Z()(t,"routesList",[])}}),cs)(Object(N.a)((function(e){return Object(k.a)(Object(j.a)({},Le))}))((function(e){var t=e.classes,n=e.objectsList,c=e.removeRouteLevel,r=n.map((function(e,t){return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)($t.a,{to:e.route,onClick:function(){c(e.route)},children:e.label}),t<n.length-1&&Object(a.jsx)("span",{children:" / "})]},"breadcrumbs-".concat(t.toString()))}));return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("div",{className:t.sectionTitle,children:n&&n.length>0?n.slice(-1)[0].label:""})}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.breadcrumbs,children:r})]})}))),rs={addRoute:Xo,resetRoutesList:function(e){return{type:Go,reset:e}},displayErrorMessage:q},os=Object(s.b)(null,rs),ss=Object(l.g)(os(Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},usedSpaceCol:{width:150,textAlign:"right"},subTitleLabel:{alignItems:"center",display:"flex"},bucketName:{display:"flex",alignItems:"center"},iconBucket:{backgroundImage:"url(/images/ob_bucket_clear.svg)",backgroundRepeat:"no-repeat",backgroundPosition:"center center",width:16,height:40,marginRight:10},"@global":{".rowLine:hover .iconBucketElm":{backgroundImage:"url(/images/ob_bucket_filled.svg)"}},browsePaper:{height:"calc(100vh - 280px)"}},Ae),Ie),Le))}))((function(e){var t=e.classes,n=e.match,i=e.addRoute,r=e.resetRoutesList,o=e.displayErrorMessage,s=Object(c.useState)(!0),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)([]),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(!1),v=Object(b.a)(O,2),y=v[0],C=v[1],S=Object(c.useState)(""),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(!0),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(!1),M=Object(b.a)(I,2),L=M[0],D=M[1];Object(c.useEffect)((function(){_&&me.invoke("POST","/api/v1/has-permission",{actions:[{id:"createBucket",action:"s3:CreateBucket"}]}).then((function(e){var t=e.permissions.filter((function(e){return"createBucket"==e.id})).pop();t&&t.can?D(!0):D(!1),A(!1)})).catch((function(e){A(!1),q(e)}))}),[_,q]),Object(c.useEffect)((function(){r(!0)}),[n,r]),Object(c.useEffect)((function(){d&&me.invoke("GET","/api/v1/buckets").then((function(e){u(!1),h(e.buckets||[])})).catch((function(e){u(!1),o(e)}))}),[d,o]);var B=p.filter((function(e){return""===w||e.name.indexOf(w)>=0}));return Object(a.jsxs)(c.Fragment,{children:[y&&Object(a.jsx)(Dn,{open:y,closeModalAndRefresh:function(e){C(!1),e&&u(!0)}}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.obTitleSection,children:[Object(a.jsx)("div",{children:Object(a.jsx)(is,{})}),L&&Object(a.jsx)("div",{children:Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),onClick:function(){C(!0)},children:"Create Bucket"})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.actionsTray,children:Object(a.jsx)(f.a,{placeholder:"Search Buckets",className:t.searchField,id:"search-resource",label:"",onChange:function(e){N(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{itemActions:[{type:"view",sendOnlyId:!0,onClick:function(e){var t=Z()(n,"url","/object-browser"),a="".concat(t,"/").concat(e);i(a,e,"path")}}],columns:[{label:"Name",elementKey:"name",renderFunction:function(e){return Object(a.jsxs)("div",{className:t.bucketName,children:[Object(a.jsx)("div",{className:"".concat(t.iconBucket," iconBucketElm")}),Object(a.jsx)("span",{children:e})]})}},{label:"Used Space",elementKey:"size",renderFunction:ce,globalClass:t.usedSpaceCol,rowClass:t.usedSpaceCol,width:100,contentTextAlign:"right",headerTextAlign:"right"}],isLoading:d,records:B,entityName:"Buckets",idField:"name",customPaperHeight:t.browsePaper})})]})]})})))),ls=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({watchList:{background:"white",maxHeight:"400",overflow:"auto","& ul":{margin:"4",padding:"0"},"& ul li":{listStyle:"none",margin:"0",padding:"0",borderBottom:"1px solid #dedede"}},actionsTray:{textAlign:"right","& button":{marginLeft:10}},inputField:{background:"#FFFFFF",padding:12,borderRadius:5,marginLeft:10,boxShadow:"0px 3px 6px #00000012"},fieldContainer:{background:"#FFFFFF",padding:0,borderRadius:5,marginLeft:10,textAlign:"left",minWidth:"206",boxShadow:"0px 3px 6px #00000012"},lastElementWPadding:{paddingRight:"78"}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.match,n=e.classes,c=Z()(t,"url","");return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(zn,{label:"Object Browser"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,className:n.container,children:"/object-browser"===c&&Object(a.jsx)(ss,{})})})]})})),ds={setErrorSnackMessage:q},us=Object(s.b)(null,ds)((function(e){var t=e.closeDeleteModalAndRefresh,n=e.deleteOpen,i=e.selectedBucket,r=e.selectedObject,o=e.setErrorSnackMessage,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(a.jsxs)(dn.a,{open:n,onClose:function(){t(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete"}),Object(a.jsxs)(bn.a,{children:[d&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to delete: ",Object(a.jsx)("b",{children:r}),"?"," "]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){t(!1)},color:"primary",disabled:d,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){!function(){if(!d){var e=!1;r.endsWith("/")&&(e=!0),u(!0),me.invoke("DELETE","/api/v1/buckets/".concat(i,"/objects?path=").concat(r,"&recursive=").concat(e)).then((function(){u(!1),t(!0)})).catch((function(e){u(!1),o(e)}))}}()},color:"secondary",disabled:d,children:"Delete"})]})]})})),bs=n(614),js={createFolder:function(e){return{type:Qo,newRoute:e}}},ms=Object(s.b)(null,js)(Object(N.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},pathLabel:{marginTop:0,marginBottom:32}},ke))}))((function(e){var t=e.modalOpen,n=e.folderName,r=e.onClose,o=e.createFolder,s=e.classes,l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=n.split("/").slice(2).join("/");return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(pn,{modalOpen:t,title:"Add Folder",onClose:r,children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)("h3",{className:s.pathLabel,children:["Current Path: ",m,"/"]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{value:u,label:"Folder Path",id:"folderPath",name:"folderPath",placeholder:"Enter Folder Path",onChange:function(e){j(e.target.value)}})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:s.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:s.clearButton,onClick:function(){j("")},children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:""===u.trim(),onClick:function(){o(u),r()},children:"Save"})]})]})})})}))),ps=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 12.996",children:Object(a.jsxs)("g",{transform:"translate(-63.686 -70.783)",children:[Object(a.jsx)("path",{className:"a",d:"M74.736,79.879v1.95h-9.1v-1.95h-1.95v3.9h13v-3.9Z"}),Object(a.jsx)("path",{className:"a",d:"M69.211,80.533h1.95V73.861h1.525l-2.5-3.078-2.5,3.078h1.525Z"})]})})})},hs=n(340),Os=function(e,t,n,a,c){var i=document.createElement("a");document.body.appendChild(i);var r=new XMLHttpRequest,o=t.split("/"),s=o[o.length-1],l="/api/v1/buckets/".concat(e,"/objects/download?prefix=").concat(t);Object(hs.isNullOrUndefined)(n)||"null"===n||(l=l.concat("&version_id=".concat(n))),r.open("GET",l,!0),r.responseType="blob",r.onload=function(r){if(200===this.status){var o=new Blob([this.response],{type:"octet/stream"}),l=window.URL.createObjectURL(o);i.href=l,i.download=s,i.click(),window.URL.revokeObjectURL(l),i.remove(),a&&a("".concat(e,"/").concat(t).concat(c?"-".concat(n):""))}},r.send()},gs={backgroundRepeat:"no-repeat",backgroundPosition:"center center",width:16,minWidth:16,height:40,marginRight:10};var fs=Object(a.jsx)(v.a,{component:"h3",children:"Loading..."}),xs={addRoute:Xo,setAllRoutes:ts,setLastAsFile:function(){return{type:Zo}},setLoadingProgress:function(e){return{type:M,loadingProgress:e}},setSnackBarMessage:W,setErrorSnackMessage:q,fileIsBeingPrepared:ns,fileDownloadStarted:as},vs=Object(s.b)((function(e){var t=e.objectBrowser;return{routesList:Z()(t,"routesList",[]),downloadingFiles:Z()(t,"downloadingFiles",[])}}),xs),ys=Object(l.g)(vs(Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({seeMore:{marginTop:e.spacing(3)},paper:{display:"flex",overflow:"auto",flexDirection:"column"},addSideBar:{width:"320px",padding:"20px"},tableToolbar:{paddingLeft:e.spacing(2),paddingRight:e.spacing(0)},minTableHeader:{color:"#393939","& tr":{"& th":{fontWeight:"bold"}}},fileName:{display:"flex",alignItems:"center"},fileNameText:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},iconFolder:Object(j.a)({backgroundImage:"url(/images/ob_folder_clear.svg)"},gs),iconFile:Object(j.a)({backgroundImage:"url(/images/ob_file_clear.svg)"},gs),buttonsContainer:{"& .MuiButtonBase-root":{marginLeft:10}},browsePaper:{height:"calc(100vh - 280px)"},"@global":{".rowLine:hover .iconFileElm":{backgroundImage:"url(/images/ob_file_filled.svg)"},".rowLine:hover .iconFolderElm":{backgroundImage:"url(/images/ob_folder_filled.svg)"}}},Ae),Ie),Le),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=e.match,r=e.addRoute,o=e.setAllRoutes,s=e.routesList,l=e.downloadingFiles,d=e.setLastAsFile,u=e.setLoadingProgress,j=e.setSnackBarMessage,m=e.setErrorSnackMessage,p=e.fileIsBeingPrepared,h=e.fileDownloadStarted,O=Object(c.useState)([]),y=Object(b.a)(O,2),C=y[0],S=y[1],k=Object(c.useState)(!0),w=Object(b.a)(k,2),N=w[0],T=w[1],E=Object(c.useState)(!1),_=Object(b.a)(E,2),A=_[0],I=_[1],M=Object(c.useState)(!1),L=Object(b.a)(M,2),D=L[0],B=L[1],F=Object(c.useState)(""),R=Object(b.a)(F,2),P=R[0],z=R[1],K=Object(c.useState)(""),U=Object(b.a)(K,2),W=U[0],q=U[1],V=Object(c.useState)(""),G=Object(b.a)(V,2),H=G[0],Y=G[1],Q=Object(c.useState)(null),J=Object(b.a)(Q,2),$=(J[0],J[1]),X=Object(c.useState)(0),ee=Object(b.a)(X,2),te=ee[0],ne=ee[1],ae=Object(c.useState)(fs),ie=Object(b.a)(ae,2),re=ie[0],oe=ie[1];!function(e,t){var n=Object(c.useRef)(null);Object(c.useEffect)((function(){n.current=e}),[e]),Object(c.useEffect)((function(){if(null!==t){var e=setInterval((function(){void 0!==n&&n.current&&n.current()}),t);return function(){return clearInterval(e)}}}),[t])}((function(){N&&function(){var e=Date.now()-te;e/1e3>=6?oe(Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(v.a,{component:"h3",children:["This operation is taking longer than expected... (",Math.ceil(e/1e3),"s)"]})})):e/1e3>=3&&oe(Object(a.jsx)(v.a,{component:"h3",children:"This operation is taking longer than expected..."}))}()}),1e3),Object(c.useEffect)((function(){var e=n.params.bucket,t=n.params[0];if(N){var a="";t&&(a="?prefix=".concat(t,"/"));var c=Date.now()+0;ne(c),oe(fs);var i=me.invoke("GET","/api/v1/buckets/".concat(e,"/objects").concat(a)).then((function(t){q(e);var c=t.objects||[],i=[],r=[];c.forEach((function(e){e.name.endsWith("/")?i.push(e):r.push(e)}));var o=[].concat(i,r);S(o),t.objects||""===a?T(!1):function(){var e=n.params.bucket,t=n.params[0];me.invoke("GET","/api/v1/buckets/".concat(e,"/objects?prefix=").concat(t)).then((function(e){null!==e.objects?d():T(!1)})).catch((function(e){T(!1),m(e)}))}()})).catch((function(e){T(!1),m(e)}));$(i)}}),[N,n,d,m]),Object(c.useEffect)((function(){var e=Z()(n,"url","/object-browser");e!==s[s.length-1].route&&o(e)}),[n,s,o]),Object(c.useEffect)((function(){T(!0)}),[s,T]);var se=function(e){h(e)},le=function(e){var t=s[s.length-1].route.split("/").filter((function(e){return""!==e.trim()})),n="";t.length>2&&(n="".concat(t.slice(2).join("/"),"/")),function(e,t,n){if(null!==e&&void 0!==e&&null!==e.target&&void 0!==e.target){e.preventDefault();var a=e.target.files,c="/api/v1/buckets/".concat(t,"/objects/upload");""!==n&&(c="".concat(c,"?prefix=").concat(n));var i=new XMLHttpRequest,r=a.length>1,o="An error occurred while uploading the file".concat(r?"s":"","."),s="Object".concat(r?"s":""," uploaded successfully.");i.open("POST",c,!0),i.withCredentials=!1,i.onload=function(e){401!==i.status&&403!==i.status&&400!==i.status&&500!==i.status||j(o),200===i.status&&j(s)},i.upload.addEventListener("error",(function(e){j(o)})),i.upload.addEventListener("progress",(function(e){u(Math.floor(100*e.loaded/e.total))})),i.onerror=function(){j(o)},i.onloadend=function(){T(!0),u(100)};var l,d=new FormData,b=Object(yr.a)(a);try{for(b.s();!(l=b.n()).done;){var m=l.value,p=m.name,h=new Blob([m]);d.append(p,h)}}catch(O){b.e(O)}finally{b.f()}i.send(d),e.target.value=null}}(e,W,n)},de=[{type:"view",onClick:function(e){var t=Z()(n,"url","/object-browser");if(e.endsWith("/")){var a=e.substr(0,e.length-1).split("/"),c=a.length-1,i="".concat(t,"/").concat(a[c]);r(i,a[c],"path")}else{var o=e.split("/"),s=o[o.length-1],l="".concat(t,"/").concat(s);r(l,s,"file")}},sendOnlyId:!0},{type:"download",onClick:function(e){p("".concat(W,"/").concat(e.name)),e.size>104857600&&j("Download process started, it may take a few moments to complete"),Os(W,e.name,e.version_id,se)},showLoaderFunction:function(e){return l.includes("".concat(n.params.bucket,"/").concat(e))}},{type:"delete",onClick:function(e){I(!0),z(e)},sendOnlyId:!0}],ue=C.filter((function(e){return""===H||e.name.indexOf(H)>=0}));return Object(a.jsxs)(i.a.Fragment,{children:[A&&Object(a.jsx)(us,{deleteOpen:A,selectedBucket:W,selectedObject:P,closeDeleteModalAndRefresh:function(e){I(!1),e&&(j("Object '".concat(P,"' deleted successfully.")),T(!0))}}),D&&Object(a.jsx)(ms,{modalOpen:D,folderName:s[s.length-1].route,onClose:function(){B(!1)}}),Object(a.jsx)(zn,{label:"Object Browser"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.obTitleSection,children:[Object(a.jsx)("div",{children:Object(a.jsx)(is,{})}),Object(a.jsxs)("div",{className:t.buttonsContainer,children:[Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(at,{}),component:"label",onClick:function(){B(!0)},children:"Create Folder"}),Object(a.jsxs)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(ps,{}),component:"label",children:["File",Object(a.jsx)(bs.a,{type:"file",inputProps:{multiple:!0},onChange:function(e){return le(e)},id:"file-input",style:{display:"none"}})]})]})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.actionsTray,children:Object(a.jsx)(f.a,{placeholder:"Search Objects",className:t.searchField,id:"search-resource",label:"",onChange:function(e){Y(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{itemActions:de,columns:[{label:"Name",elementKey:"name",renderFunction:function(e){var n=e,c="".concat(t.iconFile," iconFileElm");e.endsWith("/")&&(c="".concat(t.iconFolder," iconFolderElm"),n=e.substr(0,e.length-1));var i=n.split("/");return Object(a.jsxs)("div",{className:t.fileName,children:[Object(a.jsx)("div",{className:c}),Object(a.jsx)("span",{className:t.fileNameText,children:i[i.length-1]})]})}},{label:"Last Modified",elementKey:"last_modified",renderFunction:function(e){return e.name.endsWith("/")?"":Object(a.jsx)(et.a,{children:e.last_modified})},renderFullObject:!0},{label:"Size",elementKey:"size",renderFunction:function(e){return e.name.endsWith("/")?"":ce(String(e.size))},renderFullObject:!0,width:60,contentTextAlign:"right"}],isLoading:N,loadingMessage:re,entityName:"Objects",idField:"name",records:ue,customPaperHeight:t.browsePaper})})]})})]})})))),Cs=n(671),Ss=n(342),ks=n.n(Ss),ws=n(341),Ns=n.n(ws),Ts=[{value:"01",label:"January"},{value:"02",label:"February"},{value:"03",label:"March"},{value:"04",label:"April"},{value:"05",label:"May"},{value:"06",label:"June"},{value:"07",label:"July"},{value:"08",label:"August"},{value:"09",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],Es=Array.from(Array(31),(function(e,t){return t+1})),_s=(new Date).getFullYear(),As=Array.from(Array(25),(function(e,t){return t+_s})),Is=Object(N.a)((function(e){return Object(k.a)({root:{"& .MuiSelect-icon":{color:"#000","&.Mui-disabled":{color:"#9c9c9c"}}},input:{borderBottom:0,fontSize:12}})}))(fn.a),Ms=Object(c.forwardRef)((function(e,t){var n=e.classes,i=e.id,r=e.label,o=e.disableOptions,s=void 0!==o&&o,l=e.addSwitch,d=void 0!==l&&l,u=e.tooltip,j=void 0===u?"":u,m=e.borderBottom,p=void 0!==m&&m,h=e.onDateChange,O=e.value,g=void 0===O?"":O;Object(c.useImperativeHandle)(t,(function(){return{resetDate:B}}));var f=Object(c.useState)(!1),v=Object(b.a)(f,2),y=v[0],C=v[1],S=Object(c.useState)(""),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),L=M[0],D=M[1];Object(c.useEffect)((function(){if(""!==g){var e=g.split("-");D(e[0]),N(e[1]),A("".concat(parseInt(e[2])))}}),[g]),Object(c.useEffect)((function(){var e=function(e,t,n){var a=Date.parse("".concat(e,"-").concat(t,"-").concat(n));if(isNaN(a))return[!1,""];var c=parseInt(t),i=parseInt(n),r=c<10?"0".concat(c):c,o=i<10?"0".concat(i):i,s=new Date(a).toISOString().split("T")[0],l="".concat(e,"-").concat(r,"-").concat(o);return[s===l,l]}(L,w,_),t=Object(b.a)(e,2),n=t[0],a=t[1];h(a,n)}),[w,_,L,h]);var B=function(){N(""),A(""),D("")},F=function(){return s||!!d&&!y};return Object(a.jsxs)(x.a,{item:!0,xs:12,className:Object(fe.a)(n.fieldContainer,Object(ge.a)({},n.fieldContainerBorder,p)),children:[Object(a.jsx)("div",{className:n.labelContainer,children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(tn.a,{htmlFor:i,className:n.inputLabel,children:[Object(a.jsx)("span",{children:r}),""!==j&&Object(a.jsx)("div",{className:n.tooltipContainer,children:Object(a.jsx)(nn.a,{title:j,placement:"top-start",children:Object(a.jsx)("div",{children:Object(a.jsx)(an,{className:n.tooltip})})})})]}),d&&Object(a.jsx)(Ln,{indicatorLabels:["Specific Date","Default (7 Days)"],checked:y,value:"date_enabled",id:"date-status",name:"date-status",onChange:function(e){C(e.target.checked),e.target.checked||h("",!0)},switchOnly:!0})]})}),Object(a.jsxs)("div",{children:[Object(a.jsx)(xn.a,{disabled:F(),className:n.dateInput,children:Object(a.jsxs)(vn.a,{id:"".concat(i,"-month"),name:"".concat(i,"-month"),value:w,displayEmpty:!0,onChange:function(e){N(e.target.value)},input:Object(a.jsx)(Is,{}),children:[Object(a.jsx)(yn.a,{value:"",disabled:!0,children:"<Month>"}),Ts.map((function(e){return Object(a.jsx)(yn.a,{value:e.value,children:e.label},"select-".concat(i,"-monthOP-").concat(e.label))}))]})}),Object(a.jsx)(xn.a,{disabled:F(),className:n.dateInput,children:Object(a.jsxs)(vn.a,{id:"".concat(i,"-day"),name:"".concat(i,"-day"),value:_,displayEmpty:!0,onChange:function(e){A(e.target.value)},input:Object(a.jsx)(Is,{}),children:[Object(a.jsx)(yn.a,{value:"",disabled:!0,children:"<Day>"}),Es.map((function(e){return Object(a.jsx)(yn.a,{value:e,children:e},"select-".concat(i,"-dayOP-").concat(e))}))]})}),Object(a.jsx)(xn.a,{disabled:F(),className:n.dateInput,children:Object(a.jsxs)(vn.a,{id:"".concat(i,"-year"),name:"".concat(i,"-year"),value:L,displayEmpty:!0,onChange:function(e){D(e.target.value)},input:Object(a.jsx)(Is,{}),children:[Object(a.jsx)(yn.a,{value:"",disabled:!0,children:"<Year>"}),As.map((function(e){return Object(a.jsx)(yn.a,{value:e,children:e},"select-".concat(i,"-yearOP-").concat(e))}))]})})]})]})})),Ls=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({dateInput:{"&:not(:last-child)":{marginRight:22}}},Se),we),{},{labelContainer:{flex:1},fieldContainer:Object(j.a)(Object(j.a)({},Se.fieldContainer),{},{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:10,marginTop:11,marginBottom:6}),fieldContainerBorder:{borderBottom:"#9c9c9c 1px solid",marginBottom:20}}))}))(Ms),Ds=Object(s.b)(null,{setModalSnackMessage:V,setModalErrorSnackMessage:G}),Bs=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({copyButtonContainer:{paddingLeft:16},modalContent:{paddingBottom:53}},ke))}))(Ds((function(e){var t=e.classes,n=e.open,r=e.closeModalAndRefresh,o=e.bucketName,s=e.dataObject,l=e.setModalSnackMessage,d=e.setModalErrorSnackMessage,u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(!1),O=Object(b.a)(h,2),f=O[0],v=O[1],y=Object(c.useState)(""),C=Object(b.a)(y,2),S=C[0],k=C[1],w=Object(c.useState)(!0),N=Object(b.a)(w,2),T=N[0],E=N[1];return Object(c.useEffect)((function(){if(T){v(!0),p("");var e=new Date("".concat(S,"T23:59:59")),t=new Date,n=e.getTime()-t.getTime();return n<0?(d("Selected date must be greater than current time."),p(""),void v(!1)):n>6048e5?(d("You can share a file only for less than 7 days."),p(""),void v(!1)):void me.invoke("GET","/api/v1/buckets/".concat(o,"/objects/share?prefix=").concat(s.name,"&version_id=").concat(s.version_id).concat(""!==S?"&expires=".concat(n,"ms"):"")).then((function(e){p(e),v(!1)})).catch((function(e){d(e),p(""),v(!1)}))}}),[s,S,o,T,p,d]),Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(pn,{title:"Share File",modalOpen:n,onClose:function(){r()},children:Object(a.jsxs)(x.a,{container:!0,className:t.modalContent,children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.dateContainer,children:Object(a.jsx)(Ls,{id:"date",label:"Active until",borderBottom:!1,addSwitch:!0,onDateChange:function(e,t){E(t),k(t?e:"")}})}),Object(a.jsxs)(x.a,{container:!0,item:!0,xs:12,children:[Object(a.jsx)(x.a,{item:!0,xs:10,children:Object(a.jsx)(Vn,{content:m})}),Object(a.jsx)(x.a,{item:!0,xs:2,className:t.copyButtonContainer,children:Object(a.jsx)(Ns.a,{text:m,children:Object(a.jsx)(g.a,{variant:"contained",color:"primary",startIcon:Object(a.jsx)(nt,{}),onClick:function(){l("Share URL Copied to clipboard")},disabled:""===m||f,children:"Copy"})})})]})]})})})}))),Fs=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",children:[Object(a.jsx)("path",{d:"M11.05 8.617v2.429h-9.1v-9.1h2.429v-1.95H0v13h13V8.617z",className:"a"}),Object(a.jsx)("path",{d:"M3.854 9.256h1.95a4.945 4.945 0 013.6-4.74v1.3l.6-.487 2.474-2.012L9.4.817v1.7a6.9 6.9 0 00-5.546 6.739z",className:"a"})]})})},Rs=function(){return Object(a.jsx)(tt.a,{children:Object(a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 12.996",children:[Object(a.jsx)("path",{d:"M11.05 9.096v1.95h-9.1v-1.95H0v3.9h13v-3.9z"}),Object(a.jsx)("path",{d:"M6.5 9.75L9 6.672H7.475V0h-1.95v6.672H4z"})]})})},Ps={setModalErrorSnackMessage:G},zs=Object(s.b)(null,Ps),Ks=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({objectName:{fontSize:18,fontWeight:700,marginBottom:40},buttonContainer:{textAlign:"right"}},ke))}))(zs((function(e){var t=e.classes,n=e.open,i=e.closeModalAndRefresh,r=e.objectName,o=e.objectInfo,s=e.bucketName,l=e.setModalErrorSnackMessage,d=Object(c.useState)(!0),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(""),h=Object(b.a)(p,2),O=h[0],f=h[1],v=Object(c.useState)(""),y=Object(b.a)(v,2),C=y[0],S=y[1],k=Object(c.useState)(!1),w=Object(b.a)(k,2),N=w[0],T=w[1],E=Object(c.useState)(!1),_=Object(b.a)(E,2),A=_[0],I=_[1],M=Object(c.useState)(!1),L=Object(b.a)(M,2),D=L[0],B=L[1];Object(c.useEffect)((function(){if(o.retention_mode&&(f(o.retention_mode.toLowerCase()),B(!0)),o.retention_until_date){var e=new Date(o.retention_until_date);if("Invalid Date"!==e.toString()){var t=e.getFullYear(),n=(c=e.getMonth()+1)<10?"0".concat(c):"".concat(c),a=e.getDate();isNaN(a)||"NaN"===n||isNaN(t)||S("".concat(t,"-").concat(n,"-").concat(a))}B(!0)}var c}),[o]);var F=Object(c.useRef)(null),R=function(){m(!1),f(""),F.current&&F.current.resetDate()},P=D&&("governance"===O||""===O);return Object(a.jsxs)(pn,{title:"Set Retention Policy",modalOpen:n,onClose:function(){R(),i(!1)},children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.objectName,children:r}),Object(a.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault()}(e)},children:[P&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"status",id:"status",name:"status",checked:j,onChange:function(e){m(!j)},label:"Status",indicatorLabels:["Enabled","Disabled"]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(_n,{currentSelection:O,id:"type",name:"type",label:"Type",disableOptions:!j||D&&""!==O,onChange:function(e){f(e.target.value)},selectorOptions:[{label:"Governance",value:"governance"},{label:"Compliance",value:"compliance"}]})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ls,{id:"date",label:"Date",disableOptions:!(j&&("governance"===O||"compliance"===O)),ref:F,value:C,borderBottom:!0,onDateChange:function(e,t){T(t),t&&S(e)}})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:R,children:"Reset"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:j&&""===O||j&&!N||A,onClick:function(){I(!0);var e=o.name,t=o.version_id,n=j||"governance"!==O?"".concat(C,"T23:59:59Z"):"";j||"governance"!==O?function(e,t,n){me.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/retention?prefix=").concat(e,"&version_id=").concat(t),{expires:n,mode:O}).then((function(e){I(!1),i(!0)})).catch((function(e){l(e),I(!1)}))}(e,t,n):function(e,t){me.invoke("DELETE","/api/v1/buckets/".concat(s,"/objects/retention?prefix=").concat(e,"&version_id=").concat(t)).then((function(){I(!1),i(!0)})).catch((function(e){l(e),I(!1)}))}(e,t)},children:"Save"})]})]})]})}))),Us={setModalErrorSnackMessage:G},Ws=Object(s.b)(null,Us),qs=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},pathLabel:{marginTop:0,marginBottom:32}},ke))}))(Ws((function(e){var t=e.modalOpen,n=e.currentTags,r=e.selectedObject,o=e.onCloseAndUpdate,s=e.bucketName,l=e.versionId,d=e.setModalErrorSnackMessage,u=e.classes,m=Object(c.useState)(""),p=Object(b.a)(m,2),h=p[0],O=p[1],f=Object(c.useState)(""),v=Object(b.a)(f,2),y=v[0],C=v[1],S=Object(c.useState)(!1),k=Object(b.a)(S,2),w=k[0],N=k[1];return Object(a.jsx)(i.a.Fragment,{children:Object(a.jsx)(pn,{modalOpen:t,title:"Add New Tag",onClose:function(){o(!1)},children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)("h3",{className:u.pathLabel,children:["Selected Object: ",r]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{value:h,label:"New Tag Key",id:"newTagKey",name:"newTagKey",placeholder:"Enter New Tag Key",onChange:function(e){O(e.target.value)}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{value:y,label:"New Tag Label",id:"newTagLabel",name:"newTagLabel",placeholder:"Enter New Tag Label",onChange:function(e){C(e.target.value)}})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:u.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:u.clearButton,onClick:function(){C(""),O("")},children:"Clear"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:""===y.trim()||""===h.trim()||w,onClick:function(){N(!0);var e={};e[h]=y;var t=Object(j.a)(Object(j.a)({},n),e);me.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/tags?prefix=").concat(r,"&version_id=").concat(l),{tags:t}).then((function(e){N(!1),o(!0)})).catch((function(e){d(e),N(!1)}))},children:"Save"})]})]})})})}))),Vs={setErrorSnackMessage:q},Gs=Object(s.b)(null,Vs),Hs=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({buttonContainer:{textAlign:"right"},pathLabel:{marginTop:0,marginBottom:32}},ke))}))(Gs((function(e){var t=e.deleteOpen,n=e.currentTags,i=e.selectedObject,r=e.selectedTag,o=e.onCloseAndUpdate,s=e.bucketName,l=e.versionId,d=e.setErrorSnackMessage,u=e.classes,m=Object(c.useState)(!1),p=Object(b.a)(m,2),h=p[0],O=p[1],f=Object(b.a)(r,2),x=f[0],v=f[1];return Object(a.jsxs)(dn.a,{open:t,onClose:function(){o(!1)},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsx)(un.a,{id:"alert-dialog-title",children:"Delete Tag"}),Object(a.jsxs)(bn.a,{children:[h&&Object(a.jsx)(y.a,{}),Object(a.jsxs)(Bn.a,{id:"alert-dialog-description",children:["Are you sure you want to delete the tag"," ",Object(a.jsxs)("b",{className:u.wrapText,children:[x," : ",v]})," ","from ",i,"?"]})]}),Object(a.jsxs)(Fn.a,{children:[Object(a.jsx)(g.a,{onClick:function(){o(!1)},color:"primary",disabled:h,children:"Cancel"}),Object(a.jsx)(g.a,{onClick:function(){O(!0);var e=Object(j.a)({},n);delete e[x],me.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/tags?prefix=").concat(i,"&version_id=").concat(l),{tags:e}).then((function(e){O(!1),o(!0)})).catch((function(e){d(e),O(!1)}))},color:"secondary",autoFocus:!0,children:"Delete"})]})]})}))),Ys={setModalErrorSnackMessage:G},Qs=Object(s.b)(null,Ys),Zs=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({objectName:{fontSize:18,fontWeight:700,marginBottom:40},buttonContainer:{textAlign:"right"}},ke))}))(Qs((function(e){var t=e.classes,n=e.open,i=e.closeModalAndRefresh,r=e.objectName,o=e.bucketName,s=e.actualInfo,l=e.setModalErrorSnackMessage,d=Object(c.useState)(!1),u=Object(b.a)(d,2),j=u[0],m=u[1],p=Object(c.useState)(!1),h=Object(b.a)(p,2),O=h[0],f=h[1],v=s.version_id;Object(c.useEffect)((function(){var e=Z()(s,"legal_hold_status","OFF");m("ON"===e)}),[s]);var y=function(){m(!1)};return Object(a.jsxs)(pn,{title:"Set Legal Hold",modalOpen:n,onClose:function(){y(),i(!1)},children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.objectName,children:r}),Object(a.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault(),f(!0),me.invoke("PUT","/api/v1/buckets/".concat(o,"/objects/legalhold?prefix=").concat(r,"&version_id=").concat(v),{status:j?"enabled":"disabled"}).then((function(){f(!1),i(!0)})).catch((function(e){l(e),f(!1)}))}(e)},children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Ln,{value:"legalhold",id:"legalhold",name:"legalhold",checked:j,onChange:function(e){m(!j)},label:"Legal Hold Status",indicatorLabels:["Enabled","Disabled"],tooltip:"To enable this feature you need to enable versioning on the bucket before creation"})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.buttonContainer,children:[Object(a.jsx)("button",{type:"button",color:"primary",className:t.clearButton,onClick:y,children:"Reset"}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:O,children:"Save"})]})]})]})}))),Js={is_latest:!0,last_modified:"",legal_hold_status:"",name:"",retention_mode:"",retention_until_date:"",size:"0",tags:{},version_id:null},$s={removeRouteLevel:es,setErrorSnackMessage:q,fileIsBeingPrepared:ns,fileDownloadStarted:as,setSnackBarMessage:W},Xs=Object(s.b)((function(e){var t=e.objectBrowser;return{downloadingFiles:Z()(t,"downloadingFiles",[])}}),$s)(Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({objectNameContainer:{marginBottom:8},objectPathContainer:{marginBottom:26,fontSize:10},objectPathLink:{"&:visited":{color:"#000"}},objectName:{fontSize:24},propertiesContainer:{display:"flex",flexDirection:"row",marginBottom:15},propertiesItem:{display:"flex",flexDirection:"row",marginRight:21},propertiesItemBold:{fontWeight:700},propertiesValue:{marginLeft:8,textTransform:"capitalize"},propertiesIcon:{marginLeft:5},actionsIconContainer:{marginLeft:12},actionsIcon:{height:16,width:16,"& .MuiSvgIcon-root":{height:16}},tagsContainer:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:15},tagText:{marginRight:13},tag:{marginRight:6,fontSize:10,fontWeight:700,"&.MuiChip-sizeSmall":{height:18},"& .MuiSvgIcon-root":{height:10,width:10}},search:{marginBottom:8,"&.MuiFormControl-root":{marginRight:0}},"@global":{".progressDetails":{paddingTop:3,display:"inline-block",position:"relative",width:18,height:18},".progressDetails > .MuiCircularProgress-root":{position:"absolute",left:0,top:3}}},Ae),Ie),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=e.routesList,r=e.downloadingFiles,o=e.removeRouteLevel,s=e.setErrorSnackMessage,l=e.setSnackBarMessage,d=e.fileIsBeingPrepared,j=e.fileDownloadStarted,m=Object(c.useState)(!0),p=Object(b.a)(m,2),h=p[0],O=p[1],g=Object(c.useState)(!1),v=Object(b.a)(g,2),y=v[0],S=v[1],k=Object(c.useState)(!1),w=Object(b.a)(k,2),N=w[0],T=w[1],E=Object(c.useState)(!1),_=Object(b.a)(E,2),A=_[0],I=_[1],M=Object(c.useState)(!1),L=Object(b.a)(M,2),D=L[0],B=L[1],F=Object(c.useState)(["",""]),R=Object(b.a)(F,2),P=R[0],z=R[1],K=Object(c.useState)(!1),U=Object(b.a)(K,2),W=U[0],q=U[1],V=Object(c.useState)(Js),G=Object(b.a)(V,2),H=G[0],Y=G[1],Q=Object(c.useState)([]),J=Object(b.a)(Q,2),$=J[0],X=J[1],ee=Object(c.useState)(""),te=Object(b.a)(ee,2),ne=te[0],ae=te[1],ce=Object(c.useState)(!1),ie=Object(b.a)(ce,2),re=ie[0],oe=ie[1],se=n[n.length-1].route.split("/"),le=se[se.length-1],de=se[2],ue=se.slice(3).join("/");Object(c.useEffect)((function(){h&&me.invoke("GET","/api/v1/buckets/".concat(de,"/objects?prefix=").concat(ue,"&with_versions=true")).then((function(e){var t=Z()(e,"objects",[]);Y(t.find((function(e){return e.is_latest}))||Js),X(t.filter((function(e){return!e.is_latest}))),O(!1)})).catch((function(e){s(e),O(!1)}))}),[h,de,ue,s]);var be=[];H.tags&&(be=Object.keys(H.tags));var je=function(){S(!0)},pe=function(e){j(e)},he=function(e,t){d("".concat(de,"/").concat(e.name).concat(t?"-".concat(e.version_id):"")),e.size&&parseInt(e.size)>104857600&&l("Download process started, it may take a few moments to complete"),Os(de,ue,e.version_id,pe,t)},Oe=[{type:"share",onClick:je,sendOnlyId:!0},{type:"download",onClick:function(e){he(e,!0)},showLoaderFunction:function(e){return r.includes("".concat(de,"/").concat(le,"-").concat(e))}}],ge=$.filter((function(e){return!!e.version_id&&e.version_id.includes(ne)}));return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(zn,{label:"Object Browser"}),y&&Object(a.jsx)(Bs,{open:y,closeModalAndRefresh:function(){S(!1)},bucketName:de,dataObject:H}),N&&Object(a.jsx)(Ks,{open:N,closeModalAndRefresh:function(e){T(!1),e&&O(!0)},objectName:le,objectInfo:H,bucketName:de}),re&&Object(a.jsx)(us,{deleteOpen:re,selectedBucket:de,selectedObject:ue,closeDeleteModalAndRefresh:function(e){if(oe(!1),e){var t=se.slice(0,-1).join("/");o(t),u.push(t)}}}),A&&Object(a.jsx)(qs,{modalOpen:A,currentTags:H.tags,selectedObject:ue,versionId:H.version_id,bucketName:de,onCloseAndUpdate:function(e){I(!1),e&&O(!0)}}),D&&Object(a.jsx)(Hs,{deleteOpen:D,currentTags:H.tags,selectedObject:ue,versionId:H.version_id,bucketName:de,onCloseAndUpdate:function(e){B(!1),e&&O(!0)},selectedTag:P}),W&&Object(a.jsx)(Zs,{open:W,closeModalAndRefresh:function(e){q(!1),e&&O(!0)},objectName:ue,bucketName:de,actualInfo:H}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.obTitleSection,children:Object(a.jsx)("div",{children:Object(a.jsx)(is,{})})}),Object(a.jsx)("br",{}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.propertiesContainer,children:[H.version_id&&"null"!==H.version_id&&Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsxs)("div",{className:t.propertiesItem,children:[Object(a.jsxs)("div",{children:[Object(a.jsx)("span",{className:t.propertiesItemBold,children:"Legal Hold:"}),Object(a.jsx)("span",{className:t.propertiesValue,children:H.legal_hold_status?H.legal_hold_status.toLowerCase():"Off"})]}),Object(a.jsx)("div",{children:Object(a.jsx)(It.a,{color:"primary","aria-label":"legal-hold",size:"small",className:t.propertiesIcon,onClick:function(){q(!0)},children:Object(a.jsx)(Vt,{active:!0})})})]}),Object(a.jsxs)("div",{className:t.propertiesItem,children:[Object(a.jsxs)("div",{children:[Object(a.jsx)("span",{className:t.propertiesItemBold,children:"Retention:"}),Object(a.jsx)("span",{className:t.propertiesValue,children:H.retention_mode?H.retention_mode.toLowerCase():"Undefined"})]}),Object(a.jsx)("div",{children:Object(a.jsx)(It.a,{color:"primary","aria-label":"retention",size:"small",className:t.propertiesIcon,onClick:function(){T(!0)},children:Object(a.jsx)(Vt,{active:!0})})})]})]}),Object(a.jsxs)("div",{className:t.propertiesItem,children:[Object(a.jsx)("div",{className:t.propertiesItemBold,children:"File Actions:"}),Object(a.jsx)("div",{className:t.actionsIconContainer,children:Object(a.jsx)(It.a,{color:"primary","aria-label":"share",size:"small",className:t.actionsIcon,onClick:function(){je()},children:Object(a.jsx)(Fs,{})})}),Object(a.jsx)("div",{className:t.actionsIconContainer,children:r.includes("".concat(de,"/").concat(H.name))?Object(a.jsx)("div",{className:"progressDetails",children:Object(a.jsx)(C.a,{color:"primary",size:17,variant:"indeterminate"})}):Object(a.jsx)(It.a,{color:"primary","aria-label":"download",size:"small",className:t.actionsIcon,onClick:function(){he(H)},children:Object(a.jsx)(Rs,{})})}),Object(a.jsx)("div",{className:t.actionsIconContainer,children:Object(a.jsx)(It.a,{color:"primary","aria-label":"delete",size:"small",className:t.actionsIcon,onClick:function(){oe(!0)},children:Object(a.jsx)(ct,{})})})]})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.tagsContainer,children:[Object(a.jsx)("div",{className:t.tagText,children:"Tags:"}),be&&be.map((function(e,n){var c=Z()(H,"tags.".concat(e),"");return""!==c?Object(a.jsx)(Cs.a,{className:t.tag,size:"small",label:"".concat(e," : ").concat(c),color:"primary",deleteIcon:Object(a.jsx)(ks.a,{}),onDelete:function(){!function(e,t){z([e,t]),B(!0)}(e,c)}},"chip-".concat(n)):null})),Object(a.jsx)(Cs.a,{className:t.tag,icon:Object(a.jsx)(Dr.a,{}),clickable:!0,size:"small",label:"Add tag",color:"primary",variant:"outlined",onClick:function(){I(!0)}})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.actionsTray,children:H.version_id&&"null"!==H.version_id&&Object(a.jsx)(f.a,{placeholder:"Search ".concat(le),className:Object(fe.a)(t.search,t.searchField),id:"search-resource",label:"",onChange:function(e){ae(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:H.version_id&&"null"!==H.version_id&&Object(a.jsx)(ln,{itemActions:Oe,columns:[{label:"Version ID",elementKey:"version_id"},{label:"Last Modified",elementKey:"last_modified",renderFunction:function(e){return Object(a.jsx)(et.a,{children:e})}}],isLoading:!1,entityName:"Versions",idField:"version_id",records:ge})})]})})]})}))),el={setAllRoutes:ts},tl=Object(s.b)((function(e){var t=e.objectBrowser;return{routesList:Z()(t,"routesList",[])}}),el),nl=Object(l.g)(tl((function(e){var t=e.routesList,n=e.match,i=e.setAllRoutes,r=t[t.length-1];return Object(c.useEffect)((function(){var e=Z()(n,"url","/object-browser");e!==t[t.length-1].route&&i(e)}),[n,t,i]),"path"===r.type?Object(a.jsx)(ys,{}):Object(a.jsx)(Xs,{routesList:t})}))),al=n(200),cl=n.n(al),il=[{id:0,title:"Community",price:"Open Source",capacityMin:""},{id:1,title:"Standard",price:"$10/TB/month",capacityMax:"Up to 10PB. No additional charges for capacity over 10PB",capacityMin:""},{id:2,title:"Enterprise",price:"$20/TB/month",capacityMax:"Up to 5PB. No additional charges for capacity over 5PB",capacityMin:""}],rl=[{id:0,field:"License",community:"GNU AGPL v3",communityDetail:"",standard:"Commercial License",standardDetail:"",enterprise:"Commercial License",enterpriseDetail:""},{id:1,field:"Software Release",community:"Update to latest",standard:"1 Year Long Term Support",enterprise:"5 Years Long Term Support"},{id:2,field:"SLA",community:"No SLA",standard:"<24 hours",enterprise:"<1 hour"},{id:3,field:"Support",community:"Community:",communityDetail:"Public Slack Channel + Github Issues",standard:"24x7 L4 direct engineering",standardDetail:"Support via SUBNET",enterprise:"24x7 L4 direct engineering",enterpriseDetail:"Support via SUBNET"},{id:4,field:"Security Updates & Critical Bugs",community:"Self Update",standard:"Guided Update",enterprise:"Guided Update"},{id:5,field:"Panic Button",community:"N/A",standard:"1 per year",enterprise:"Unlimited"},{id:6,field:"Annual Architecture Review",community:"N/A",standard:"Yes",enterprise:"Yes"},{id:7,field:"Annual Performance Review",community:"N/A",standard:"Yes",enterprise:"Yes"},{id:8,field:"Indemnification",community:"N/A",standard:"N/A",enterprise:"Yes"},{id:9,field:"Security + Policy Review",community:"N/A",standard:"N/A",enterprise:"Yes"}],ol=[{id:0,text:"Join Slack",text2:"",link:"https://slack.min.io",plan:"community"},{id:1,text:"Subscribe",text2:"Upgrade",link:"https://subnet.min.io/subscription",plan:"standard"},{id:2,text:"Subscribe",text2:"Upgrade",link:"https://subnet.min.io/subscription",plan:"enterprise"}],sl=n(343),ll=n.n(sl),dl=n(344),ul=n.n(dl),bl={setModalErrorSnackMessage:G},jl=Object(s.b)(null,bl),ml=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({errorBlock:{color:"red"},subnetLicenseKey:{padding:"10px 10px 10px 0px",borderRight:"1px solid rgba(0, 0, 0, 0.12)",opacity:.5,"&:hover":{opacity:1}},subnetLoginForm:{padding:"10px 0px 10px 10px",opacity:.5,"&:hover":{opacity:1}},licenseKeyField:{},pageTitle:{marginBottom:20},button:{textTransform:"none",fontSize:15,fontWeight:700,background:"transparent linear-gradient(90deg, #073052 0%, #081c42 100%) 0% 0% no-repeat padding-box",color:"#fff"},buttonSignup:{textTransform:"none",fontSize:15,fontWeight:700,marginLeft:15}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(jl((function(e){var t=e.classes,n=e.open,i=e.closeModal,r=e.setModalErrorSnackMessage,o=Object(c.useState)(""),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(""),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(""),O=Object(b.a)(h,2),C=O[0],S=O[1],k=Object(c.useState)(!1),w=Object(b.a)(k,2),N=w[0],T=w[1],E=function(){if(!N){T(!0);var e={license:l,email:C,password:m};me.invoke("POST","/api/v1/subscription/validate",e).then((function(){T(!1),d(""),p(""),S(""),i()})).catch((function(e){T(!1),d(""),p(""),S(""),r(e)}))}};return n?Object(a.jsxs)(pn,{title:"",modalOpen:n,onClose:function(){d(""),p(""),S(""),i()},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(a.jsxs)(x.a,{container:!0,alignItems:"center",item:!0,xs:12,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{component:"h2",variant:"h6",className:t.pageTitle,children:"Activate SUBNET License"})}),Object(a.jsxs)(x.a,{item:!0,className:t.subnetLicenseKey,xs:6,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(v.a,{variant:"caption",display:"block",gutterBottom:!0,children:"Enter your license key here"})}),Object(a.jsx)(f.a,{id:"license-key",placeholder:"",multiline:!0,rows:3,value:l,onChange:function(e){return d(e.target.value)},fullWidth:!0,className:t.licenseKeyField,variant:"outlined"}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",onClick:function(){return E()},disabled:N||0===l.trim().length,children:"Activate"})]}),Object(a.jsx)(x.a,{item:!0,className:t.subnetLoginForm,xs:6,children:Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{overlayIcon:Object(a.jsx)(ll.a,{}),id:"subnet-email",name:"subnet-email",onChange:function(e){S(e.target.value)},placeholder:"email",label:"",type:"text",value:C})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(gn,{overlayIcon:Object(a.jsx)(ul.a,{}),id:"subnet-password",name:"subnet-password",onChange:function(e){p(e.target.value)},placeholder:"password",label:"",type:"password",value:m})}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsx)(g.a,{className:t.button,color:"primary",onClick:function(){return E()},disabled:N||0===C.trim().length||0===m.trim().length,variant:"contained",children:"Activate"}),Object(a.jsx)(g.a,{className:t.buttonSignup,color:"primary",target:"_blank",rel:"noopener noreferrer",href:"#",onClick:function(e){e.preventDefault(),window.open("https://min.io/pricing","_blank")},variant:"outlined",children:"Sign Up"})]})]})})]}),N&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})})]}):null}))),pl=Object(s.b)((function(e){return{operatorMode:e.system.operatorMode}}),null)(Object(N.a)((function(e){return Object(k.a)(Object(j.a)({pageTitle:{fontSize:18,marginBottom:20},paper:{padding:"20px 52px 20px 28px"},licenseContainer:{position:"relative",padding:"20px 52px 0px 28px",background:"#032F51",boxShadow:"0px 3px 7px #00000014","& h2":{color:"#FFF",marginBottom:67},"& a":{textDecoration:"none"},"& h3":{color:"#FFFFFF",marginBottom:"30px",fontWeight:"bold"},"& h6":{color:"#FFFFFF !important"}},tableContainer:{marginLeft:28},detailsContainer:{textAlign:"center",paddingBottom:12,borderRadius:"3px 3px 0 0",marginLeft:8,maxWidth:"calc(25% - 8px)"},detailsContainerBorder:{border:"1px solid #e2e2e2",borderBottom:0,borderRadius:"4px 4px 0px 0px"},detailsContainerBorderHighlighted:{border:"1px solid #B5B5B5",borderBottom:0},detailsTitle:{fontSize:19,fontWeight:700,marginBottom:26,paddingTop:18},activePlanHeader:{fontWeight:700,background:"#D5DDE5",borderRadius:"3px 3px 0px 0px",color:"#121212",padding:8,borderTop:"1px solid #D5DDE5",marginTop:-2},planHeader:{background:"#FFFFFF",borderRadius:"3px 3px 0px 0px",padding:8,borderTop:"1px solid #D5DDE5"},detailsPrice:{fontSize:13,fontWeight:700,marginBottom:8},detailsCapacityMax:{minHeight:28,fontSize:10,fontWeight:700,marginBottom:12,padding:"0% 15%"},detailsCapacityMin:{fontSize:10},itemContainer:{height:36},itemContainerDetail:{height:48},item:{height:"100%",borderLeft:"1px solid #e2e2e2",borderRight:"1px solid #e2e2e2",textAlign:"center",fontSize:10,fontWeight:700,display:"flex",alignItems:"center",alignContent:"center",marginLeft:8,maxWidth:"calc(25% - 8px)",borderTop:"1px solid #e5e5e5"},itemFirst:{borderLeft:0,borderRight:0},itemHighlighted:{borderLeft:"1px solid #B5B5B5",borderRight:"1px solid #B5B5B5"},field:{textAlign:"left",fontWeight:400,fontSize:12},checkIcon:{height:12,color:"transparent linear-gradient(90deg, #073052 0%, #081c42 100%) 0% 0% no-repeat padding-box"},buttonContainer:{paddingTop:8,paddingBottom:24,height:"100%",display:"flex",justifyContent:"center",borderRadius:"0 0 3px 3px",border:"1px solid #e2e2e2",borderTop:0,marginLeft:8,maxWidth:"calc(25% - 8px)"},buttonContainerBlank:{border:0},buttonContainerHighlighted:{border:"1px solid #B5B5B5",borderTop:0},button:{textTransform:"none",fontSize:15,fontWeight:700},licenseButton:{float:"right",marginTop:25,marginRight:25},openSourcePolicy:{color:"#1C5A8D",fontWeight:"bold"},activateLink:{color:"#1C5A8D",fontWeight:"bold",clear:"both",background:"none",border:"none",textDecoration:"underline",cursor:"pointer"},subnetRefreshLicenseLink:{color:"#1C5A8D",fontWeight:"bold",clear:"both",background:"none",border:"none",textDecoration:"underline",cursor:"pointer",fontSize:13},fullWidth:{width:"100%",height:"100%"},midWidth:{width:"70%",float:"left",height:"100%"},smallWidth:{width:"30%",float:"right",height:"100%",borderRadius:"0px 3px 0px 0px !important"},licenseInfo:{color:"#FFFFFF",position:"relative"},licenseInfoTitle:{textTransform:"none",color:"#BFBFBF",fontSize:11},licenseInfoValue:{textTransform:"none",fontSize:14,fontWeight:"bold"},licenseDescription:{background:"#032F51",padding:"30px 30px",borderTop:"1px solid #e2e5e4",borderLeft:"1px solid #e2e5e4",borderRight:"1px solid #e2e5e4",bottom:0,left:"5%",right:"5%",position:"absolute"},currentPlanBG:{background:"#022A4A 0% 0% no-repeat padding-box",color:"#FFFFFF",borderTop:"1px solid #52687d"},currentPlanButton:{background:"#FFFFFF",color:"#022A4A","&:hover":{background:"#FFFFFF"}},planItemsPadding:{padding:"23px 33px"},subnetSubTitle:{fontSize:12},verifiedIcon:{width:96,position:"absolute",right:0,bottom:29},loadingLoginStrategy:{textAlign:"center"}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=e.operatorMode,r=function(){E(!0),me.invoke("GET","/api/v1/subscription/info").then((function(e){e&&("STANDARD"===e.plan?k(1):"ENTERPRISE"===e.plan?k(2):k(1),p(e)),E(!1)})).catch((function(e){E(!1)}))},o=Object(c.useState)(!1),s=Object(b.a)(o,2),l=s[0],d=s[1],u=Object(c.useState)(),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(0),O=Object(b.a)(h,2),f=O[0],k=O[1],w=Object(c.useState)(!0),N=Object(b.a)(w,2),T=N[0],E=N[1],_=Object(c.useState)(!1),A=Object(b.a)(_,2),I=A[0],M=A[1];return Object(c.useEffect)((function(){r()}),[]),T?Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(y.a,{})}):Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(zn,{label:"License"}),Object(a.jsxs)(x.a,{container:!0,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsx)(S.a,{className:"".concat(t.licenseContainer," ").concat(t.midWidth),children:m?Object(a.jsx)(i.a.Fragment,{children:Object(a.jsxs)(x.a,{container:!0,className:t.licenseInfo,children:[Object(a.jsxs)(x.a,{item:!0,xs:6,children:[Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"License"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:"Commercial License"}),Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Organization"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:m.organization}),Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Registered Capacity"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:ce((1099511627776*m.storage_capacity).toString(10))}),Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Expiry Date"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:Object(a.jsx)(et.a,{format:"YYYY-MM-DD",children:m.expires_at})})]}),Object(a.jsxs)(x.a,{item:!0,xs:6,children:[Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Subscription Plan"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:m.plan}),Object(a.jsx)(v.a,{variant:"button",display:"block",gutterBottom:!0,className:t.licenseInfoTitle,children:"Requester"}),Object(a.jsx)(v.a,{variant:"overline",display:"block",gutterBottom:!0,className:t.licenseInfoValue,children:m.email})]}),Object(a.jsx)("img",{className:t.verifiedIcon,src:"/verified.svg"})]})}):Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)("img",{src:"/agpl.svg",height:40,alt:"agpl"}),Object(a.jsx)(v.a,{component:"h2",variant:"h6",children:"GNU Affero General Public License"}),Object(a.jsx)("a",{href:"https://www.gnu.org/licenses/agpl-3.0.html",target:"_blank",rel:"nofollow noopener noreferrer",children:Object(a.jsxs)("div",{className:t.licenseDescription,children:[Object(a.jsx)(v.a,{component:"h3",children:"Version 3"}),Object(a.jsx)(v.a,{component:"h6",children:"The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the Community in the case of network server software."})]})})]})}),Object(a.jsx)(S.a,{className:"".concat(t.paper," ").concat(t.smallWidth),children:m?Object(a.jsxs)(i.a.Fragment,{children:[" ",Object(a.jsx)(v.a,{component:"h2",variant:"h6",className:t.pageTitle,children:"Login to MinIO SUBNET !"}),Object(a.jsx)(v.a,{component:"h6",className:t.subnetSubTitle,children:"It combines a commercial license with a support experience unlike any other."}),Object(a.jsx)("br",{}),Object(a.jsx)(g.a,{variant:"contained",color:"primary",className:t.button,target:"_blank",rel:"noopener noreferrer",href:"https://subnet.min.io/support/?ref=".concat(n?"op":"con"),children:"Login to SUBNET"}),n&&Object(a.jsxs)(i.a.Fragment,{children:[" ",Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)("button",{className:t.subnetRefreshLicenseLink,onClick:function(e){e.preventDefault(),M(!0),me.invoke("POST","/api/v1/subscription/refresh",{}).then((function(e){e&&("STANDARD"===e.plan?k(1):"ENTERPRISE"===e.plan?k(2):k(1),p(e)),M(!1)})).catch((function(e){M(!1)}))},children:"Refresh Licence"}),I&&Object(a.jsx)(C.a,{size:16,className:t.loadingLoginStrategy})]})]}):Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(v.a,{component:"h2",variant:"h6",className:t.pageTitle,children:"Choosing between GNU AGPL v3 and Commercial License"}),Object(a.jsx)(v.a,{component:"h6",children:"If you are building proprietary applications, you may want to choose the commercial license included as part of the Standard and Enterprise subscription plans. Applications must otherwise comply with all the GNU AGPLv3 License & Trademark obligations. Follow the links below to learn more about the compliance policy."}),Object(a.jsx)("br",{}),Object(a.jsx)("a",{href:"https://min.io/compliance?ref=".concat(n?"op":"con"),className:t.openSourcePolicy,target:"_blank",rel:"nofollow noopener noreferrer",children:"Open Source Policy Compliance"}),Object(a.jsx)("br",{}),Object(a.jsx)("br",{}),Object(a.jsx)("a",{href:"https://min.io/logo?ref=".concat(n?"op":"con"),className:t.openSourcePolicy,target:"_blank",rel:"nofollow noopener noreferrer",children:"Trademark Policy"})]})})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:Object(fe.a)(t.planItemsPadding),children:Object(a.jsx)(S.a,{className:t.paper,style:{borderRadius:"0px 0px 3px 3px"},children:Object(a.jsxs)(x.a,{container:!0,children:[n?Object(a.jsx)(ml,{open:l,closeModal:function(){return d(!1),void r()}}):null,Object(a.jsxs)(x.a,{container:!0,item:!0,xs:12,className:t.tableContainer,children:[Object(a.jsxs)(x.a,{container:!0,item:!0,xs:12,children:[Object(a.jsx)(x.a,{item:!0,xs:3,className:t.detailsContainer}),il.map((function(e){var n=!m&&"Community"===e.title||m&&m.plan.toLowerCase()===e.title.toLowerCase();return Object(a.jsxs)(x.a,{container:!0,item:!0,xs:3,className:Object(fe.a)(t.detailsContainer,t.detailsContainerBorder,Object(ge.a)({},t.detailsContainerBorderHighlighted,"Community"!==e.title),n?t.currentPlanBG:""),children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:n?t.activePlanHeader:t.planHeader,children:n?"Current Plan":"\xa0"}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.detailsTitle,children:e.title}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.detailsPrice,children:e.price}),Object(a.jsx)(x.a,{item:!0,xs:12,className:t.detailsCapacityMax,children:e.capacityMax||""})]},e.id)}))]}),rl.map((function(e){return Object(a.jsxs)(x.a,{container:!0,item:!0,xs:12,className:Object(fe.a)(t.itemContainer,e.communityDetail&&t.itemContainerDetail),children:[Object(a.jsx)(x.a,{item:!0,xs:3,className:Object(fe.a)(t.item,t.field,t.itemFirst),children:e.field}),Object(a.jsxs)(x.a,{container:!0,item:!0,xs:3,className:Object(fe.a)(t.item,0===f?t.currentPlanBG:""),children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:"N/A"===e.community?"":"Yes"===e.community?Object(a.jsx)(cl.a,{className:t.checkIcon}):e.community}),void 0!==e.communityDetail&&Object(a.jsx)(x.a,{item:!0,xs:12,children:e.communityDetail})]}),Object(a.jsx)(x.a,{container:!0,item:!0,xs:3,className:Object(fe.a)(t.item,t.itemHighlighted,1===f?t.currentPlanBG:""),children:Object(a.jsx)(x.a,{item:!0,xs:12,children:"N/A"===e.standard?"":"Yes"===e.standard?Object(a.jsx)(cl.a,{className:t.checkIcon}):e.standard})}),Object(a.jsx)(x.a,{container:!0,item:!0,xs:3,className:Object(fe.a)(t.item,t.itemHighlighted,2===f?t.currentPlanBG:""),children:Object(a.jsx)(x.a,{item:!0,xs:12,children:"N/A"===e.enterprise?"":"Yes"===e.enterprise?Object(a.jsx)(cl.a,{className:t.checkIcon}):e.enterprise})})]},e.id)})),Object(a.jsxs)(x.a,{container:!0,item:!0,xs:12,children:[Object(a.jsx)(x.a,{item:!0,xs:3,className:Object(fe.a)(t.buttonContainer,t.buttonContainerBlank)}),ol.map((function(e,c){return Object(a.jsxs)(x.a,{container:!0,item:!0,xs:3,style:{textAlign:"center"},className:Object(fe.a)(t.buttonContainer,f===c?t.currentPlanBG:"",Object(ge.a)({},t.buttonContainerHighlighted,"Subscribe"===e.text)),children:[Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(g.a,{variant:"contained",color:"primary",className:Object(fe.a)(t.button,f===c?t.currentPlanButton:""),target:"_blank",rel:"noopener noreferrer",href:"#",disabled:m&&m.plan.toLowerCase()===e.plan.toLowerCase(),onClick:function(t){t.preventDefault(),window.open("".concat(e.link,"/?ref=").concat(n?"op":"con"),"_blank")},children:f!==c&&c>0?e.text2:e.text})}),n&&"Subscribe"===e.text&&!(m&&m.plan.toLowerCase()===e.plan.toLowerCase())&&Object(a.jsx)(x.a,{item:!0,xs:12,style:{marginTop:"10px"},children:Object(a.jsx)("button",{className:t.activateLink,onClick:function(e){e.preventDefault(),d(!0)},children:"Activate"})})]},e.id)}))]})]})]})})})]})]})})}))),hl=n(89),Ol="TRACE_MESSAGE_RECEIVED",gl="TRACE_RESET_MESSAGES";var fl=function(e){var t="ws";return"https:"===e&&(t="wss"),t},xl=n(110),vl=n.n(xl),yl=Object(s.b)((function(e){return{messages:e.trace.messages}}),{traceMessageReceived:function(e){return{type:Ol,message:e}},traceResetMessages:function(){return{type:gl}}})(Object(N.a)((function(e){return Object(k.a)(Object(j.a)({logList:{background:"white",height:"400px",overflow:"auto","& ul":{margin:"4px",padding:"0px"},"& ul li":{listStyle:"none",margin:"0px",padding:"0px",borderBottom:"1px solid #dedede"}},sizeItem:{width:150},timeItem:{width:100}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=e.traceMessageReceived,r=e.traceResetMessages,o=e.messages;return Object(c.useEffect)((function(){r();var e=new URL(window.location.toString()),t=e.port,a=fl(e.protocol),c=new hl.w3cwebsocket("".concat(a,"://").concat(e.hostname,":").concat(t,"/ws/trace")),i=null;if(null!==c)return c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok"),i=setInterval((function(){c.send("ok")}),1e4)},c.onmessage=function(e){var t=JSON.parse(e.data.toString());t.ptime=vl()(t.time,"YYYY-MM-DD HH:mm:s.SSSS +0000 UTC").toDate(),t.key=Math.random(),n(t)},c.onclose=function(){clearInterval(i),console.log("connection closed by server")},function(){c.close(1e3),clearInterval(i),console.log("closing websockets")}}),[n,r]),Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(zn,{label:"Trace"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,className:t.container,children:Object(a.jsx)(ln,{itemActions:[],columns:[{label:"Time",elementKey:"ptime",renderFunction:function(e){var t=new Date(e);return re(t)},globalClass:t.timeItem},{label:"Name",elementKey:"api"},{label:"Status",elementKey:"",renderFunction:function(e){return"".concat(e.statusCode," ").concat(e.statusMsg)},renderFullObject:!0},{label:"Location",elementKey:"configuration_id",renderFunction:function(e){return"".concat(e.host," ").concat(e.client)},renderFullObject:!0},{label:"Load Time",elementKey:"callStats.duration",globalClass:t.timeItem},{label:"Upload",elementKey:"callStats.rx",renderFunction:ce,globalClass:t.sizeItem},{label:"Download",elementKey:"callStats.tx",renderFunction:ce,globalClass:t.sizeItem}],isLoading:!1,records:o,entityName:"Traces",idField:"api",customEmptyMessage:"There are no traced Elements yet",autoScrollToBottom:!0})})})]})}))),Cl="LOG_MESSAGE_RECEIVED",Sl="LOG_RESET_MESSAGES";var kl=Object(s.b)((function(e){return{messages:e.logs.messages}}),{logMessageReceived:function(e){return{type:Cl,message:e}},logResetMessages:function(){return{type:Sl}}}),wl=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({logList:{background:"#fff",minHeight:400,height:"calc(100vh - 304px)",overflow:"auto",fontSize:13,padding:"25px 45px 0",border:"1px solid #EAEDEE",borderRadius:4},tab:{paddingLeft:25},logerror:{color:"#A52A2A"},logerror_tab:{color:"#A52A2A",paddingLeft:25},ansidefault:{color:"#000"},highlight:{"& span":{backgroundColor:"#082F5238"}}},Ae),Ie),Fe))}))(kl((function(e){var t=e.classes,n=e.logMessageReceived,i=e.logResetMessages,r=e.messages,o=Object(c.useState)(""),s=Object(b.a)(o,2),l=s[0],d=s[1];Object(c.useEffect)((function(){i();var e=new URL(window.location.toString()),t=e.port,a=fl(e.protocol),c=new hl.w3cwebsocket("".concat(a,"://").concat(e.hostname,":").concat(t,"/ws/console")),r=null;if(null!==c)return c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok"),r=setInterval((function(){c.send("ok")}),1e4)},c.onmessage=function(e){var t=JSON.parse(e.data.toString());t.time=vl()(t.time,"HH:mm:s UTC MM/DD/YYYY").toDate(),t.key=Math.random(),n(t)},c.onclose=function(){clearInterval(r),console.log("connection closed by server")},function(){c.close(1e3),clearInterval(r),console.log("closing websockets")}}),[n,i]);var u=function(e){var n=e.ConsoleMsg,c=(n=n.replace(/([^\x20-\x7F])/g,"")).replace(/((\[[0-9;]+m))/g,""),i=""!==l&&n.toLowerCase().includes(l.toLowerCase());return c.startsWith(" ")?Object(a.jsx)("div",{className:"".concat(i?t.highlight:""),children:Object(a.jsx)("span",{className:t.tab,children:c})},e.key):null!==e.error&&void 0!==e.error?function(e){var n=[];if(null!==e.error&&void 0!==e.error){if(e.api&&e.api.name){var c="API: ".concat(e.api.name),i=""!==l&&c.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsxs)("div",{className:"".concat(i?t.highlight:""),children:[Object(a.jsx)("br",{}),Object(a.jsx)("span",{className:t.logerror,children:c})]},"api-".concat(e.key)))}if(e.time){var r="Time: ".concat(re(e.time)),o=""!==l&&r.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsx)("div",{className:"".concat(o?t.highlight:""),children:Object(a.jsx)("span",{className:t.logerror,children:r})},"time-".concat(e.key)))}if(e.deploymentid){var s="DeploymentID: ".concat(e.deploymentid),d=""!==l&&s.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsx)("div",{className:"".concat(d?t.highlight:""),children:Object(a.jsx)("span",{className:t.logerror,children:s})},"deploytmentid-".concat(e.key)))}if(e.requestID){var u="RequestID: ".concat(e.requestID),b=""!==l&&u.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsx)("div",{className:"".concat(b?t.highlight:""),children:Object(a.jsx)("span",{className:t.logerror,children:u})},"requestid-".concat(e.key)))}if(e.remotehost){var j="RemoteHost: ".concat(e.remotehost),m=""!==l&&j.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsx)("div",{className:"".concat(m?t.highlight:""),children:Object(a.jsx)("span",{className:t.logerror,children:j})},"remotehost-".concat(e.key)))}if(e.host){var p="Host: ".concat(e.host),h=""!==l&&p.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsx)("div",{className:"".concat(h?t.highlight:""),children:Object(a.jsx)("span",{className:t.logerror,children:p})},"host-".concat(e.key)))}if(e.userAgent){var O="UserAgent: ".concat(e.userAgent),g=""!==l&&O.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsx)("div",{className:"".concat(g?t.highlight:""),children:Object(a.jsx)("span",{className:t.logerror,children:O})},"useragent-".concat(e.key)))}if(e.error.message){var f="Error: ".concat(e.error.message),x=""!==l&&f.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsx)("div",{className:"".concat(x?t.highlight:""),children:Object(a.jsx)("span",{className:t.logerror,children:f})},"message-".concat(e.key)))}if(e.error.source)for(var v in e.error.source){var y=e.error.source[v],C=""!==l&&y.toLowerCase().includes(l.toLowerCase());n.push(Object(a.jsx)("div",{className:"".concat(C?t.highlight:""),children:Object(a.jsx)("span",{className:t.logerror_tab,children:y})},"source-".concat(e.key,"-").concat(v)))}}return n}(e):Object(a.jsx)("div",{className:"".concat(i?t.highlight:""),children:Object(a.jsx)("span",{className:t.ansidefault,children:c})},e.key)},j=r.map((function(e){return u(e)}));return Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)(x.a,{container:!0,className:t.logsSubContainer,children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.actionsTray,children:Object(a.jsx)(f.a,{placeholder:"Highlight Line",className:t.searchField,id:"search-resource",label:"",onChange:function(e){d(e.target.value)},InputProps:{disableUnderline:!0,startAdornment:Object(a.jsx)(Ye.a,{position:"start",children:Object(a.jsx)(Ze.a,{})})}})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("div",{className:t.logList,children:j})})]})})}))),Nl=n(653),Tl=Object(N.a)((function(e){return Object(k.a)({searchField:Object(j.a)(Object(j.a)({},Ie.searchField),{},{height:30,padding:0,"& input":{padding:"0 12px",height:28,fontSize:12,fontWeight:600,color:"#393939"},"&.isDisabled":{"&:hover":{borderColor:"#EAEDEE"}},"& input.Mui-disabled":{backgroundColor:"#EAEAEA"}}),labelStyle:{color:"#393939",fontSize:12,marginBottom:4},buttonKit:{display:"flex",alignItems:"center"},toggleButton:{marginRight:10},fieldContainer:{flexGrow:1,margin:"0 15px"}})}))((function(e){var t=e.classes,n=e.label,i=e.onChange,r=e.value,o=e.placeholder,s=void 0===o?"":o,l=e.id,d=e.name;return Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)("div",{className:t.fieldContainer,children:[Object(a.jsx)("div",{className:t.labelStyle,children:n}),Object(a.jsx)("div",{className:t.buttonKit,children:Object(a.jsx)(f.a,{placeholder:s,id:l,name:d,label:"",onChange:function(e){i(e.target.value)},InputProps:{disableUnderline:!0},className:t.searchField,value:r})})]})})})),El={setErrorSnackMessage:q},_l=Object(s.b)(null,El),Al=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)(Object(j.a)({inputBar:{flexGrow:1,marginLeft:15},advancedLabel:{display:"flex",alignItems:"center",color:"#091C42",border:0,backgroundColor:"transparent",cursor:"pointer","&:focus, &:active":{outline:"none"}},advancedLabelContainer:{marginTop:10},getInformationContainer:{textAlign:"right"},orderButton:{width:93},recordsLabel:{alignSelf:"center",marginLeft:15},blockCollapsed:{height:0,overflowY:"hidden",transitionDuration:"0.3s"},filterOpen:{height:200,marginBottom:12},endLineAction:{marginBottom:15},filtersContainer:{display:"flex",justifyContent:"space-between",marginBottom:12},innerContainer:{backgroundColor:"#fff",border:"#EAEDEE 1px solid",borderRadius:3,padding:10,marginBottom:15},noticeLabel:{marginLeft:15,marginBottom:15,fontSize:12,color:"#9C9C9C"},tableFOpen:{height:"calc(100vh - 561px)"},tableFClosed:{height:"calc(100vh - 349px)"},"@global":{".overrideMargin":{marginLeft:0}}},Ie),Ae),Fe),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))(_l((function(e){var t=e.classes,n=e.setErrorSnackMessage,i=Object(c.useState)(!0),r=Object(b.a)(i,2),o=r[0],s=r[1],l=Object(c.useState)(null),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)(null),p=Object(b.a)(m,2),h=p[0],O=p[1],f=Object(c.useState)(!1),v=Object(b.a)(f,2),y=v[0],C=v[1],S=Object(c.useState)([]),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)(""),E=Object(b.a)(T,2),_=E[0],A=E[1],I=Object(c.useState)(""),M=Object(b.a)(I,2),L=M[0],D=M[1],B=Object(c.useState)(""),F=Object(b.a)(B,2),R=F[0],P=F[1],z=Object(c.useState)(""),K=Object(b.a)(z,2),U=K[0],W=K[1],q=Object(c.useState)(""),V=Object(b.a)(q,2),G=V[0],H=V[1],Y=Object(c.useState)(""),Q=Object(b.a)(Y,2),J=Q[0],$=Q[1],X=Object(c.useState)("DESC"),ee=Object(b.a)(X,2),te=ee[0],ne=ee[1],ae=Object(c.useState)(["time","api_name","bucket","object","remote_host","request_id","user_agent","response_status"]),ie=Object(b.a)(ae,2),re=ie[0],oe=ie[1],se=Object(c.useState)(0),le=Object(b.a)(se,2),de=le[0],ue=le[1],je=Object(c.useState)(!1),pe=Object(b.a)(je,2),he=pe[0],Oe=pe[1],ge=null,fe=Object(c.useCallback)((function(){if(!he){Oe(!0);var e="".concat(""!==_?"&fp=bucket:".concat(_):"").concat(""!==U?"&fp=object:".concat(U):"").concat(""!==L?"&fp=api_name:".concat(L):"").concat(""!==G?"&fp=request_id:".concat(G):"").concat(""!==R?"&fp=user_agent:".concat(R):"").concat(""!==J?"&fp=response_status:".concat(J):"");(e=e.trim()).endsWith(",")&&(e=e.slice(0,-1)),me.invoke("GET","/api/v1/logs/search?q=reqinfo".concat(""!==e?"".concat(e):"","&pageSize=100&pageNo=").concat(de,"&order=").concat("DESC"===te?"timeDesc":"timeAsc").concat(null!==u?"&timeStart=".concat(u.toISOString()):"").concat(null!==h?"&timeEnd=".concat(h.toISOString()):"")).then((function(e){var t=e.results||[],n=[].concat(Object(He.a)(w),Object(He.a)(t));s(!1),Oe(!1),N(n),ue(de+1),null!==ge&&ge()})).catch((function(e){s(!1),Oe(!1),n(e)}))}}),[_,U,L,G,R,J,de,te,u,h,he,w,ge,n]);Object(c.useEffect)((function(){o&&(N([]),fe())}),[o,te,fe]);return Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)(x.a,{container:!0,className:t.logsSubContainer,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:"".concat(t.actionsTray," ").concat(t.timeContainers),children:[Object(a.jsx)("span",{className:t.label,children:"Start Time"}),Object(a.jsx)(gc,{value:u,onChange:j}),Object(a.jsx)("span",{className:t.label,children:"End Time"}),Object(a.jsx)(gc,{value:h,onChange:O})]}),Object(a.jsx)(x.a,{item:!0,xs:12,className:"".concat(t.advancedLabelContainer),children:Object(a.jsx)("div",{className:"".concat(t.blockCollapsed," ").concat(y?t.filterOpen:""),children:Object(a.jsxs)("div",{className:t.innerContainer,children:[Object(a.jsxs)("div",{className:t.noticeLabel,children:["Enable your preferred options to get filtered records.",Object(a.jsx)("br",{}),"You can use '*' to match any character, '.' to signify a single character or '\\' to scape an special character (E.g. mybucket-*)"]}),Object(a.jsxs)("div",{className:t.filtersContainer,children:[Object(a.jsx)(Tl,{onChange:A,value:_,label:"Bucket",id:"bucket",name:"bucket"}),Object(a.jsx)(Tl,{onChange:D,value:L,label:"API Name",id:"api_name",name:"api_name"}),Object(a.jsx)(Tl,{onChange:P,value:R,label:"User Agent",id:"user_agent",name:"user_agent"})]}),Object(a.jsxs)("div",{className:t.filtersContainer,children:[Object(a.jsx)(Tl,{onChange:W,value:U,label:"Object",id:"object",name:"object"}),Object(a.jsx)(Tl,{onChange:H,value:G,label:"Request ID",id:"request_id",name:"request_id"}),Object(a.jsx)(Tl,{onChange:$,value:J,label:"Response Status",id:"response_status",name:"response_status"})]})]})})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:"".concat(t.actionsTray," ").concat(t.endLineAction),children:[Object(a.jsx)("div",{children:Object(a.jsxs)("button",{type:"button",className:"".concat(t.advancedLabel," overrideMargin"),onClick:function(){C(!y)},children:["Advanced Filters"," ",y?Object(a.jsx)(Nl.a,{}):Object(a.jsx)(Pt.a,{})]})}),Object(a.jsx)(g.a,{type:"button",variant:"contained",color:"primary",onClick:function(){ue(0),s(!0)},children:"Get Information"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(ln,{columns:[{label:"Timestamp",elementKey:"time",enableSort:!0},{label:"API Name",elementKey:"api_name"},{label:"Bucket",elementKey:"bucket"},{label:"Object",elementKey:"object"},{label:"Remote Host",elementKey:"remote_host"},{label:"Request ID",elementKey:"request_id"},{label:"User Agent",elementKey:"user_agent"},{label:"Response Status",elementKey:"response_status",renderFunction:function(e){return Object(a.jsx)(c.Fragment,{children:Object(a.jsxs)("span",{children:[e.response_status_code," (",e.response_status,")"]})})},renderFullObject:!0},{label:"Request Content Length",elementKey:"request_content_length",renderFunction:ce},{label:"Response Content Length",elementKey:"response_content_length",renderFunction:ce},{label:"Time to Response NS",elementKey:"time_to_response_ns",renderFunction:be,contentTextAlign:"right"}],isLoading:o,records:w,entityName:"Logs",customEmptyMessage:"There is no information with this criteria",idField:"request_id",columnsSelector:!0,columnsShown:re,onColumnChange:function(e,t){var n=Object(He.a)(re);t?n.includes(e)||n.push(e):n=re.filter((function(t){return t!==e})),oe(n)},customPaperHeight:y?t.tableFOpen:t.tableFClosed,sortConfig:{currentSort:"time",currentDirection:te,triggerSort:function(e){var t=Z()(e,"sortDirection","DESC");ne(t),ue(0),s(!0)}},infiniteScrollConfig:{recordsCount:1e6,loadMoreRecords:function(e){return fe(),new Promise((function(e){ge=e}))}},textSelectable:!0})})]})})}))),Il=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({headerLabel:{fontSize:22,fontWeight:600,color:"#000",marginTop:4}},(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=Object(c.useState)(0),i=Object(b.a)(n,2),r=i[0],o=i[1],s=Object(c.useState)(!0),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)(!1),m=Object(b.a)(j,2),p=m[0],h=m[1];return Object(c.useEffect)((function(){me.invoke("GET","/api/v1/logs/search?q=reqinfo&pageSize=10&pageNo=0").then((function(){h(!0),u(!1)})).catch((function(e){u(!1),console.info("Log Search API not available.")}))}),[d]),Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(zn,{label:"Logs"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,className:t.container,children:d?Object(a.jsx)(y.a,{}):Object(a.jsxs)(c.Fragment,{children:[Object(a.jsx)(x.a,{item:!0,xs:12,className:t.headerLabel,children:"All Logs"}),Object(a.jsxs)($n.a,{value:r,onChange:function(e,t){o(t)},indicatorColor:"primary",textColor:"primary","aria-label":"cluster-tabs",children:[Object(a.jsx)(Xn.a,{label:"Error Logs"}),p&&Object(a.jsx)(Xn.a,{label:"Logs Search"})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,children:[0===r&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(wl,{})}),1===r&&p&&Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)(Al,{})})]})]})})})]})})),Ml=n(345),Ll=Object(N.a)((function(e){return Object(k.a)({root:{width:450,lineHeight:"50px",marginRight:15,"label + &":{marginTop:e.spacing(3)},"& .MuiSelect-select:focus":{backgroundColor:"transparent"}},input:{height:50,fontSize:13,lineHeight:"50px",width:450}})}))(fn.a),Dl=Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({watchList:{background:"white",maxHeight:"400",overflow:"auto","& ul":{margin:"4",padding:"0"},"& ul li":{listStyle:"none",margin:"0",padding:"0",borderBottom:"1px solid #dedede"}},graphContainer:{backgroundColor:"#fff",border:"#EAEDEE 1px solid",borderRadius:3,padding:"19px 38px"},scanInfo:{marginTop:20,display:"flex",flexDirection:"row",justifyContent:"space-between"},scanData:{fontSize:13},inlineCheckboxes:{display:"flex",justifyContent:"flex-start"}},Ae),Ie),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=Object(c.useState)(!1),r=Object(b.a)(n,2),o=r[0],s=r[1],l=Object(c.useState)(""),d=Object(b.a)(l,2),u=d[0],j=d[1],m=Object(c.useState)([]),p=Object(b.a)(m,2),h=p[0],O=p[1],v=Object(c.useState)(""),y=Object(b.a)(v,2),C=y[0],S=y[1],k=Object(c.useState)(!1),w=Object(b.a)(k,2),N=w[0],T=w[1],E=Object(c.useState)(!1),_=Object(b.a)(E,2),A=_[0],I=_[1],M=Object(c.useState)(!1),L=Object(b.a)(M,2),D=L[0],B=L[1],F=Object(c.useState)({beforeHeal:[0,0,0,0],afterHeal:[0,0,0,0],objectsHealed:0,objectsScanned:0,healDuration:0,sizeScanned:""}),R=Object(b.a)(F,2),P=R[0],z=R[1];Object(c.useEffect)((function(){me.invoke("GET","/api/v1/buckets").then((function(e){var t=[];null!==e.buckets&&(t=e.buckets),O(t)})).catch((function(e){console.log(e)}))}),[]),Object(c.useEffect)((function(){!0===A&&B(!1)}),[A]),Object(c.useEffect)((function(){!0===D&&I(!1)}),[D]);var K=function(e){return[e.Green,e.Yellow,e.Red,e.Grey]};Object(c.useEffect)((function(){if(o){var e={Green:0,Yellow:0,Red:0,Grey:0},t={Green:0,Yellow:0,Red:0,Grey:0},n=new URL(window.location.toString()),a=n.port,c=fl(n.protocol),i=new hl.w3cwebsocket("".concat(c,"://").concat(n.hostname,":").concat(a,"/ws/heal/").concat(u,"?prefix=").concat(C,"&recursive=").concat(N,"&force-start=").concat(A,"&force-stop=").concat(D));if(null!==i)return i.onopen=function(){console.log("WebSocket Client Connected"),i.send("ok")},i.onmessage=function(n){for(var a=JSON.parse(n.data.toString()),c=0,i=Object.entries(a.healthAfterCols);c<i.length;c++){var r=Object(b.a)(i[c],2),o=r[0],s=r[1];t[o]=100*s/a.itemsScanned}for(var l=0,d=Object.entries(a.healthBeforeCols);l<d.length;l++){var u=Object(b.a)(d[l],2),j=u[0],m=u[1];e[j]=100*m/a.itemsScanned}z({beforeHeal:K(e),afterHeal:K(t),objectsHealed:a.objectsHealed,objectsScanned:a.objectsScanned,healDuration:a.healDuration,sizeScanned:ce(a.bytesScanned.toString())})},i.onclose=function(){s(!1),console.log("connection closed by server")},function(){i.close(1e3),console.log("closing websockets")}}}),[o,u,A,D,C,N]);var U={labels:["Green","Yellow","Red","Grey"],datasets:[{label:"After Healing",data:P.afterHeal,backgroundColor:"rgba(0, 0, 255, 0.2)",borderColor:"rgba(54, 162, 235, 1)",borderWidth:1},{label:"Before Healing",data:P.beforeHeal,backgroundColor:"rgba(153, 102, 255, 0.2)",borderColor:"rgba(153, 102, 255, 1)",borderWidth:1}]},W=h.map((function(e){return{label:e.name,value:e.name}}));return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(zn,{label:"Heal"}),Object(a.jsx)(x.a,{container:!0,className:t.container,children:Object(a.jsxs)(x.a,{item:!0,xs:12,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(xn.a,{variant:"outlined",children:Object(a.jsxs)(vn.a,{id:"bucket-name",name:"bucket-name",value:u,onChange:function(e){j(e.target.value)},className:t.searchField,input:Object(a.jsx)(Ll,{}),displayEmpty:!0,children:[Object(a.jsx)(yn.a,{value:"",children:"Select Bucket"},"select-bucket-name-default"),W.map((function(e){return Object(a.jsx)(yn.a,{value:e.value,children:e.label},"select-bucket-name-".concat(e.label))}))]})}),Object(a.jsx)(f.a,{placeholder:"Prefix",className:t.searchField,id:"prefix-resource",label:"",disabled:!1,InputProps:{disableUnderline:!0},onChange:function(e){S(e.target.value)}}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:o,onClick:function(){return s(!0)},children:"Start"})]}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.inlineCheckboxes,children:[Object(a.jsx)(cn,{name:"recursive",id:"recursive",value:"recursive",checked:N,onChange:function(e){T(e.target.checked)},disabled:!1,label:"Recursive"}),Object(a.jsx)(cn,{name:"forceStart",id:"forceStart",value:"forceStart",checked:A,onChange:function(e){I(e.target.checked)},disabled:!1,label:"Force Start"}),Object(a.jsx)(cn,{name:"forceStop",id:"forceStop",value:"forceStop",checked:D,onChange:function(e){B(e.target.checked)},disabled:!1,label:"Force Stop"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.graphContainer,children:[Object(a.jsx)(Ml.HorizontalBar,{data:U,width:80,height:30,options:{title:{display:!0,text:"Item's Health Status [%]",fontSize:20},legend:{display:!0,position:"right"}}}),Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.scanInfo,children:[Object(a.jsxs)("div",{className:t.scanData,children:[Object(a.jsx)("strong",{children:"Size scanned:"})," ",P.sizeScanned]}),Object(a.jsxs)("div",{className:t.scanData,children:[Object(a.jsx)("strong",{children:"Objects healed:"})," ",P.objectsHealed," /"," ",P.objectsScanned]}),Object(a.jsxs)("div",{className:t.scanData,children:[Object(a.jsx)("strong",{children:"Healing time:"})," ",P.healDuration,"s"]})]})]})]})})]})})),Bl="WATCH_MESSAGE_RECEIVED",Fl="WATCH_RESET_MESSAGES";var Rl=Object(N.a)((function(e){return Object(k.a)({root:{width:450,lineHeight:"50px","label + &":{marginTop:e.spacing(3)},"& .MuiSelect-select:focus":{backgroundColor:"transparent"}},input:{height:50,fontSize:13,lineHeight:"50px",width:450}})}))(fn.a),Pl=Object(s.b)((function(e){return{messages:e.watch.messages}}),{watchMessageReceived:function(e){return{type:Bl,message:e}},watchResetMessages:function(){return{type:Fl}}})(Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)(Object(j.a)({watchList:{background:"white",height:"400px",overflow:"auto","& ul":{margin:"4px",padding:"0px"},"& ul li":{listStyle:"none",margin:"0px",padding:"0px",borderBottom:"1px solid #dedede"}},searchPrefix:{flexGrow:1,marginLeft:15}},Ae),Ie),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=e.watchMessageReceived,r=e.watchResetMessages,o=e.messages,s=Object(c.useState)(!1),l=Object(b.a)(s,2),d=l[0],u=l[1],j=Object(c.useState)("Select Bucket"),m=Object(b.a)(j,2),p=m[0],h=m[1],O=Object(c.useState)(""),v=Object(b.a)(O,2),y=v[0],C=v[1],S=Object(c.useState)(""),k=Object(b.a)(S,2),w=k[0],N=k[1],T=Object(c.useState)([]),E=Object(b.a)(T,2),_=E[0],A=E[1];Object(c.useEffect)((function(){me.invoke("GET","/api/v1/buckets").then((function(e){var t=[];null!==e.buckets&&(t=e.buckets),A(t)})).catch((function(e){console.log(e)}))}),[]),Object(c.useEffect)((function(){if(r(),d&&_.some((function(e){return e.name===p}))){var e=new URL(window.location.toString()),t=e.port,a=fl(e.protocol),c=new hl.w3cwebsocket("".concat(a,"://").concat(e.hostname,":").concat(t,"/ws/watch/").concat(p,"?prefix=").concat(y,"&suffix=").concat(w)),i=null;if(null!==c)return c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok"),i=setInterval((function(){c.send("ok")}),1e4)},c.onmessage=function(e){var t=JSON.parse(e.data.toString());t.Time=new Date(t.Time.toString()),t.key=Math.random(),n(t)},c.onclose=function(){clearInterval(i),console.log("connection closed by server"),u(!1)},function(){c.close(1e3),clearInterval(i),console.log("closing websockets")}}else u(!1)}),[n,d,_,p,y,w,r]);var I=_.map((function(e){return{label:e.name,value:e.name}}));return Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(zn,{label:"Watch"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.container,children:[Object(a.jsxs)(x.a,{item:!0,xs:12,className:t.actionsTray,children:[Object(a.jsx)(xn.a,{variant:"outlined",children:Object(a.jsxs)(vn.a,{id:"bucket-name",name:"bucket-name",value:p,onChange:function(e){h(e.target.value)},className:t.searchField,disabled:d,input:Object(a.jsx)(Rl,{}),children:[Object(a.jsx)(yn.a,{value:p,disabled:!0,children:"Select Bucket"},"select-bucket-name-default"),I.map((function(e){return Object(a.jsx)(yn.a,{value:e.value,children:e.label},"select-bucket-name-".concat(e.label))}))]})}),Object(a.jsx)(f.a,{placeholder:"Prefix",className:"".concat(t.searchField," ").concat(t.searchPrefix),id:"prefix-resource",label:"",disabled:d,InputProps:{disableUnderline:!0},onChange:function(e){C(e.target.value)}}),Object(a.jsx)(f.a,{placeholder:"Suffix",className:"".concat(t.searchField," ").concat(t.searchPrefix),id:"suffix-resource",label:"",disabled:d,InputProps:{disableUnderline:!0},onChange:function(e){N(e.target.value)}}),Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:d,onClick:function(){return u(!0)},children:"Start"})]}),Object(a.jsx)(x.a,{item:!0,xs:12,children:Object(a.jsx)("br",{})}),Object(a.jsx)(ln,{columns:[{label:"Time",elementKey:"Time",renderFunction:re},{label:"Size",elementKey:"Size",renderFunction:ce},{label:"Type",elementKey:"Type"},{label:"Path",elementKey:"Path"}],records:o,entityName:"Watch",customEmptyMessage:"No Changes at this time",idField:"watch_table",isLoading:!1})]})})]})}))),zl="HEALTH_INFO_MESSAGE_RECEIVED",Kl="HEALTH_INFO_RESET_MESSAGE";var Ul="error",Wl="success",ql="inProgress",Vl=Object(s.b)((function(e){return{message:e.healthInfo.message,serverDiagnosticStatus:e.system.serverDiagnosticStatus}}),{healthInfoMessageReceived:function(e){return{type:zl,message:e}},healthInfoResetMessage:function(){return{type:Kl}},setSnackBarMessage:W,setServerDiagStat:function(e){return{type:D,serverDiagnosticStatus:e}}})(Object(N.a)((function(e){return Object(k.a)(Object(j.a)(Object(j.a)({logList:{background:"#fff",minHeight:400,height:"calc(100vh - 270px)",overflow:"auto",fontSize:13,padding:"25px 45px",border:"1px solid #EAEDEE",borderRadius:4},loading:{paddingTop:8,paddingLeft:40},buttons:{justifyContent:"flex-start",gap:20}},Ae),(e.spacing(4),{container:{padding:"110px 33px 0","& h6":{color:"#777777",fontSize:14},"& p":{"& span:not(*[class*='smallUnit'])":{fontSize:16}}}})))}))((function(e){var t=e.classes,n=e.healthInfoMessageReceived,r=e.healthInfoResetMessage,o=e.message,s=e.setSnackBarMessage,l=e.setServerDiagStat,d=e.serverDiagnosticStatus,u=Object(c.useState)(!1),j=Object(b.a)(u,2),m=j[0],p=j[1],h=Object(c.useState)(!0),O=Object(b.a)(h,2),f=O[0],v=O[1];return Object(c.useEffect)((function(){d===Wl&&o!=={}&&v(!1),d===ql&&v(!0),p(!1)}),[d,o]),Object(c.useEffect)((function(){if(m){r();var e=new URL(window.location.toString()),t=e.port,a=fl(e.protocol),c=new hl.w3cwebsocket("".concat(a,"://").concat(e.hostname,":").concat(t,"/ws/health-info?deadline=1h")),i=null;null!==c&&(c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok"),i=setInterval((function(){c.send("ok")}),1e4),s("Diagnostic started. Please do not refresh page during diagnosis."),l(ql)},c.onmessage=function(e){var t=JSON.parse(e.data.toString());t.timestamp=new Date(t.timestamp.toString()),n(t)},c.onerror=function(e){console.log("error closing websocket:",e.message),c.close(1e3),clearInterval(i),l(Ul)},c.onclose=function(e){clearInterval(i),1011===e.code||1008===e.code||1006===e.code?(console.log("connection closed by server with code:",e.code),s("An error occurred while getting Diagnostic file."),l(Ul)):(console.log("connection closed by server"),s("Diagnostic file is ready to be downloaded."),l(Wl))})}else p(!1)}),[n,r,m,s,l]),Object(a.jsxs)(i.a.Fragment,{children:[Object(a.jsx)(zn,{label:"Diagnostic"}),Object(a.jsx)(x.a,{container:!0,children:Object(a.jsx)(x.a,{item:!0,xs:12,className:t.container,children:Object(a.jsxs)(x.a,{container:!0,className:t.buttons,children:[Object(a.jsx)(x.a,{item:!0,children:Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",disabled:m,onClick:function(){return p(!0)},children:"Start Diagnostic"})},"start-diag"),Object(a.jsx)(x.a,{item:!0,children:d===ql?Object(a.jsx)("div",{className:t.loading,children:Object(a.jsx)(C.a,{size:25})}):Object(a.jsx)(g.a,{type:"submit",variant:"contained",color:"primary",onClick:function(){!function(e,t){var n=document.createElement("a");n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t)),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}("diagnostic.json",JSON.stringify(o,null,2))},disabled:f,children:"Download"})},"start-download")]})})})]})}))),Gl=Object(s.b)((function(e){return{open:e.system.sidebarOpen,needsRestart:e.system.serverNeedsRestart,isServerLoading:e.system.serverIsLoading,session:e.console.session,loadingProgress:e.system.loadingProgress,snackBarMessage:e.system.snackBar}}),{setMenuOpen:z,serverNeedsRestart:K,serverIsLoading:function(e){return{type:I,isLoading:e}},setSnackBarMessage:W}),Hl=Object(N.a)((function(e){return Object(k.a)(Object(j.a)({root:{display:"flex","& .MuiPaper-root.MuiSnackbarContent-root":{borderRadius:"0px 0px 5px 5px",boxShadow:"none"}},toolbar:{background:e.palette.background.default,color:"black",paddingRight:24},toolbarIcon:Object(j.a)({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 8px"},e.mixins.toolbar),appBar:{zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})},appBarShift:{marginLeft:245,width:"calc(100% - ".concat(245,"px)"),transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})},menuButton:{marginRight:36},menuButtonHidden:{display:"none"},title:{flexGrow:1},drawerPaper:{position:"relative",whiteSpace:"nowrap",width:245,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden",background:"transparent linear-gradient(90deg, #073052 0%, #081C42 100%) 0% 0% no-repeat padding-box",boxShadow:"0px 3px 7px #00000014"},drawerPaperClose:Object(ge.a)({overflowX:"hidden",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),width:e.spacing(7)},e.breakpoints.up("sm"),{width:e.spacing(9)}),content:{flexGrow:1,height:"100vh",overflow:"auto",position:"relative"},container:{paddingBottom:e.spacing(4),margin:0,width:"100%",maxWidth:"initial"},paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column"},fixedHeight:{minHeight:240},warningBar:{background:e.palette.primary.main,color:"white",heigh:"60px",widht:"100%",lineHeight:"60px",textAlign:"center"},progress:{height:"3px",backgroundColor:"#eaeaea"}},ze))}))(Gl((function(e){var t=e.classes,n=e.open,i=e.needsRestart,r=e.isServerLoading,o=e.serverNeedsRestart,s=e.serverIsLoading,d=e.session,m=e.loadingProgress,p=e.snackBarMessage,h=e.setSnackBarMessage,O=Object(c.useState)(!1),f=Object(b.a)(O,2),x=f[0],v=f[1],C=d.pages.reduce((function(e,t,n){return e[t]=!0,e}),{}),S=[{component:kc,path:"/dashboard"},{component:Aa,path:"/buckets"},{component:Aa,path:"/buckets/:bucketName"},{component:ls,path:"/object-browser"},{component:nl,path:"/object-browser/:bucket"},{component:nl,path:"/object-browser/:bucket/*"},{component:Pl,path:"/watch"},{component:_i,path:"/users"},{component:Ui,path:"/groups"},{component:Ba,path:"/policies"},{component:Dl,path:"/heal"},{component:yl,path:"/trace"},{component:Il,path:"/logs"},{component:Vl,path:"/health-info"},{component:Mr,path:"/settings"},{component:si,path:"/account",props:{changePassword:d.pages.includes("/account/change-password")}},{component:Fr,path:"/webhook/logger"},{component:Fr,path:"/webhook/audit"},{component:Bo,path:"/tenants"},{component:qo,path:"/namespaces/:tenantNamespace/tenants/:tenantName"},{component:pl,path:"/license"}].filter((function(e){return C[e.path]}));return Object(c.useEffect)((function(){""!==p.message?v(!0):v(!1)}),[p]),Object(a.jsx)(c.Fragment,{children:"ok"===d.status?Object(a.jsxs)("div",{className:t.root,children:[Object(a.jsx)(xe.a,{}),Object(a.jsx)(ve.a,{variant:"permanent",classes:{paper:Object(fe.a)(t.drawerPaper,!n&&t.drawerPaperClose)},open:n,children:Object(a.jsx)(Gc,{pages:d.pages})}),Object(a.jsxs)("main",{className:t.content,children:[i&&Object(a.jsx)("div",{className:t.warningBar,children:r?Object(a.jsxs)(c.Fragment,{children:["The server is restarting.",Object(a.jsx)(y.a,{className:t.progress})]}):Object(a.jsxs)(c.Fragment,{children:["The instance needs to be restarted for configuration changes to take effect."," ",Object(a.jsx)(g.a,{color:"secondary",size:"small",onClick:function(){s(!0),me.invoke("POST","/api/v1/service/restart",{}).then((function(e){console.log("success restarting service"),console.log(e),s(!1),o(!1)})).catch((function(e){s(!1),console.log("failure restarting service"),console.log(e)}))},children:"Restart"})]})}),m<100&&Object(a.jsx)(y.a,{className:t.progress,variant:"determinate",value:m}),Object(a.jsx)("div",{className:t.snackDiv,children:Object(a.jsx)(Ce.a,{open:x,onClose:function(){v(!1),h("")},autoHideDuration:"error"===p.type?1e4:5e3,message:p.message,className:t.snackBarExternal,ContentProps:{className:"".concat(t.snackBar," ").concat("error"===p.type?t.errorSnackBar:"")}})}),Object(a.jsx)(ye.a,{className:t.container,children:Object(a.jsx)(l.c,{history:u,children:Object(a.jsxs)(l.d,{children:[S.map((function(e){return Object(a.jsx)(l.b,{exact:!0,path:e.path,children:function(t){return Object(a.jsx)(e.component,Object(j.a)(Object(j.a)({},t),e.props))}},e.path)})),S.length>0?Object(a.jsx)(l.a,{to:S[0].path}):null]})})})]})]}):null})}))),Yl=function(e){var t=e.location,n=Object(c.useState)(""),i=Object(b.a)(n,2),r=i[0],o=i[1],s=Object(c.useState)(""),l=Object(b.a)(s,2),d=l[0],u=l[1];return Object(c.useEffect)((function(){var e=(t.search.match(/code=([^&]+)/)||[])[1],n=(t.search.match(/state=([^&]+)/)||[])[1],a=(t.search.match(/error=([^&]+)/)||[])[1],c=(t.search.match(/error_description=([^&]+)/)||[])[1];void 0!=a||void 0!=c?(o(a),u(c)):me.invoke("POST","/api/v1/login/oauth2/auth",{code:e,state:n}).then((function(e){e&&e.sessionId&&($.a.setItem("token",e.sessionId),window.location.href="/")})).catch((function(e){window.location.href="/login"}))}),[]),""!=r||""!=d?Object(a.jsxs)("div",{children:[Object(a.jsx)("h2",{children:"IDP Error:"}),Object(a.jsx)("p",{children:r}),Object(a.jsx)("p",{children:d})]}):null},Ql=n(346),Zl="SESSION_RESPONSE";var Jl=Object(s.b)((function(e){return{loggedIn:e.system.loggedIn}}),{userLoggedIn:P,consoleOperatorMode:function(e){return{type:E,operatorMode:e}},saveSessionResponse:function(e){return{type:Zl,message:e}}})((function(e){var t=e.Component,n=e.loggedIn,i=e.userLoggedIn,r=e.consoleOperatorMode,o=e.saveSessionResponse,s=Object(c.useState)(!0),d=Object(b.a)(s,2),u=d[0],j=d[1];return Object(c.useEffect)((function(){me.invoke("GET","/api/v1/session").then((function(e){o(e),i(!0),j(!1),e.operator&&(r(!0),document.title="MinIO Operator")})).catch((function(){return j(!1)}))}),[o,r,i]),u?null:n?Object(a.jsx)(t,{}):Object(a.jsx)(l.a,{to:{pathname:"/login"}})})),$l=Object(Ql.hot)((function(){return Object(a.jsx)(l.c,{history:u,children:Object(a.jsxs)(l.d,{children:[Object(a.jsx)(l.b,{exact:!0,path:"/oauth_callback",component:Yl}),Object(a.jsx)(l.b,{exact:!0,path:"/login",component:Oe}),Object(a.jsx)(Jl,{Component:Hl})]})})})),Xl=n(126),ed=n(347),td={loggedIn:!1,operatorMode:!1,session:"",userName:"",sidebarOpen:!0,serverNeedsRestart:!1,serverIsLoading:!1,loadingProgress:100,snackBar:{message:"",type:"message"},modalSnackBar:{message:"",type:"message"},serverDiagnosticStatus:""};var nd={messages:[]};var ad={messages:[]};var cd={message:{}};var id={messages:[]};var rd={session:{operator:!1,status:"",pages:[],features:[]}};var od={open:!1,addBucketName:"",addBucketVersioningEnabled:!1,addBucketLockingEnabled:!1,addBucketQuotaEnabled:!1,addBucketQuotaType:"hard",addBucketQuotaSize:"1",addBucketQuotaUnit:"TiB",addBucketRetentionEnabled:!1,addBucketRetentionMode:"compliance",addBucketRetentionUnit:"days",addBucketRetentionValidity:1};var sd=[{route:"/object-browser",label:"All Buckets",type:"path"}],ld={routesList:sd,downloadingFiles:[]};var dd=n(348),ud=n.n(dd),bd={createTenant:{page:0,validPages:[],advancedModeOn:!1,storageClasses:[],limitSize:{},fields:{nameTenant:{tenantName:"",namespace:"",selectedStorageClass:""},configure:{customImage:!1,imageName:"",consoleImage:"",customDockerhub:!1,imageRegistry:"",imageRegistryUsername:"",imageRegistryPassword:"",exposeMinIO:!0,exposeConsole:!0},identityProvider:{idpSelection:"Built-in",openIDURL:"",openIDClientID:"",openIDSecretID:"",ADURL:"",ADSkipTLS:!1,ADServerInsecure:!1,ADUserNameFilter:"",ADGroupBaseDN:"",ADGroupSearchFilter:"",ADNameAttribute:""},security:{enableAutoCert:!0,enableCustomCerts:!1,enableTLS:!0},encryption:{enableEncryption:!1,encryptionType:"vault",gemaltoEndpoint:"",gemaltoToken:"",gemaltoDomain:"",gemaltoRetry:"0",awsEndpoint:"",awsRegion:"",awsKMSKey:"",awsAccessKey:"",awsSecretKey:"",awsToken:"",vaultEndpoint:"",vaultEngine:"",vaultNamespace:"",vaultPrefix:"",vaultAppRoleEngine:"",vaultId:"",vaultSecret:"",vaultRetry:"0",vaultPing:"0",gcpProjectID:"",gcpEndpoint:"",gcpClientEmail:"",gcpClientID:"",gcpPrivateKeyID:"",gcpPrivateKey:"",enableCustomCertsForKES:!1},tenantSize:{volumeSize:"100",sizeFactor:"Gi",drivesPerServer:"1",nodes:"4",memoryNode:"2",ecParity:"",ecParityChoices:[],cleanECChoices:[],maxAllocableMemo:0,memorySize:{error:"",limit:0,request:0},distribution:{error:"",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0},ecParityCalc:{error:0,defaultEC:"",erasureCodeSet:0,maxEC:"",rawCapacity:"0",storageFactors:[]},limitSize:{}}},certificates:{minioCertificates:[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}],caCertificates:[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}],consoleCertificate:{id:"console_cert_pair",key:"",cert:"",encoded_key:"",encoded_cert:""},serverCertificate:{id:"encryptionServerCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},clientCertificate:{id:"encryptionClientCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},vaultCertificate:{id:"encryptionVaultCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},vaultCA:{id:"encryptionVaultCA",key:"",cert:"",encoded_key:"",encoded_cert:""},gemaltoCA:{id:"encryptionGemaltoCA",key:"",cert:"",encoded_key:"",encoded_cert:""}}}};var jd=Object(Xl.c)({system:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:td,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case T:return Object(j.a)(Object(j.a)({},e),{},{loggedIn:t.logged});case E:return Object(j.a)(Object(j.a)({},e),{},{operatorMode:t.operatorMode});case _:return Object(j.a)(Object(j.a)({},e),{},{sidebarOpen:t.open});case A:return Object(j.a)(Object(j.a)({},e),{},{serverNeedsRestart:t.needsRestart});case I:return Object(j.a)(Object(j.a)({},e),{},{serverIsLoading:t.isLoading});case M:return Object(j.a)(Object(j.a)({},e),{},{loadingProgress:t.loadingProgress});case L:return Object(j.a)(Object(j.a)({},e),{},{snackBar:{message:t.message,type:"message"}});case B:return Object(j.a)(Object(j.a)({},e),{},{snackBar:{message:t.message,type:"error"}});case F:return Object(j.a)(Object(j.a)({},e),{},{modalSnackBar:{message:t.message,type:"message"}});case R:return Object(j.a)(Object(j.a)({},e),{},{modalSnackBar:{message:t.message,type:"error"}});case D:return Object(j.a)(Object(j.a)({},e),{},{serverDiagnosticStatus:t.serverDiagnosticStatus});default:return e}},trace:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nd,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ol:return Object(j.a)(Object(j.a)({},e),{},{messages:[].concat(Object(He.a)(e.messages),[t.message])});case gl:return Object(j.a)(Object(j.a)({},e),{},{messages:[]});default:return e}},logs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ad,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Cl:return Object(j.a)(Object(j.a)({},e),{},{messages:[].concat(Object(He.a)(e.messages),[t.message])});case Sl:return Object(j.a)(Object(j.a)({},e),{},{messages:[]});default:return e}},watch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:id,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Bl:return Object(j.a)(Object(j.a)({},e),{},{messages:[].concat(Object(He.a)(e.messages),[t.message])});case Fl:return Object(j.a)(Object(j.a)({},e),{},{messages:[]});default:return e}},console:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rd,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Zl:return Object(j.a)(Object(j.a)({},e),{},{session:t.message});default:return e}},buckets:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:od,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ot:return Object(j.a)(Object(j.a)({},e),{},{open:t.open});case gt:return Object(j.a)(Object(j.a)({},e),{},{addBucketName:t.name});case ft:return Object(j.a)(Object(j.a)({},e),{},{addBucketVersioningEnabled:t.versioned});case xt:return Object(j.a)(Object(j.a)({},e),{},{addBucketLockingEnabled:t.locking});case vt:return Object(j.a)(Object(j.a)({},e),{},{addBucketQuotaEnabled:t.quota});case yt:return Object(j.a)(Object(j.a)({},e),{},{addBucketQuotaType:t.quotaType});case Ct:return Object(j.a)(Object(j.a)({},e),{},{addBucketQuotaSize:t.quotaSize});case St:return Object(j.a)(Object(j.a)({},e),{},{addBucketQuotaUnit:t.quotaUnit});case wt:return Object(j.a)(Object(j.a)({},e),{},{addBucketRetentionEnabled:t.retention});case Nt:return Object(j.a)(Object(j.a)({},e),{},{addBucketRetentionMode:t.retentionMode});case Tt:return Object(j.a)(Object(j.a)({},e),{},{addBucketRetentionUnit:t.retentionUnit});case Et:return Object(j.a)(Object(j.a)({},e),{},{addBucketRetentionValidity:t.retentionValidity});case kt:return Object(j.a)(Object(j.a)({},e),{},{addBucketName:"",addBucketVersioningEnabled:!1,addBucketLockingEnabled:!1,addBucketQuotaEnabled:!1,addBucketQuotaType:"hard",addBucketQuotaSize:"1",addBucketQuotaUnit:"TiB",addBucketRetentionEnabled:!1,addBucketRetentionMode:"compliance",addBucketRetentionUnit:"days",addBucketRetentionValidity:1});default:return e}},objectBrowser:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ld,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Vo:var n=[].concat(Object(He.a)(e.routesList),[{route:t.route,label:t.label,type:t.routeType}]);return u.push(t.route),Object(j.a)(Object(j.a)({},e),{},{routesList:n});case Go:return Object(j.a)(Object(j.a)({},e),{},{routesList:[].concat(sd)});case Ho:var a=e.routesList.findIndex((function(e){return e.route===t.toRoute}))+1,c=e.routesList.slice(0,a);return Object(j.a)(Object(j.a)({},e),{},{routesList:c});case Yo:var i=t.currentRoute.split("/"),r=[],o=sd[0].route;i.forEach((function(e){""!==e&&"object-browser"!==e&&(o="".concat(o,"/").concat(e),r.push({route:o,label:e,type:"path"}))}));var s=[].concat(sd,r);return Object(j.a)(Object(j.a)({},e),{},{routesList:s});case Qo:var l=Object(He.a)(e.routesList),d=e.routesList[e.routesList.length-1].route,b=t.newRoute.split("/");return b.forEach((function(e){var t=e.trim();if(""!==t){var n={route:d="".concat(d,"/").concat(t),label:t,type:"path"};l.push(n)}})),u.push(d),Object(j.a)(Object(j.a)({},e),{},{routesList:l});case Zo:var m=e.routesList,p=m.slice(-1)[0];"path"===p.type&&(p.type="file");var h=[].concat(Object(He.a)(m.slice(0,-1)),[p]);return Object(j.a)(Object(j.a)({},e),{},{routesList:h});case Jo:var O=Object(He.a)(e.downloadingFiles);return O.push(t.path),Object(j.a)(Object(j.a)({},e),{},{downloadingFiles:Object(He.a)(O)});case $o:var g=e.downloadingFiles.filter((function(e){return e!==t.path}));return Object(j.a)(Object(j.a)({},e),{},{downloadingFiles:Object(He.a)(g)});default:return e}},healthInfo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cd,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case zl:return Object(j.a)(Object(j.a)({},e),{},{message:t.message});case Kl:return Object(j.a)(Object(j.a)({},e),{},{message:{}});default:return e}},tenants:function(){var e,t,n,a,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bd,i=arguments.length>1?arguments[1]:void 0,r=Object(j.a)({},c);switch(i.type){case zr:return r.createTenant.page=i.page,Object(j.a)({},r);case Kr:return r.createTenant.advancedModeOn=i.state,Object(j.a)({},r);case Ur:if(ud()(r.createTenant.fields,"".concat(i.pageName,".").concat(i.field))){var o=Z()(r.createTenant.fields,"".concat(i.pageName),{}),s={};s[i.field]=i.value;var l=Object(j.a)(Object(j.a)({},o),s);return r.createTenant.fields[i.pageName]=Object(j.a)({},l),Object(j.a)({},r)}return c;case Wr:var d=c.createTenant.validPages;if(i.valid)d.includes(i.pageName)||(d.push(i.pageName),r.createTenant.validPages=Object(He.a)(d));else{var u=d.filter((function(e){return e!==i.pageName}));r.createTenant.validPages=Object(He.a)(u)}return Object(j.a)({},r);case Vr:var b=Object(j.a)(Object(j.a)({},c),{},{createTenant:Object(j.a)(Object(j.a)({},c.createTenant),{},{storageClasses:i.storageClasses})});return Object(j.a)({},b);case Gr:var m=[].concat(Object(He.a)(c.createTenant.certificates.minioCertificates),[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}]);return r.createTenant.certificates.minioCertificates=Object(He.a)(m),Object(j.a)({},r);case Hr:var p=c.createTenant.certificates.minioCertificates,h=p.map((function(e){var t;return e.id===i.id?Object(j.a)(Object(j.a)({},e),{},(t={},Object(ge.a)(t,i.key,i.fileName),Object(ge.a)(t,"encoded_".concat(i.key),i.value),t)):e}));return r.createTenant.certificates.minioCertificates=Object(He.a)(h),Object(j.a)({},r);case Yr:var O=c.createTenant.certificates.minioCertificates;if(O.length>1){var g=O.filter((function(e){return e.id!==i.id}));return r.createTenant.certificates.minioCertificates=Object(He.a)(g),Object(j.a)({},r)}return Object(j.a)({},c);case Qr:var f=[].concat(Object(He.a)(c.createTenant.certificates.caCertificates),[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}]);return r.createTenant.certificates.caCertificates=Object(He.a)(f),Object(j.a)({},r);case Zr:var x=c.createTenant.certificates.caCertificates,v=x.map((function(e){var t;return e.id===i.id?Object(j.a)(Object(j.a)({},e),{},(t={},Object(ge.a)(t,i.key,i.fileName),Object(ge.a)(t,"encoded_".concat(i.key),i.value),t)):e}));return r.createTenant.certificates.caCertificates=Object(He.a)(v),Object(j.a)({},r);case Jr:var y=c.createTenant.certificates.minioCertificates;if(y.length>1){var C=y.filter((function(e){return e.id!==i.id}));return r.createTenant.certificates.caCertificates=Object(He.a)(C),Object(j.a)({},r)}return Object(j.a)({},c);case $r:var S=c.createTenant.certificates.consoleCertificate;return r.createTenant.certificates.consoleCertificate=Object(j.a)(Object(j.a)({},S),{},(e={},Object(ge.a)(e,i.key,i.fileName),Object(ge.a)(e,"encoded_".concat(i.key),i.value),e)),Object(j.a)({},r);case Xr:var k=c.createTenant.certificates.serverCertificate;return r.createTenant.certificates.serverCertificate=Object(j.a)(Object(j.a)({},k),{},(t={},Object(ge.a)(t,i.key,i.fileName),Object(ge.a)(t,"encoded_".concat(i.key),i.value),t)),Object(j.a)({},r);case eo:var w=c.createTenant.certificates.clientCertificate;return r.createTenant.certificates.clientCertificate=Object(j.a)(Object(j.a)({},w),{},(n={},Object(ge.a)(n,i.key,i.fileName),Object(ge.a)(n,"encoded_".concat(i.key),i.value),n)),Object(j.a)({},r);case to:var N=c.createTenant.certificates.vaultCertificate;return r.createTenant.certificates.vaultCertificate=Object(j.a)(Object(j.a)({},N),{},(a={},Object(ge.a)(a,i.key,i.fileName),Object(ge.a)(a,"encoded_".concat(i.key),i.value),a)),Object(j.a)({},r);case no:var T=c.createTenant.certificates.vaultCA;return r.createTenant.certificates.vaultCA=Object(j.a)(Object(j.a)({},T),{},{cert:i.fileName,encoded_cert:i.value}),Object(j.a)({},r);case ao:var E=c.createTenant.certificates.gemaltoCA;return r.createTenant.certificates.gemaltoCA=Object(j.a)(Object(j.a)({},E),{},{cert:i.fileName,encoded_cert:i.value}),Object(j.a)({},r);case qr:return Object(j.a)(Object(j.a)({},c),{},{createTenant:{page:0,validPages:[],advancedModeOn:!1,storageClasses:[],limitSize:{},fields:{nameTenant:{tenantName:"",namespace:"",selectedStorageClass:""},configure:{customImage:!1,imageName:"",consoleImage:"",customDockerhub:!1,imageRegistry:"",imageRegistryUsername:"",imageRegistryPassword:"",exposeMinIO:!0,exposeConsole:!0},identityProvider:{idpSelection:"Built-in",openIDURL:"",openIDClientID:"",openIDSecretID:"",ADURL:"",ADSkipTLS:!1,ADServerInsecure:!1,ADUserNameFilter:"",ADGroupBaseDN:"",ADGroupSearchFilter:"",ADNameAttribute:""},security:{enableAutoCert:!0,enableCustomCerts:!1,enableTLS:!0},encryption:{enableEncryption:!1,encryptionType:"vault",gemaltoEndpoint:"",gemaltoToken:"",gemaltoDomain:"",gemaltoRetry:"0",awsEndpoint:"",awsRegion:"",awsKMSKey:"",awsAccessKey:"",awsSecretKey:"",awsToken:"",vaultEndpoint:"",vaultEngine:"",vaultNamespace:"",vaultPrefix:"",vaultAppRoleEngine:"",vaultId:"",vaultSecret:"",vaultRetry:"0",vaultPing:"0",gcpProjectID:"",gcpEndpoint:"",gcpClientEmail:"",gcpClientID:"",gcpPrivateKeyID:"",gcpPrivateKey:"",enableCustomCertsForKES:!1},tenantSize:{volumeSize:"100",sizeFactor:"Gi",drivesPerServer:"1",nodes:"4",memoryNode:"2",ecParity:"",ecParityChoices:[],cleanECChoices:[],maxAllocableMemo:0,memorySize:{error:"",limit:0,request:0},distribution:{error:"",nodes:0,persistentVolumes:0,disks:0,volumePerDisk:0},ecParityCalc:{error:0,defaultEC:"",erasureCodeSet:0,maxEC:"",rawCapacity:"0",storageFactors:[]},limitSize:{}}},certificates:{minioCertificates:[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}],caCertificates:[{id:Date.now().toString(),key:"",cert:"",encoded_key:"",encoded_cert:""}],consoleCertificate:{id:"console_cert_pair",key:"",cert:"",encoded_key:"",encoded_cert:""},serverCertificate:{id:"encryptionServerCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},clientCertificate:{id:"encryptionClientCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},vaultCertificate:{id:"encryptionVaultCertificate",key:"",cert:"",encoded_key:"",encoded_cert:""},vaultCA:{id:"encryptionVaultCA",key:"",cert:"",encoded_key:"",encoded_cert:""},gemaltoCA:{id:"encryptionGemaltoCA",key:"",cert:"",encoded_key:"",encoded_cert:""}}}});default:return c}}}),md=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||Xl.d;Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var pd=n(654),hd=(n(565),n(566),n(567),n(568),n(349)),Od=Object(hd.a)({palette:{primary:{light:"#073052",main:"#081C42",dark:"#05122B",contrastText:"#fff"},secondary:{light:"#ff7961",main:"#f44336",dark:"#ba000d",contrastText:"#000"},error:{light:"#e03a48",main:"#dc1f2e",contrastText:"#ffffff"},grey:{100:"#f0f0f0",200:"#e6e6e6",300:"#cccccc",400:"#999999",500:"#8c8c8c",600:"#737373",700:"#666666",800:"#4d4d4d",900:"#333333"},background:{default:"#F4F4F4"}},typography:{fontFamily:["Lato","sans-serif"].join(","),h1:{fontWeight:"bold",color:"#081C42"},h2:{fontWeight:"bold",color:"#081C42"},h3:{fontWeight:"bold",color:"#081C42"},h4:{fontWeight:"bold",color:"#081C42"},h5:{fontWeight:"bold",color:"#081C42"},h6:{fontWeight:"bold",color:"#000000"}},overrides:{MuiButton:{root:{borderRadius:3,color:"white",height:40,padding:"0 20px",fontSize:14,fontWeight:600,boxShadow:"none","& .MuiSvgIcon-root":{maxHeight:18},"&.MuiButton-contained.Mui-disabled":{backgroundColor:"#EAEDEE",fontWeight:600,color:"#767676"},"& .MuiButton-iconSizeMedium > *:first-child":{fontSize:12}}}}}),gd=Object(N.a)({"@global":{".MuiButton-contained":{fontSize:"14px",textTransform:"capitalize",padding:"16px 25px 16px 25px",borderRadius:3},".MuiButton-sizeSmall":{padding:"4px 10px",fontSize:"0.8125rem"},".MuiTableCell-head":{borderRadius:"3px 3px 0px 0px",fontSize:13},".MuiPaper-root":{borderRadius:3},".MuiDrawer-paperAnchorDockedLeft":{borderRight:0},".MuiDrawer-root":{"& .MuiPaper-root":{borderRadius:0}}}})((function(){return null}));o.a.render(Object(a.jsxs)(s.a,{store:Object(Xl.e)(jd,md(Object(Xl.a)(ed.a))),children:[Object(a.jsx)(gd,{}),Object(a.jsx)(pd.a,{theme:Od,children:Object(a.jsx)($l,{})})]}),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[569,1,2]]]);
//# sourceMappingURL=main.2368c861.chunk.js.map