"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[614],{30614:(e,t,l)=>{l.r(t),l.d(t,{default:()=>p});var a=l(65043),s=l(94141),r=l(89923),n=l(56629),o=l(53518),i=l(77403),c=l(64159),d=l(21383),u=l(70579);const p=e=>{let{modalOpen:t,onClose:l,bucket:p,prefilledRoute:h}=e;const f=(0,d.jL)(),[x,b]=(0,a.useState)(""),[m,y]=(0,a.useState)("readonly");(0,a.useEffect)((()=>{h&&b(h)}),[h]);return(0,u.jsx)(s.A,{modalOpen:t,title:"Add Anonymous Access Rule",onClose:l,titleIcon:(0,u.jsx)(r.No_,{}),children:(0,u.jsxs)(r.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,u.jsx)(r.cl_,{value:x,label:"Prefix",id:"prefix",name:"prefix",placeholder:"Enter Prefix",onChange:e=>{b(e.target.value)},tooltip:"Enter '/' to apply the rule to all prefixes and objects at the bucket root. Do not include the wildcard asterisk '*' as part of the prefix *unless* it is an explicit part of the prefix name. The Console automatically appends an asterisk to the appropriate sections of the resulting IAM policy."}),(0,u.jsx)(r.l6P,{id:"access",name:"Access",onChange:e=>{y(e)},label:"Access",value:m,options:[{label:"readonly",value:"readonly"},{label:"writeonly",value:"writeonly"},{label:"readwrite",value:"readwrite"}],disabled:!1,helpTip:(0,u.jsx)(a.Fragment,{children:"Select the desired level of access available to unauthenticated Users"}),helpTipPlacement:"right"}),(0,u.jsxs)(r.xA9,{item:!0,xs:12,sx:i.Uz.modalButtonBar,children:[(0,u.jsx)(r.$nd,{id:"clear",type:"button",variant:"regular",onClick:()=>{b(""),y("readonly")},label:"Clear"}),(0,u.jsx)(r.$nd,{id:"add-access-save",type:"submit",variant:"callAction",disabled:""===x.trim(),onClick:()=>{n.F.bucket.setAccessRuleWithBucket(p,{prefix:x,access:m}).then((e=>{f((0,c.Hk)("Access Rule added successfully")),l()})).catch((e=>{f((0,c.C9)((0,o.S)(e.error))),l()}))},label:"Save"})]})]})})}},94141:(e,t,l)=>{l.d(t,{A:()=>d});var a=l(65043),s=l(22166),r=l(89923),n=l(21383),o=l(64159),i=l(49555),c=l(70579);const d=e=>{let{onClose:t,modalOpen:l,title:d,children:u,wideLimit:p=!0,titleIcon:h=null,iconColor:f="default",sx:x}=e;const b=(0,n.jL)(),[m,y]=(0,a.useState)(!1),v=(0,s.d4)((e=>e.system.modalSnackBar));(0,a.useEffect)((()=>{b((0,o.h0)(""))}),[b]),(0,a.useEffect)((()=>{if(v){if(""===v.message)return void y(!1);"error"!==v.type&&y(!0)}}),[v]);let C="";return v&&(C=v.detailedErrorMsg,(""===C||C&&C.length<5)&&(C=v.message)),(0,c.jsxs)(r.ngX,{onClose:t,open:l,title:d,titleIcon:h,widthLimit:p,sx:x,iconColor:f,children:[(0,c.jsx)(i.A,{isModal:!0}),(0,c.jsx)(r.qb_,{onClose:()=>{y(!1),b((0,o.h0)(""))},open:m,message:C,mode:"inline",variant:"error"===v.type?"error":"default",autoHideDuration:"error"===v.type?10:5,condensed:!0}),u]})}}}]);
//# sourceMappingURL=614.29e0d9dd.chunk.js.map