"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[8940],{48940:(e,s,t)=>{t.r(s),t.d(s,{default:()=>p});var n=t(69060),o=t(89940),r=t(70780),i=t(66152),l=t(95705),c=t(66156),a=t(3992),d=t(21124),u=t(19536),b=t(61180),h=t(61060),v=t(82496);const p=e=>{let{closeDeleteModalAndRefresh:s,deleteOpen:t,selectedBucket:p,selectedObjects:j,versioning:g}=e;const x=(0,c.Ab)(),f=()=>s(!0),[k,m]=(0,o.c)(f,(e=>x((0,l.aW)(e)))),[y,C]=(0,n.useState)(!1),[O,_]=(0,n.useState)(!1),w=(0,u.w1)((e=>e.objectBrowser.retentionConfig)),T=(0,a.i)([p],[d.Oi.S3_BYPASS_GOVERNANCE_RETENTION])&&"governance"===(null===w||void 0===w?void 0:w.mode);if(!j)return null;const A="Enabled"===(null===g||void 0===g?void 0:g.status)||"Suspended"===(null===g||void 0===g?void 0:g.status);return(0,v.jsx)(r.c,{title:"Delete Objects",confirmText:"Delete",isOpen:t,titleIcon:(0,v.jsx)(i.sB6,{}),isLoading:k,onConfirm:()=>{let e=[];for(let s=0;s<j.length;s++)j[s].endsWith("/")?e.push({path:j[s],versionID:"",recursive:!0}):e.push({path:j[s],versionID:"",recursive:!1});if(e)if(1===j.length){const e=j[0];b.m.buckets.deleteObject(p,{prefix:(0,h.CO)(e),all_versions:y,bypass:O,recursive:e.endsWith("/")}).then(f).catch((e=>{x((0,l.aW)({errorMessage:"Could not delete object. ".concat(e.statusText,". ").concat(w?"Please check retention mode and if object is WORM protected.":""),detailedError:""}))}))}else m("POST","/api/v1/buckets/".concat(p,"/delete-objects?all_versions=").concat(y).concat(O?"&bypass=true":""),e)},onClose:()=>s(!1),confirmationContent:(0,v.jsxs)(n.Fragment,{children:["Are you sure you want to delete the selected ",j.length," ","objects?"," ",A&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsx)("br",{}),(0,v.jsx)("br",{}),(0,v.jsx)(i.Wkk,{label:"Delete All Versions",indicatorLabels:["Yes","No"],checked:y,value:"delete_versions",id:"delete-versions",name:"delete-versions",onChange:e=>{C(!y)},description:""}),T&&y&&(0,v.jsx)(n.Fragment,{children:(0,v.jsx)("div",{style:{marginTop:10},children:(0,v.jsx)(i.Wkk,{label:"Bypass Governance Mode",indicatorLabels:["Yes","No"],checked:O,value:"bypass_governance",id:"bypass_governance",name:"bypass_governance",onChange:e=>{_(!O)},description:""})})}),y&&(0,v.jsxs)(n.Fragment,{children:[(0,v.jsxs)("div",{style:{marginTop:10,border:"#c83b51 1px solid",borderRadius:3,padding:5,backgroundColor:"#c83b5120",color:"#c83b51"},children:["This will remove the objects as well as all of their versions, ",(0,v.jsx)("br",{}),"This action is irreversible."]}),(0,v.jsx)("br",{}),"Are you sure you want to continue?"]})]})]})})}}}]);
//# sourceMappingURL=8940.ebc12e13.chunk.js.map