PageSourceSearch

https://www.gurupsychics.com/build/assets/Checkout-dfd3a1e2.js

js gurupsychics.com collected 2026-10-02 16:10:40 UTC 9,151 bytes, 1 lines download raw bytes

1import{a as Y,w as q}from"./preload-helper-585d359e.js";import{w as H,u as K,m as Q,x as W,f as X,a as y,M as Z,n as D,y as b}from"./app-87ee2351.js";import{_ as ee}from"./PageHeader.vue_vue_type_script_setup_true_lang-dc047684.js";import{u as te}from"./orderStore-90573f4a.js";import{C as j}from"./coupon-833b1053.js";import{C as ae}from"./CouponRepository-9ff71410.js";import{_ as oe}from"./BackSection.vue_vue_type_script_setup_true_lang-25619975.js";import{h as se,r as d,f as ne,w as P,k as u,s as R,G as re,l as a,M as ie,p as g,u as c,L as v,J as ce,I as le,q as S,F as de,j as p}from"./runtime-core.esm-bundler-42b5c9ff.js";import"./ClientDashboard-543086cc.js";const ue="/build/assets/coupon-d8afdccc.png",pe={class:"intro-y container lg:max-w-6xl mx-auto mt-4 px-4"},me={class:"w-full"},fe={key:0,class:"min-h-[60vh] flex items-center justify-center px-4"},ge={key:1,class:"py-10 intro-y"},ve={class:"container mx-auto px-4"},he={class:"grid md:w-2/3 mx-auto grid-cols-1 md:grid-cols-2 gap-6"},xe={class:"bg-white rounded-xl p-5 shadow-md text-gray-800 border border-gray-200"},ye={class:"space-y-4"},be={class:"text-[#fb369f] text-sm mt-1"},we={class:"text-sm mt-1"},ke={class:"flex items-center gap-2 bg-gray-100 p-2 rounded-md"},_e=["src"],Ce={key:0,class:"text-sm mt-1"},Pe={key:0,class:"text-red-500"},Se={key:1,class:"text-green-500"},Ie={class:"divide-y divide-gray-200 text-sm space-y-2 pt-2"},Te={class:"flex justify-between pt-1"},Me={key:0,class:"flex justify-between pt-1 text-[#fb369f]"},Fe={class:"flex justify-between font-semibold pt-2 text-gray-900"},Ae={key:0,class:"max-w-3xl mx-auto text-center mt-6"},ze=se({__name:"Checkout",setup(Ne){let{cookie:w,removeCookie:E}=H("chat-room");const s=te(),k=K(),f=Q(),h=W(),V=X(),$=new ae,o=d({status:2,amount:0,content:"",package:{id:4,name:"The SUN Package",price:80,sale_price:77.3},paymentId:"",payment_source:"package"}),I=d(0),T=d(0);d(k.isAuthorized);const x=d(""),l=d();d(null);const C=d(!1),M=ne(()=>{const t=s.currentPackage;if(!t)return 0;const e=t.sale_price??t.price;let n=0;const r=o.value.coupon;return r&&(r.type===j.FLAT?n=Math.min(e,r.amount):r.amount<=100&&(n=e*r.amount/100)),parseFloat((e-n).toFixed(2))}),L=async(t="post")=>{var e,n,r;try{if(t==="post"){const i=(n=(e=(await y.post("/transactions",{...o.value,payment_source:"package"})).data)==null?void 0:e.data)==null?void 0:n.id;i?sessionStorage.setItem("transactionId",i.toString()):console.warn("No transaction ID available to save.")}else{const m=sessionStorage.getItem("transactionId");if(await y.put(`/transactions/${m}`,{...o.value,payment_source:"package"}),sessionStorage.removeItem("transactionId"),k.addMoreBalance(o.value.package.price),w.value){const i=JSON.parse(w.value).id,_=await z(i);await G({room_id:i,type:Z.ADD_TIME,content:{text:`${(r=_.client)==null?void 0:r.username} add more credits`}}),D.join(`chat.${i}`).whisper("addedCredits",{package:o.value.package}),E(),await h.push({name:"ChatRoom",params:{id:i}})}else await h.push({name:"Client.Accounts.Dashboard"});s.clearPackage(),f.openSuccess("Add credits success.")}}catch(m){console.error("Transaction error:",m)}},F=async()=>
1{try{o.value={package:{id:s.currentPackage.id,name:s.currentPackage.name,price:s.currentPackage.price,sale_price:s.currentPackage.sale_price},amount:Math.round(M.value*100),user_id:k.userId,payment_source:"package",coupon:o.value.coupon,status:1,dumps:"Pending Payment"},await L("post");const t=sessionStorage.getItem("transactionId");if(!t){f.openError("Transaction failed. Please try again.");return}const{data:e}=await y.post("/create-checkout-session",{amount:Math.round(M.value*100),userId:k.userId,packageId:s.currentPackage.id,packageName:s.currentPackage.name,transaction_id:t,page_name:"normal"});window.location.href=e.url}catch(t){console.error("Checkout Error:",t),f.openError("Stripe checkout initialization failed.")}},B=async t=>{try{C.value=!0,sessionStorage.removeItem("transactionId"),f.openSuccess("Payment successful!"),await h.push({name:"Client.Accounts.Dashboard"})}catch(e){console.error("Stripe success handling failed:",e),f.openError("Payment was successful, but final processing failed.")}finally{C.value=!1}};P(()=>V.query,t=>{const e=t.session_id,n=t.canceled;e?B():n==="true"&&(f.openError("Payment was cancelled."),sessionStorage.removeItem("transactionId"),h.replace({path:"/client/checkout"}))},{immediate:!0}),P(()=>s.currentPackage,t=>{if(t){const e=t.sale_price??t.price;I.value=e,T.value=e,o.value.package={id:t.id,name:t.name,price:t.price,sale_price:t.sale_price}}},{immediate:!0});const O=async()=>{if(!x.value){l.value={type:1},o.value.coupon=void 0;return}try{o.value.coupon=await $.apply(x.value),l.value={type:2}}catch{l.value={type:1},o.value.coupon=void 0}},z=async t=>{const{data:e}=await y.get(`/rooms/${t}`);return e.data},G=async t=>{await y.post("/messages",t)},A=()=>{if(!o.value.coupon)return 0;const t=o.value.package.sale_price?o.value.package.sale_price.toFixed(2):o.value.package.price.toFixed(2);if(o.value.coupon.type===j.FLAT){const e=parseFloat(t);return Math.min(e,o.value.coupon.amount)}return o.value.coupon.amount<=100?parseFloat((parseFloat(t)*o.value.coupon.amount/100).toFixed(2)):0},J=()=>{const t=JSON.parse(w.value).id;D.join(`chat.${t}`).whisper("canceledAddCredits"),h.push({name:"ChatRoom",params:{id:t}})};return P(()=>x.value,async t=>{if(((t==null?void 0:t.trim())||"")===""){l.value=void 0,o.value.coupon=void 0;return}await O()},{flush:"sync"}),(t,e)=>{var n,r,m,i,_,N;return p(),u(de,null,[R(ee,null,{default:re(()=>[...e[1]||(e[1]=[a("h1",{class:"text-5xl mobile:text-xl wide-tablet:text-3xl font-bold drop-shadow-md text-shadow-banner"}," Checkout ",-1)])]),_:1}),a("section",pe,[a("div",me,[R(oe,{to:{name:"OurPackages"}})])]),C.value?(p(),u("div",fe,[...e[2]||(e[2]=[ie('<div class="text-center max-w-sm w-full"><div class="relative inline-block w-14 h-14 mb-6 mx-auto"><div class="absolute inset-0 rounded-full bg-gradient-to-tr from-[#458aff] to-[#fb369f] animate-spin border-4 border-transparent border-t-white"></div><div class="absolute inset-2 bg-white rounded-full"></div></div><p class="text-lg sm:text-xl font-semibold text-[#458aff] mb-2"> Processing your payment... </p><p class="text-sm sm:text-base text-gray-500 leading-relaxed"> Please wait while we confirm your transaction. <br class="hidden sm:inline"> Don’t refresh or close this tab. </p></div>',1)])])):(p(),u("section",ge,[a("div",ve,[a("div",he,[a("div",xe,[e[8]||(e[8]=a("h2",{class:"text-xl font-bold mb-4 text-[#458aff]"},"Order Summary",-1)),a("div",ye,[a("div",null,[e[4]||(e[4]=a("h3",{class:"font-semibold"},"Your Selected Package is:",-1)),a("h4",be,g((r=(n=c(s))==null?void 0:n.currentPackage)==null?void 0:r.name),1),a("p",we,[v(" Load "+g(c(b).format((m=c(s))==null?void 0:m.currentPackage.price)),1),e[3]||(e[3]=a("br",null,null,-1)),v(" Pay "+g(c(b).format((i=c(s))==null?void 0:i.currentPackage.sale_price)),1)])]),a("div",ke,[a("img",{src:c(ue),class:"w-6 md:w-8 lg:w-10",alt:"Coupon Icon"},null,8,_e),ce(a("input",{"onUpdate:modelValue":e[0]||(e[0]=U=>x.value=U),type:"text",class:le(["w-full px-3 py-2 text-sm border rounded-full placeholder-gray-500 focus:outline-none focus:ring-2",{"border-red-500 text-red-600 ring-red-200":((_=l.value)==null?void 0:_.type)===1,"border-green-500 text-green-600 ring-green-200":((N=l.value)==null?void 0:N.type)===2,"border-gray-300":!l.value}]),placeholder:"Your Coupon"},null,2),[[Y,x.value]])]),l.value?(p(),u("div",Ce,[l.value.type===1?(p(),u("span",Pe,"Invalid Coupon")):(p(),u("span",Se,"Valid Coupon"))])):S("",!0),a("div",Ie,[a("div",Te,[e[5]||
1(e[5]=a("span",null,"Subtotal:",-1)),a("span",null,g(c(b).format(I.value)),1)]),o.value.coupon?(p(),u("div",Me,[e[6]||(e[6]=a("span",null,"Discount:",-1)),a("span",null,"-"+g(c(b).format(A())),1)])):S("",!0),a("div",Fe,[e[7]||(e[7]=a("strong",null,"Total:",-1)),a("strong",null,g(c(b).format(T.value-A())),1)])]),a("div",{class:"text flex justify-center sm:hidden"},[a("button",{onClick:F,class:"mt-6 px-8 py-3 px-4 bg-[linear-gradient(45deg,#458aff,#fb369f)] text-white font-semibold rounded-full shadow-lg hover:opacity-90 transition-transform hover:scale-105"}," Pay ")])])]),a("div",{class:"bg-white rounded-xl p-5 shadow-md border border-gray-200 flex flex-col items-center text-gray-800"},[a("button",{onClick:F,class:"hidden sm:inline-block mt-6 px-8 py-3 px-4 bg-[linear-gradient(45deg,#458aff,#fb369f)] text-white font-semibold rounded-full shadow-lg hover:opacity-90 transition-transform hover:scale-105"}," Pay "),e[9]||(e[9]=a("div",{class:"mt-4 max-w-md text-center text-gray-500 text-xs md:text-sm"},[a("p",null,[v(" This site is owned and operated by "),a("br"),v(" GoShenaa Ltd."),a("br"),v(" The charge on your statement will show "),a("span",{class:"font-semibold text-[#fb369f]"},"“GoShenaa Ltd”"),v(" to preserve your privacy. ")])],-1))])]),c(w)?(p(),u("div",Ae,[a("button",{class:"px-6 md:px-8 py-2 text-sm font-bold uppercase rounded-full bg-[linear-gradient(45deg,#fb369f,#458aff)] text-white shadow hover:opacity-90",onClick:q(J,["prevent"])}," Back to chat ")])):S("",!0)])]))],64)}}});export{ze 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.