PageSourceSearch

https://www.publicnewsservice.org/assets/UnSubscribePage-3f866319.js

js publicnewsservice.org collected 2026-09-24 08:32:01 UTC 1,772 bytes, 8 lines download raw bytes

1import{g as h,r as l,d as n,c as m,j as e,t as a,b as r}from"./index-489884ef.js";const E=h`
2  mutation UnsubscribeUserFromEmail($email: String!) {
3    unsubscribeUserFromEmail(email: $email) {
4      status
5      message
6    }
7  }
8`,f=()=>{const[i,o]=l.useState(!1),[u]=n.useMutation(E),c=m.useParams(),[b,d]=l.useState(c.email||""),x=async s=>{o(!0);try{const{data:t}=await u({variables:{email:s}});a.toast.dismiss(),t.unsubscribeUserFromEmail.status?(a.toast.success(t.unsubscribeUserFromEmail.message||"You have successfully unsubscribed."),setTimeout(()=>{window.location.href=m.routes.home()},2e3)):a.toast.error(t.unsubscribeUserFromEmail.message||"Failed to unsubscribe. Please try again.")}catch{a.toast.error("An error occurred. Please try again.")}finally{o(!1)}},g=s=>{x(s.email.toLowerCase())};return e.jsxs(e.Fragment,{children:[e.jsx(n.Metadata,{title:"Unsubscribe",robots:"noindex"}),e.jsx(a.Toaster,{}),e.jsx("h1",{className:"text-gray-700 hover:text-gray-900 dark:text-white dark:hover:text-white text-2xl font-medium mt-2",children:"Unsubscribe from Emails"}),e.jsx("p",{children:"If you no longer wish to receive emails, please enter your email address below to unsubscribe."}),e.jsxs(r.Form,{onSubmit:g,className:"form",children:[e.jsx(r.Label,{name:"email",className:"label",errorClassName:"label error",children:"Email"}),e.jsx(r.TextField,{name:"email",className:"input w-1/2",errorClassName:"input error",defaultValue:b,onChange:s=>d(s.target.value),validation:{required:!0,pattern:{value:/[^@]+@[^.]+\..+/,message:"Invalid email address"}}}),e.jsx(r.FieldError,{name:"email",className:"error-message"}),e.jsx(r.Submit,{disabled:i,className:"rw-button rw-button-blue mt-4",children:i?"Unsubscribing...":"Unsubscribe"})]})]})};export{f as default};

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.