"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[614],{30614:(e,a,t)=>{t.r(a),t.d(a,{default:()=>p});var l=t(65043),s=t(94141),r=t(89923),i=t(56629),n=t(53518),c=t(77403),o=t(64159),d=t(20554),u=t(70579);const p=e=>{let{modalOpen:a,onClose:t,bucket:p,prefilledRoute:h}=e;const b=(0,d.jL)(),[x,f]=(0,l.useState)(""),[k,m]=(0,l.useState)("readonly");(0,l.useEffect)((()=>{h&&f(h)}),[h]);return(0,u.jsx)(s.A,{modalOpen:a,title:"Add Anonymous Access Rule",onClose:t,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=>{f(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=>{m(e)},label:"Access",value:k,options:[{label:"readonly",value:"readonly"},{label:"writeonly",value:"writeonly"},{label:"readwrite",value:"readwrite"}],disabled:!1,helpTip:(0,u.jsx)(l.Fragment,{children:"Select the desired level of access available to unauthenticated Users"}),helpTipPlacement:"right"}),(0,u.jsxs)(r.xA9,{item:!0,xs:12,sx:c.Uz.modalButtonBar,children:[(0,u.jsx)(r.$nd,{id:"clear",type:"button",variant:"regular",onClick:()=>{f(""),m("readonly")},label:"Clear"}),(0,u.jsx)(r.$nd,{id:"add-access-save",type:"submit",variant:"callAction",disabled:""===x.trim(),onClick:()=>{i.F.bucket.setAccessRuleWithBucket(p,{prefix:x,access:k}).then((e=>{b((0,o.Hk)("Access Rule added successfully")),t()})).catch((e=>{b((0,o.C9)((0,n.S)(e.error))),t()}))},label:"Save"})]})]})})}}}]);
//# sourceMappingURL=614.f6cdf349.chunk.js.map