1import{aR as R,ea as $,et as b,dV as C,c$ as u,cH as U,ew as k,ct as x,aB as v,aw as a,dD as n,dP as s,f as A,ay as g,at as w,dv as B,cL as p,a1 as L}from"./BQpWByWK.js";const N={class:"wc-referral-entry"},S={class:"wc-referral-entry__card"},T={key:0,class:"wc-referral-entry__account"},D={class:"wc-referral-entry__actions"},V=["disabled"],q={class:"wc-referral-entry__btn",href:"/"},H=R({__name:"[code]",setup(M){const{t:e}=$(),h=b(),i=C(),m=w(()=>String(h.params.code||"")),o=u(e("referral.status_verifying_title")),c=u(e("referral.status_verifying_text")),l=u(""),d=u(!1),y=w(()=>i.userName.value||"");U(async()=>{if(!m.value){await _(e("referral.invalid_code_title"),e("referral.invalid_code_text"));return}try{const r=k().public.apiBase||void 0,t=await $fetch(`/api/app/referral/${encodeURIComponent(m.value)}`,{baseURL:r});if(!t.valid||!t.inviterUserId){await _(e("referral.inviter_not_found_title"),e("referral.inviter_not_found_text"));return}const f=t.cookieDays*24*3600;if(document.cookie=`${t.cookieName}=${encodeURIComponent(t.inviterUserId)}; Max-Age=${f}; path=/; SameSite=Lax`,!i.resolved.value)try{await i.refresh()}catch{}if(i.isAuthenticated.value){l.value=t.inviterUserId,o.value=e("referral.recorded_title"),c.value=e("referral.signed_in_hint");return}o.value=e("referral.recorded_title"),c.value=e("referral.recorded_to_register"),await x(`/Login?mode=register&inviter=${encodeURIComponent(t.inviterUserId)}`)}catch{await _(e("referral.request_failed_title"),e("referral.request_failed_text"))}});async function I(){d.value||!l.value||(d.value=!0,await B(`/Login?mode=register&inviter=${encodeURIComponent(l.value)}`))}async function _(r,t){o.value=r,c.value=t,await new Promise(f=>setTimeout(f,800)),window.location.href="/"}return(r,t)=>(p(),v("div",N,[a("div",S,[t[0]||(t[0]=a("i",{class:"fa-solid fa-user-plus wc-referral-entry__icon"},null,-1)),a("h2",null,n(s(o)),1),a("p",null,n(s(c)),1),s(l)?(p(),v(A,{key:0},[s(y)?(p(),v("p",T,n(r.$t("referral.signed_in_as",{name:s(y)})),1)):g("",!0),a("div",D,[a("button",{type:"button",class:"wc-referral-entry__btn wc-referral-entry__btn--primary",disabled:s(d),onClick:I},n(r.$t("referral.switch_to_register")),9,V),a("a",q,n(r.$t("referral.continue_here")),1)])],64)):g("",!0)])]))}}),P=L(H,[["__scopeId","data-v-f6b12a92"]]);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.