1import{a as u,d as S}from"/build/_shared/chunk-RAQE33EU.js";import{T as E,a as y,b as r}from"/build/_shared/chunk-TQS5E2SK.js";import{v as T,w as x}from"/build/_shared/chunk-RBFCHJWR.js";import{a as A}from"/build/_shared/chunk-JUM7J4TY.js";import{a as k}from"/build/_shared/chunk-RW7BUM27.js";import{e as n}from"/build/_shared/chunk-ADMCF34Z.js";var a=n(A());var o=n(k()),G=({setOptOutVisible:l,optOutAcceptText:R,optOutDeclineText:H,bonusId:i,isOptOutModalVisible:I,optOutCompleteFlag:d})=>{let t=x(),N=T("root"),{siteConfig:e,isDesktop:w}=N,[c,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{var s,m,O,g,v,b,C,D,M;if(t.state==="idle"&&(t==null?void 0:t.data)!==void 0){let f="Opted out Successfully";!(t!=null&&t.data.isSuccessfulResponse)&&((m=(s=t==null?void 0:t.data)==null?void 0:s.message)!=null&&m.errors[0])&&(f=(M=(v=(g=(O=t==null?void 0:t.data)==null?void 0:O.message)==null?void 0:g.errors[0])==null?void 0:v.detail)!=null?M:(D=(C=(b=t==null?void 0:t.data)==null?void 0:b.message)==null?void 0:C.errors[0])==null?void 0:D.error),d&&d();let B=S.showToast({id:`OPT-OUT-${i}`,content:(0,o.jsx)("div",{children:f}
1),isDesktop:w,duration:2e3,footer:(0,o.jsx)(y,{svgSource:"/images/close-icon.svg",className:"w-3.5 cursor-pointer",onClick:()=>u.dismiss(B)}),onClose:()=>u.dismiss(B)});l(!1),p(!1)}},[t.state,t==null?void 0:t.data]);let F=s=>{s.preventDefault(),t.submit({bonusId:i},{action:"/actions/optOut",method:"DELETE"}),p(!0)},L=s=>{l(!1)},P=()=>(0,o.jsxs)("div",{className:"flex items-center justify-end w-full gap-4",children:[(0,o.jsx)(r,{type:"secondary",onClick:L,label:H,disabled:c,className:"bg-optOutDeclineButtonBackgroundColour border-optOutDeclineButtonBorderColour text-optOutDeclineButtonTextColour"}),(0,o.jsx)(r,{type:"primary",onClick:F,label:R,disabled:c,className:"bg-optOutButtonBackgroundColour border border-optOutButtonBackgroundColour text-optOutButtonTextColour"})]});return(0,o.jsx)(E,{title:e==null?void 0:e.optOutModalHeader,isModalOpen:I,setIsModalOpen:l,modalClassName:"max-w-[480px]",closeSvgSource:"/images/close-icon.svg",footer:P,shouldCloseOnOverlayClick:!1,children:(0,o.jsx)("p",{children:e==null?void 0:e.optOutModalMainText})})},z=G;export{z as a};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.