PageSourceSearch

https://canion3d.com/assets/Unsubscribe-DgR114Q0.js

js canion3d.com collected 2026-10-06 21:50:56 UTC 3,642 bytes, 11 lines download raw bytes

1import{i as h,m as y,r as c,j as e}from"./index-DPyX5apy.js";import{s as f}from"./client-BhbrlERV.js";import{N as v}from"./Navbar-C2ddd1Mh.js";import j from"./Footer-DD8Ixw3g.js";import{B as g}from"./button-ZzasjO00.js";import{L as u}from"./loader-circle-B-x9pUtq.js";import{C as d}from"./circle-check-big-CPPPt1rZ.js";import"./chevron-down-h2JQFOeA.js";import"./shopping-cart-B9P2Dgtp.js";import"./mail-B2MtDYZl.js";import"./map-pin-DSSFnM43.js";import"./cookie-CPnIrQ0N.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const b=h("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const k=h("MailX",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h9",key:"1j9vog"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m17 17 4 4",key:"1b3523"}],["path",{d:"m21 17-4 4",key:"uinynz"}]]);function q(){const[x]=y(),i=x.get("token"),[o,s]=c.useState("loading"),[l,m]=c.useState(!1);c.useEffect(()=>{if(!i){s("invalid");return}(async()=>{try{const n=await(await fetch(`https://bsgyakvkqebjecfinmvh.supabase.co/functions/v1/handle-email-unsubscribe?token=${i}`,{headers:{apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJzZ3lha3ZrcWViamVjZmlubXZoIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzMyNTQwMjIsImV4cCI6MjA4ODgzMDAyMn0.fLQ2SPYBAq7uMCWmV1KJHcG7sxxpMvar3qVA1TJuNhY"}})).json();n.valid===!1&&n.reason==="already_unsubscribed"?s("already"):n.valid?s("valid"):s("invalid")}catch{s("invalid")}})()},[i]);const p=async()=>{if(i){m(!0);try{const{data:a,error:r}=await f.functions.invoke("handle-email-unsubscribe",{body:{token:i}});if(r)throw r;s(a!=null&&a.success?"success":"error")}catch{s("error")}finally{m(!1)}}},t={loading:{icon:e.jsx(u,{className:"h-12 w-12 animate-spin text-primary"}),title:"Verifying...",desc:"Please wait while we verify your request."},valid:{icon:e.jsx(k,{className:"h-12 w-12 text-primary"}),title:"Unsubscribe",desc:"Click the button below to unsubscribe from our emails."},already:{icon:e.jsx(d,{className:"h-12 w-12 text-muted-foreground"}),title:"Already Unsubscribed",desc:"You have already unsubscribed from our emails."},invalid:{icon:e.jsx(b,{className:"h-12 w-12 text-destructive"}),title:"Invalid Link",desc:"This unsubscribe link is invalid or has expired."},success:{icon:e.jsx(d,{className:"h-12 w-12 text-canion-green"}),title:"Unsubscribed",desc:"You've been successfully unsubscribed. You will no longer receive emails from us."},error:{icon:e.jsx(b,{className:"h-12 w-12 text-destructive"}),title:"Something Went Wrong",desc:"We could not process your request. Please try again later."}}[o];return e.jsxs(e.Fragment,{children:[e.jsx(v,{}),e.jsx("div",{className:"min-h-screen pt-24 pb-16 px-4 bg-background",children:e.jsxs("div",{className:"container mx-auto max-w-md text-center",children:[e.jsx("div",{className:"mb-6",children:t.icon}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:t.title}),e.jsx("p",{className:"text-muted-foreground mb-8",children:t.desc}),o==="valid"&&e.jsx(g,{onClick:p,disabled:l,size:"lg",children:l?e.jsxs(e.Fragment,{children:[e.jsx(u,{className:"mr-2 h-4 w-4 animate-spin"})," Processing..."]}):"Confirm Unsubscribe"})]})}),e.jsx(j,{})]})}export{q 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.