PageSourceSearch

https://mandalanaturals.com/assets/unsubscribe-C0FETtnD.js

js mandalanaturals.com collected 2026-10-04 05:35:47 UTC 2,945 bytes, 1 lines download raw bytes

1import{aE as m,r as i,j as e,aC as d,L as l}from"./index-ccEREGMx.js";import{C as o}from"./circle-check-big-2WstLeLs.js";import{C as x}from"./circle-x-Bqs0jYg0.js";function p(){m();const n=new URLSearchParams(window.location.search).get("token"),[t,r]=i.useState("loading"),[a,c]=i.useState("");return i.useEffect(()=>{if(!n){r("error");return}fetch(`/api/unsubscribe?token=${encodeURIComponent(n)}`).then(s=>s.json()).then(s=>{s.success?(c(s.email||""),r(s.alreadyUnsubscribed?"already":"success")):r("error")}).catch(()=>r("error"))},[n]),e.jsx("div",{className:"min-h-screen bg-[#FDF8F3] flex flex-col items-center justify-center px-4",children:e.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-sm border border-amber-100 p-10 text-center",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("img",{src:"/uploads/mandala-logo.png",alt:"Mandala Naturals",className:"h-12 object-contain",onError:s=>{s.target.style.display="none"}})}),t==="loading"&&e.jsxs(e.Fragment,{children:[e.jsx(d,{className:"w-10 h-10 animate-spin text-amber-600 mx-auto mb-4"}),e.jsx("p",{className:"text-[#4A3728]/70",children:"Processing your request..."})]}),t==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{className:"w-12 h-12 text-green-500 mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-semibold text-[#3D2B1F] mb-2",children:"You're unsubscribed"}),a&&e.jsxs("p",{className:"text-[#4A3728]/70 mb-4",children:[e.jsx("strong",{children:a})," will no longer receive marketing emails from Mandala Naturals."]}),e.jsx("p",{className:"text-sm text-[#4A3728]/50 mb-6",children:"You'll still receive order confirmations and shipping updates for any purchases you make."}),e.jsx(l,{href:"/",className:"inline-block bg-[#D4735A] hover:bg-[#c0654d] text-white px-8 py-3 rounded-lg font-medium transition-colors",children:"Return to Shop"})]}),t==="already"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{className:"w-12 h-12 text-amber-500 mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-semibold text-[#3D2B1F] mb-2",children:"Already unsubscribed"}),a&&e.jsxs("p",{className:"text-[#4A3728]/70 mb-4",children:[e.jsx("strong",{children:a})," is already opted out of marketing emails."]}),e.jsx(l,{href:"/",className:"inline-block bg-[#D4735A] hover:bg-[#c0654d] text-white px-8 py-3 rounded-lg font-medium transition-colors",children:"Return to Shop"})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(x,{className:"w-12 h-12 text-red-400 mx-auto mb-4"}),e.jsx("h1",{className:"text-2xl font-semibold text-[#3D2B1F] mb-2",children:"Link not found"}),e.jsx("p",{className:"text-[#4A3728]/70 mb-6",children:"This unsubscribe link is invalid or has expired. If you'd like to unsubscribe, please reply to any marketing email."}),e.jsx(l,{href:"/",className:"inline-block bg-[#D4735A] hover:bg-[#c0654d] text-white px-8 py-3 rounded-lg font-medium transition-colors",children:"Return to Shop"})]})]})})}export{p 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.