"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[5941],{65941:(e,s,t)=>{t.r(s),t.d(s,{default:()=>v});var n=t(65043),o=t(25448),r=t(58661),i=t(89923),l=t(64159),c=t(20554),a=t(77938),d=t(99161),u=t(22166),b=t(56629),h=t(70579);const v=e=>{let{closeDeleteModalAndRefresh:s,deleteOpen:t,selectedBucket:v,selectedObjects:p,versioning:j}=e;const g=(0,c.jL)(),x=()=>s(!0),[f,m]=(0,o.A)(x,(e=>g((0,l.C9)(e)))),[C,y]=(0,n.useState)(!1),[O,_]=(0,n.useState)(!1),k=(0,u.d4)((e=>e.objectBrowser.retentionConfig)),w=(0,a._)([v],[d.OV.S3_BYPASS_GOVERNANCE_RETENTION])&&"governance"===(null===k||void 0===k?void 0:k.mode);if(!p)return null;const T="Enabled"===(null===j||void 0===j?void 0:j.status)||"Suspended"===(null===j||void 0===j?void 0:j.status);return(0,h.jsx)(r.A,{title:"Delete Objects",confirmText:"Delete",isOpen:t,titleIcon:(0,h.jsx)(i.xWY,{}),isLoading:f,onConfirm:()=>{let e=[];for(let s=0;s<p.length;s++)p[s].endsWith("/")?e.push({path:p[s],versionID:"",recursive:!0}):e.push({path:p[s],versionID:"",recursive:!1});if(e)if(1===p.length){const e=p[0];b.F.buckets.deleteObject(v,{prefix:e,all_versions:C,bypass:O,recursive:e.endsWith("/")}).then(x).catch((e=>{g((0,l.C9)({errorMessage:"Could not delete object. ".concat(e.statusText,". ").concat(k?"Please check retention mode and if object is WORM protected.":""),detailedError:""}))}))}else m("POST","/api/v1/buckets/".concat(v,"/delete-objects?all_versions=").concat(C).concat(O?"&bypass=true":""),e)},onClose:()=>s(!1),confirmationContent:(0,h.jsxs)(n.Fragment,{children:["Are you sure you want to delete the selected ",p.length," ","objects?"," ",T&&(0,h.jsxs)(n.Fragment,{children:[(0,h.jsx)("br",{}),(0,h.jsx)("br",{}),(0,h.jsx)(i.dOG,{label:"Delete All Versions",indicatorLabels:["Yes","No"],checked:C,value:"delete_versions",id:"delete-versions",name:"delete-versions",onChange:e=>{y(!C)},description:""}),w&&C&&(0,h.jsx)(n.Fragment,{children:(0,h.jsx)("div",{style:{marginTop:10},children:(0,h.jsx)(i.dOG,{label:"Bypass Governance Mode",indicatorLabels:["Yes","No"],checked:O,value:"bypass_governance",id:"bypass_governance",name:"bypass_governance",onChange:e=>{_(!O)},description:""})})}),C&&(0,h.jsxs)(n.Fragment,{children:[(0,h.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,h.jsx)("br",{}),"This action is irreversible."]}),(0,h.jsx)("br",{}),"Are you sure you want to continue?"]})]})]})})}}}]);
//# sourceMappingURL=5941.c85331e3.chunk.js.map