import{dk as y,R as f,o as u,aC as d,l as x,j as e,E as j,a9 as t}from"./app-BgLa5dit.js";import{C as v}from"./q-IBKcuF.chunk.js";import"./DUpYPoLs.chunk.js";import"./EZim8aq-.chunk.js";import"./BD9MrUJP.chunk.js";import"./s6cGcwlA.chunk.js";import"./Zwjmkasg.chunk.js";import"./4qGb1BIY.chunk.js";import"./DnXDEnAR.chunk.js";import"./DpUpv6rY.chunk.js";import"./CG7zbly5.chunk.js";import"./m4aqaK_l.chunk.js";import"./MEkA24R1.chunk.js";import"./C53kfXmd.chunk.js";function N(r){var m,n,l;const b=y(),[p,o]=f.useState(!1),i=u(d.getLibrary(r.libraryId)),s=u(v.customer(r.customerId)),a=x();async function h(){o(!0);try{await b(d.removeSubscriber(r.libraryId,r.customerId)),a.success("Successfully removed subscriber from library")}catch{a.error("Failed to remove subscriber from library. Please try again.")}finally{o(!1),r.closePopup()}}const c=i.hasCompleted&&s.hasCompleted;return e.jsx(j,{title:"Remove subscriber",closePopup:r.closePopup,showLoadingSpinner:!c,children:!!c&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Are you sure you want to remove subscriber:",e.jsxs("div",{className:"fw-semibold",children:[(m=s.data)==null?void 0:m.name," (",(n=s.data)==null?void 0:n.crmId,")"]})]}),e.jsxs("p",{children:["From this library:",e.jsx("div",{className:"fw-semibold",children:(l=i.data)==null?void 0:l.name})]}),e.jsxs(t,{children:[e.jsx(t.Cancel,{onClick:r.closePopup}),e.jsx(t.Submit,{onClick:h,text:"Remove",variant:"danger",showSpinner:p})]})]})})}export{N as RemoveLibrarySubscriberView};
//# sourceMappingURL=BDN-48gn.chunk.js.map
