PageSourceSearch

https://beamish-maamoul-a3c725.netlify.app/assets/NewsletterUnsubscribePage-CppNKe6T.js

js beamish-maamoul-a3c725.netlify.app collected 2026-10-03 10:29:35 UTC 4,579 bytes, 1 lines download raw bytes

1import{j as e,s}from"./index-B-01gp8C.js";import{f as t,c as a,r}from"./vendor-react-7UJKJIhU.js";import{L as l,u as n,ai as i,ah as d}from"./vendor-ui-DJKmmfZX.js";import"./vendor-supabase-CDTnsVBO.js";function c(){const{token:c}=t(),o=a(),[x,m]=r.useState("loading"),[h,b]=r.useState("");r.useEffect(()=>{(async()=>{if(!c)return void m("error");if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(c))try{const{data:e,error:t}=await s.rpc("unsubscribe_newsletter_subscriber",{p_token:c});if(t||!e||0===e.length)return void m("error");const a=e[0];if(b(a.email),!a.was_active)return void m("already_unsubscribed");m("success")}catch(e){m("error")}else m("error")})()},[c]);const u=()=>{o("/")};return"loading"===x?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 via-white to-gray-50 flex items-center justify-center px-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx(l,{className:"w-12 h-12 text-amber-600 animate-spin mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600 text-lg",children:"Zpracovávám vaši žádost..."})]})}):"success"===x?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 via-white to-gray-50 flex items-center justify-center px-4",children:e.jsx("div",{className:"max-w-md w-full",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 space-y-6 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"bg-green-100 rounded-full p-4",children:e.jsx(n,{className:"w-16 h-16 text-green-600"})})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Odhlášení dokončeno"}),e.jsxs("p",{className:"text-gray-600 text-lg",children:["Email ",e.jsx("span",{className:"font-semibold text-gray-900",children:h})," byl úspěšně odhlášen z odběru newsletteru."]}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Již vám nebudeme zasílat žádné marketingové zprávy."}),e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsx("p",{className:"text-sm text-gray-700",children:"Mrzí nás, že odcházíte. Pokud si to rozmyslíte, můžete se kdykoli znovu přihlásit k odběru na naší stránce."})}),e.jsx("button",{onClick:u,className:"w-full bg-amber-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-amber-700 transition-colors",children:"Zpět na hlavní stránku"})]})})}):"already_unsubscribed"===x?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 via-white to-gray-50 flex items-center justify-center px-4",children:e.jsx("div",{className:"max-w-md w-full",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 space-y-6 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"bg-blue-100 rounded-full p-4",children:e.jsx(i,{className:"w-16 h-16 text-blue-600"})})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Již odhlášeno"}),e.jsxs("p",{className:"text-gray-600 text-lg",children:["Email ",e.jsx("span",{className:"font-semibold text-gray-900",children:h})," je již odhlášen z odběru newsletteru."]}),e.jsx("p",{className:"text-gray-500 text-sm",children:"Pokud chcete obnovit odběr, přihlaste se prosím znovu na naší stránce."}),e.jsx("button",{onClick:u,className:"w-full bg-amber-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-amber-700 transition-colors",children:"Zpět na hlavní stránku"})]})})}):e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-red-50 via-white to-red-50 flex items-center justify-center px-4",children:e.jsx("div",{className:"max-w-md w-full",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 space-y-6 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"bg-red-100 rounded-full p-4",children:e.jsx(d,{className:"w-16 h-16 text-red-600"})})}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Nastala chyba"}),e.jsx("p",{className:"text-gray-600 text-lg",children:"Nepodařilo se odhlásit z odběru newsletteru. Odkaz může být neplatný nebo vypršel."}),e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsx("p",{className:"text-sm text-gray-700",children:"Pokud potřebujete pomoc s odhlášením, kontaktujte nás prosím přímo."})}),e.jsx("button",{onClick:u,className:"w-full bg-amber-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-amber-700 transition-colors",children:"Zpět na hlavní stránku"})]})})})}export{c 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.