PageSourceSearch

https://whatsfordinner.ie/_nuxt/BdwK_YLX.js

js whatsfordinner.ie collected 2026-10-05 02:59:05 UTC 4,815 bytes, 1 lines download raw bytes

1import{_ as P}from"./Pt85wM72.js";import{d as A,y as B,e as E,v as N,g as c,h as t,i as s,q as R,j as o,k as p,F as $,U as q,n as h,l as f,t as U,p as j,r,m as M,f as i,_ as z,a8 as D}from"./CYqbzUre.js";import{_ as I}from"./CDj9Ps7t.js";import"./Bgpc2yOq.js";const F={class:"min-h-[70vh] flex items-center justify-center px-4 py-16"},H={class:"w-full max-w-md bg-white rounded-3xl overflow-hidden shadow-xl shadow-neutral-900/5"},L={class:"p-8 sm:p-10"},O={key:1,class:"text-center"},G={class:"w-16 h-16 bg-error-50 rounded-2xl flex items-center justify-center mx-auto mb-4"},W={class:"space-y-3"},J={key:2,class:"text-center"},K={class:"w-16 h-16 bg-success-50 rounded-2xl flex items-center justify-center mx-auto mb-4"},Q={class:"text-center mb-8"},X={class:"w-16 h-16 bg-gradient-to-br from-primary-500 to-secondary-500 rounded-2xl flex items-center justify-center mx-auto mb-4 shadow-lg shadow-primary-500/20"},Y={key:0,class:"p-3 bg-error-50 border border-error-200 rounded-xl text-error-600 text-sm flex items-center gap-2"},_=8,ae=A({__name:"reset-password",setup(Z){const S=B(),{openLoginModal:T}=E(),g=String(S.query.token??"").trim(),a=r(g?"form":"invalid"),n=r(""),w=r(""),d=r(!1),l=r(""),v=r(!1);N({title:"Set a new password"});function y(){T(),D("/")}async function C(){if(n.value.length<_){l.value=`Please use at least ${_} characters.`;return}if(n.value!==w.value){l.value="Those passwords do not match.";return}v.value=!0,l.value="";try{await $fetch("/api/auth/password/reset",{method:"POST",body:{token:g,new_password:n.value}}),a.value="done"}catch(b){b?.data?.code==="PASSWORD_RESET_REJECTED"?l.value=b.statusMessage||"That password was not accepted. Please choose another.":a.value="invalid"}finally{v.value=!1}}return(b,e)=>{const V=P,x=z,u=M,k=I;return i(),c("div",F,[t("div",H,[e[16]||(e[16]=t("div",{class:"h-2 bg-gradient-to-r from-primary-500 via-secondary-500 to-primary-500"},null,-1)),t("div",L,[s(a)==="request"?(i(),R(V,{key:0,onBack:y})):s(a)==="invalid"?(i(),c("div",O,[t("div",G,[o(x,{name:"i-lucide-link-2-off",class:"w-8 h-8 text-error-600"})]),e[6]||(e[6]=t("h1",{class:"font-display text-2xl font-semibold text-neutral-900 mb-2"},"This link is no longer valid",-1)),e[7]||(e[7]=t("p",{class:"text-neutral-500 mb-8"}," A reset link works only once. Ask for a new one and we will email it to you. ",-1)),t("div",W,[o(u,{color:"primary",block:"",size:"xl","data-test":"reset-request-new",onClick:e[0]||(e[0]=m=>a.value="request")},{default:p(()=>[...e[4]||(e[4]=[f(" Request a new link ",-1)])]),_:1}),o(u,{variant:"link",block:"",class:"text-sm font-medium text-primary-500 hover:cursor-pointer",onClick:y},{default:p(()=>[...e[5]||(e[5]=[f(" Back to sign in ",-1)])]),_:1})])])):s(a)==="done"?(i(),c("div",J,[t("div",K,[o(x,{name:"i-lucide-check",class:"w-8 h-8 text-success-600"})]),e[9]||(e[9]=t("h1",{class:"font-display text-2xl font-semibold text-neutral-900 mb-2"},"Password changed",-1)),e[10]||(e[10]=t("p",{class:"text-neutral-500 mb-8"},"Sign in with your new password to carry on ordering.",-1)),o(u,{color:"primary",block:"",size:"xl","data-test":"reset-go-to-signin",onClick:y},{default:p(()=>[...e[8]||(e[8]=[f(" Go to sign in ",-1)])]),_:1})])):(i(),c($,{key:3},[t("div",Q,[t("div",X,[o(x,{name:"i-lucide-lock",class:"w-8 h-8 text-white"})]),e[11]||(e[11]=t("h1",{class:"font-display text-2xl font-semibold text-neutral-900 mb-2"},"Set a new password",-1)),e[12]||(e[12]=t("p",{class:"text-neutral-500"},"Choose a password you do not use anywhere else.",-1))]),t("form",{class:"space-y-5",onSubmit:q(C,["prevent"])},[t("div",null,[e[13]||(e[13]=t("label",{class:"block text-sm font-medium text-neutral-700 mb-2"},"New password",-1)),o(k,{modelValue:s(n),"onUpdate:modelValue":e[2]||(e[2]=m=>h(n)?n.value=m:null),type:s(d)?"text":"password",placeholder:"At least 8 characters","leading-icon":"i-lucide-lock",class:"w-full",variant:"none",ui:{trailing:"pe-1"}},{trailing:p(()=>[o(u,{color:"neutral",variant:"link",size:"sm",icon:s(d)?"i-lucide-eye-off":"i-lucide-eye","aria-label":s(d)?"Hide password":"Show password",onClick:e[1]||(e[1]=m=>d.value=!s(d))},null,8,["icon","aria-label"])]),_:1},8,["modelValue","type"])]),t("div",null,[e[14]||(e[14]=t("label",{class:"block text-sm font-medium text-neutral-700 mb-2"},"Confirm new password",-1)),o(k,{modelValue:s(w),"onUpdate:modelValue":e[3]||(e[3]=m=>h(w)?w.value=m:null),type:"password",placeholder:"Type it again","leading-icon":"i-lucide-lock",class:"w-full",variant:"none"},null,8,["modelValue"])]),s(l)?(i(),c("div",Y,[o(x,{name:"i-lucide-alert-circle",class:"w-4 h-4 shrink-0"}),f(" "+U(s(l)),1)])):j("",!0),o(u,{type:"submit",color:"primary",block:"",size:"xl",loading:s(v)},{default:p(()=>[...e[15]||(e[15]=[f(" Save new password ",-1)])]),_:1},8,["loading"])],32)],64))])])])}}});
1export{ae 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.