PageSourceSearch

https://doghealthy.netlify.app/_nuxt/JWmI553j.js

js doghealthy.netlify.app collected 2026-10-03 10:40:50 UTC 3,236 bytes, 1 lines download raw bytes

1import{f as I,H as P,D as q,u as B,r as d,h as N,c as f,a as l,i as h,C as $,t as p,j as r,w as D,e as R,o as m,d as A}from"#entry";import{u as H}from"./Dy9pVEbO.js";import{u as L,w as g}from"./Z8EQgydt.js";import"./DKLWY9DJ.js";const O={class:"min-h-screen bg-gray-50 flex items-center justify-center px-4"},Q={class:"max-w-md w-full bg-white rounded-2xl shadow-lg p-8 text-center"},V={class:"text-2xl font-bold text-gray-900 mb-3"},W={class:"text-sm text-gray-600 mb-4"},j={key:0,class:"text-sm text-red-700 bg-red-50 border border-red-200 rounded-lg px-3 py-2 mb-4"},_="doghealthy_post_login_redirect",z=I({__name:"success",setup(E){H({title:"Payment complete — DogHealthy",description:"Confirming your DogHealthy subscription.",path:"/billing/success",index:!1});const u=P(),o=q(),x=B(),{markSubscribed:b,peekPendingAction:w,consumePendingAction:v,readCheckoutContext:k,clearCheckoutContext:S}=L(),a=d("Confirming your payment…"),c=d("Please wait a moment while we activate your subscription."),i=d(""),C=()=>{const t=k(),s=w()||t.pending||null,e=(typeof o.query.next=="string"&&o.query.next.startsWith("/")?o.query.next:"")||t.next||"";return s?.action==="createTag"&&s.petId?(v(),`/dogs/${s.petId}?createTag=1&subscription=success`):e?e.includes("createTag=")?g(e,{subscription:"success",createTag:"1"}):e.includes("/dogs/new")?g(e,{subscription:"success"}):g(e,{add:"1",subscription:"success"}):"/dogs?subscription=success"},T=async(t,s)=>{if(a.value="Subscription active",c.value="Taking you back to what you were doing…",!s){typeof window<"u"&&sessionStorage.setItem(_,t),await u.replace({path:"/auth/login",query:{redirect:t}});return}await u.replace(t)};return N(async()=>{const t=typeof o.query.session_id=="string"?o.query.session_id.trim():"";if(!t.startsWith("cs_")){a.value="Missing payment session",c.value="We could not find your Stripe session. If you were charged, contact support.",i.value="No session_id on this page.";return}typeof window<"u"&&sessionStorage.setItem("doghealthy_pending_session_id",t);const s=C();try{const{data:n}=await x.auth.getSession(),e=n.session?.access_token,y={};e&&(y.Authorization=`Bearer ${e}`),await $fetch("/.netlify/functions/confirm-subscription",{method:"POST",headers:y,body:{sessionId:t}}),b(),S(),typeof window<"u"&&sessionStorage.removeItem("doghealthy_pending_session_id"),await T(s,e)}catch(n){console.error("billing success confirm:",n),a.value="Payment received",c.value="Your payment may have succeeded, but we could not activate the account automatically. Sign in and we will retry.",i.value=n?.data?.error||n?.message||"Confirmation failed";const e=`/billing/success?session_id=${encodeURIComponent(t)}${typeof o.query.next=="string"?`&next=${encodeURIComponent(o.query.next)}`:""}`;typeof window<"u"&&sessionStorage.setItem(_,e),setTimeout(()=>{u.replace({path:"/auth/login",query:{redirect:e}})},2500)}}),(t,s)=>{const n=R;return m(),f("div",O,[l("div",Q,[l("h1",V,p(r(a)),1),l("p",W,p(r(c)),1),r(i)?(m(),f("p",j,p(r(i)),1)):h("",!0),r(i)?(m(),$(n,{key:1,to:"/billing/subscribe",class:"inline-flex text-sm font-medium text-blue-700 hover:text-blue-800"},{default:D(()=>[...s[0]||(s[0]=[A(" Back to plans ",-1)])]),_:1})):h("",!0)])])}}});export{z 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.