"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[4916],{74916:(e,a,t)=>{t.r(a),t.d(a,{default:()=>p});var l=t(69060),s=t(4836),r=t(66152),i=t(61180),n=t(78256),c=t(61628),o=t(95705),d=t(66156),u=t(82496);const p=e=>{let{modalOpen:a,onClose:t,bucket:p,prefilledRoute:h}=e;const b=(0,d.Ab)(),[x,f]=(0,l.useState)(""),[y,m]=(0,l.useState)("readonly");(0,l.useEffect)((()=>{h&&f(h)}),[h]);return(0,u.jsx)(s.c,{modalOpen:a,title:"Add Anonymous Access Rule",onClose:t,titleIcon:(0,u.jsx)(r.MV9,{}),children:(0,u.jsxs)(r.yE_,{withBorders:!1,containerPadding:!1,children:[(0,u.jsx)(r.q22,{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.M1e,{id:"access",name:"Access",onChange:e=>{m(e)},label:"Access",value:y,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.yeN,{item:!0,xs:12,sx:c.W2.modalButtonBar,children:[(0,u.jsx)(r.qaq,{id:"clear",type:"button",variant:"regular",onClick:()=>{f(""),m("readonly")},label:"Clear"}),(0,u.jsx)(r.qaq,{id:"add-access-save",type:"submit",variant:"callAction",disabled:""===x.trim(),onClick:()=>{i.m.bucket.setAccessRuleWithBucket(p,{prefix:x,access:y}).then((e=>{b((0,o.cX)("Access Rule added successfully")),t()})).catch((e=>{b((0,o.aW)((0,n.K)(e.error))),t()}))},label:"Save"})]})]})})}}}]);
//# sourceMappingURL=4916.0094d194.chunk.js.map