1import{f as L,g as O,r as U,aH as N,k as x,fR as P,z as V,av as A,c as m,a as s,n as B,b as l,F as y,t as _,w as v,l as u,m as D,s as g,fH as H,K as j,o as d,q as $,d as w}from"./Hz_U0fwx.js";import{s as z}from"./IBG-Sfxa.js";const F={class:"dark min-h-screen bg-black text-white flex items-center justify-center"},q={class:"text-center max-w-md mx-auto px-6"},K={key:0,class:"mb-8"},W={class:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-blue-500/20 mb-6"},Q={class:"mb-8"},X={class:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-emerald-500/20 mb-6"},Y={class:"text-foreground-faint"},G={class:"mb-8"},J={class:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-amber-500/20 mb-6"},Z={class:"text-foreground-faint"},ee=2e3,te=15,se=2e3,ne=1e3,ae=L({__name:"success",setup(oe){const S=N(),b=O(),{gotoHome:c,gotoDiamonds:h}=D(),i=U("polling");let f=null;const n=E(S.query.orderNo),r=x(()=>n==null?void 0:n.startsWith("diamond_")),T=x(()=>n==null?void 0:n.startsWith(`${P.Lifetime}_`));function E(t){return Array.isArray(t)?typeof t[0]=="string"?t[0]:"":typeof t=="string"?t:""}async function k(){if(!n){c();return}let t=0;async function e(){t++;try{if((await H(n)).status==="success"){await M();return}}catch{}if(t>=te){i.value="timeout";return}f=setTimeout(e,ee)}await e()}async function M(){i.value="success",await C(),r.value?setTimeout(()=>{h()},3e3):(z({source:"stripe-success",orderNo:n,membershipType:T.value||b.isLifetimeMembership()?"lifetime":"regular"}),setTimeout(()=>{c()},ne))}async function C(){let t=!1;function e(){t||(t=!0,j.warning("æ¯ä»å·²æåï¼ä¼åç¶ææ£å¨åæ¥ã妿é¦é¡µä»æªæ´æ°ï¼è¯·å·æ°é¡µé¢è¯è¯ã",{duration:5e3}))}const o=b.updateUserInfo().then(()=>"done").catch(p=>(console.error("æ¯ä»æååå·æ°ç¨æ·ä¿¡æ¯å¤±è´¥:",p),e(),"failed"));let a=null;const R=new Promise(p=>{a=setTimeout(()=>p("timeout"),se)}),I=await Promise.race([o,R]);a&&clearTimeout(a),I==="timeout"&&(console.warn("æ¯ä»æååå·æ°ç¨æ·ä¿¡æ¯è¶
æ¶ï¼ç»§ç»è·³è½¬å¹¶ä¿çåå°å·æ°"),e())}return V(()=>{k()}),A(()=>{f&&clearTimeout(f)}),(t,e)=>{const o=$;return d(),m("div",F,[s("div",q,[i.value==="polling"?(d(),m("div",K,[s("div",W,[l(o,{name:"lucide:loader-2",class:"w-10 h-10 text-blue-400 animate-spin"})]),e[2]||(e[2]=s("h1",{class:"text-3xl font-bold mb-3"}," æ£å¨ç¡®è®¤æ¯ä»ç»æ... ",-1)),e[3]||(e[3]=s("p",{class:"text-foreground-faint"}," 请ç¨åï¼æ£å¨å¤çæ¨ç订å ",-1))])):i.value==="success"?(d(),m(y,{key:1},[s("div",Q,[s("div",X,[l(o,{name:"lucide:check",class:"w-10 h-10 text-emerald-400"})]),e[4]||(e[4]=s("h1",{class:"text-3xl font-bold mb-3"}," æ¯ä»æå ",-1)),s("p",Y,_(r.value?"é»ç³å·²å°è´¦ï¼å³å°è·³è½¬...":"ä¼åæçå·²çæï¼å³å°è¿åé¦é¡µ"),1)]),l(u(g),{type:"button",variant:"inverse",size:"lg",onClick:e[0]||(e[0]=a=>r.value?u(h)():u(c)())},{default:v(()=>[w(_(r.value?"ç«å³åå¾":"è¿åé¦é¡µ"),1)]),_:1})],64)):i.value==="timeout"?(d(),m(y,{key:2},[s("div",G,[s("div",J,[l(o,{name:"lucide:clock",class:"w-10 h-10 text-amber-400"})]),e[5]||(e[5]=s("h1",{class:"text-3xl font-bold mb-3"}," æ¯ä»å¤çä¸ ",-1)),s("p",Z,_(r.value?"è®¢åæ£å¨å¤çï¼è¯·ç¨åå¨é±å
䏿¥çé»ç³ä½é¢":"è®¢åæ£å¨å¤çï¼è¯·ç¨åå¨ä¸ªäººä¸å¿æ¥çä¼åç¶æ"),1)]),l(u(g),{type:"button",variant:"inverse",size:"lg",onClick:e[1]||(e[1]=a=>u(c)())},{default:v(()=>[...e[6]||(e[6]=[w(" è¿åé¦é¡µ ",-1)])]),_:1})],64)):B("",!0)])])}}});export{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.