1import{_ as U}from"./C0Cw_uK0.js";import{b8 as $,b5 as L,bH as j,bB as q,ba as k,bb as Y,bc as i,bd as r,bg as t,be as s,bf as l,by as H,bv as v,bi as u,bm as b,bn as f,bk as G,bl as p,bu as O,bo as c,bJ as J,bz as K}from"./DQFKzUbq.js";import{_ as Q}from"./gDbrgXrH.js";import{_ as W}from"./vHWCfnLa.js";(function(){try{var x=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};x.SENTRY_RELEASE={id:"c403c0ba60050077d413b56c9316291f72134922"};var g=new x.Error().stack;g&&(x._sentryDebugIds=x._sentryDebugIds||{},x._sentryDebugIds[g]="1d78e5e3-5873-4dbe-acf1-c51b4a66c924",x._sentryDebugIdIdentifier="sentry-dbid-1d78e5e3-5873-4dbe-acf1-c51b4a66c924")}catch{}})();const X={role:"tabpanel",class:"relative py-6 sm:py-8"},Z={class:"space-y-8"},tt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"},et={class:"flex items-center gap-4"},st={class:"p-3 bg-linear-to-br from-blue-100 to-indigo-100 dark:from-blue-900/20 dark:to-indigo-900/20 rounded-2xl group-hover:scale-110 transition-transform"},at={class:"flex items-center gap-4"},ot={class:"p-3 bg-gradient-to-br from-yellow-100 to-orange-100 dark:from-yellow-900/20 dark:to-orange-900/20 rounded-2xl group-hover:scale-110 transition-transform"},rt={class:"flex items-center gap-4"},lt={class:"p-3 bg-gradient-to-br from-green-100 to-teal-100 dark:from-green-900/20 dark:to-teal-900/20 rounded-2xl group-hover:scale-110 transition-transform"},nt={key:0,class:"space-y-4"},it={class:"space-y-3"},dt={key:1,class:"space-y-4"},ct={class:"flex flex-col md:flex-row"},ut={class:"flex-1 p-4 sm:p-6"},xt={class:"space-y-4"},gt={class:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3"},pt={class:"flex flex-wrap items-center gap-3"},mt={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},yt={class:"font-medium text-gray-900 dark:text-white"},bt={class:"pt-3 border-t border-gray-200 dark:border-gray-700"},ft={class:"text-lg font-bold text-slate-900 dark:text-white"},_t={class:"text-center space-y-4"},ht={class:"flex justify-center"},kt={class:"text-sm text-gray-500 dark:text-gray-400"},vt={key:0,class:"space-y-4"},wt={class:"space-y-3"},Ct={key:1,class:"space-y-4"},Et={class:"flex flex-col lg:flex-row"},Dt={class:"lg:w-2/5 w-full"},It={class:"flex-1 p-4 sm:p-6"},St={class:"space-y-4"},Tt={class:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3"},At={class:"flex-1"},zt={class:"flex flex-wrap items-center gap-2 mb-2"},Nt={class:"text-xs px-2 py-1 bg-gray-100 dark:bg-gray-800 rounded-lg font-mono uppercase flex items-center gap-1"},Ot={class:"text-base sm:text-lg font-bold text-slate-900 dark:text-white"},Rt={key:0,class:"space-y-2"},Mt={class:"text-gray-700 dark:text-gray-300"},Pt={class:"pt-3 border-t border-gray-200 dark:border-gray-700"},Bt={class:"text-lg font-bold text-slate-900 dark:text-white"},Ft={class:"text-center space-y-3"},Vt={class:"flex justify-center"},qt={__name:"index",async setup(x){let g,w;const C=$(),{$toast:_,$formatCurrency:T}=L(),E=k([]),D=k([]),I=k(!1),S=k(!1),{data:{user:A}}=([g,w]=j(()=>C.auth.getUser()),g=await g,w(),g);q(()=>{B(),P()});const R=async(o,e="Text")=>{try{await navigator.clipboard.writeText(o),_?.success(`${e} copied to clipboard`)}catch(n){console.error("Failed to copy:",n),_?.error("Failed to copy to clipboard")}},M=o=>({CONFIRMED:"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300",SUCCESS:"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300",CREATED:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300",PENDING:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300",FAILED:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300",REVOKED:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300",CANCELLED:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300"})[o]||"bg-gray-100 text-gray-700 dark:bg-gray-900 dark:text-gray-300",P=async()=>{try{I.value=!0;const{data:o,error:e}=await C.from("order").select("*, payments!inner(*), order_item(*, activities(*))").eq("user_id",A.id).in("type",["ACTIVITY","ACTIVITY_MEMBERSHIP"]).neq("payments.status","FAILED").order("created_at",{ascending:!1});if(e)throw e;E.value=o||[]}catch(o){console.error(o),_?.error("Failed to fetch bookings")}finally{I.value=!1}},B=async()=>{try{S.value=!0;const{data:o,error:e}=await C.from("user_membership").select("*").eq("user_id",A.id).or("status.eq.SUCCESS");if(e)throw e;D.value=o}catch(o){console.error(o),_?.error("Failed to fetch memberships")}finally{S.value=!1}},F=o=>o.order_item.length===0?"":o?.order_item[0].activities.thumbnail_image_url,z=o=>o.order_item.length===0?"":o?.order_item[0].activities.name;return(o,e)=>{const n=Y("mdicon"),d=U,h=H,m=Q,N=G,V=J;return r(),i("div",X,[t("div",Z,[t("div",null,[e[3]||(e[3]=t("h2",{class:"text-xl sm:text-2xl font-bold uppercase mb-6"},"My Account",-1)),t("div",tt,[s(h,{to:"/account/settings",class:"block group"},{default:l(()=>[s(d,{ui:{body:"p-4 sm:p-6"},class:"hover:shadow-lg transition-shadow"},{default:l(()=>[t("div",et,[t("div",st,[s(n,{name:"AccountCog",size:"32",class:"text-blue-600 dar
1k:text-blue-400"})]),e[0]||(e[0]=t("div",{class:"flex-1"},[t("h3",{class:"font-semibold text-base text-slate-900 dark:text-white"},"Account Settings"),t("p",{class:"text-xs text-gray-600 dark:text-gray-400 mt-1"},"Manage your profile")],-1)),s(n,{name:"ChevronRight",size:"24",class:"text-gray-400"})])]),_:1})]),_:1}),s(h,{to:"/account/my-points",class:"block group"},{default:l(()=>[s(d,{ui:{body:"p-4 sm:p-6"},class:"hover:shadow-lg transition-shadow"},{default:l(()=>[t("div",at,[t("div",ot,[s(n,{name:"Star",size:"32",class:"text-yellow-600 dark:text-yellow-400"})]),e[1]||(e[1]=t("div",{class:"flex-1"},[t("h3",{class:"font-semibold text-base text-slate-900 dark:text-white"},"Thai Pass Points"),t("p",{class:"text-xs text-gray-600 dark:text-gray-400 mt-1"},"View your points")],-1)),s(n,{name:"ChevronRight",size:"24",class:"text-gray-400"})])]),_:1})]),_:1}),s(h,{to:"/account/change-password",class:"block group"},{default:l(()=>[s(d,{ui:{body:"p-4 sm:p-6"},class:"hover:shadow-lg transition-shadow"},{default:l(()=>[t("div",rt,[t("div",lt,[s(n,{name:"LockReset",size:"32",class:"text-green-600 dark:text-green-400"})]),e[2]||(e[2]=t("div",{class:"flex-1"},[t("h3",{class:"font-semibold text-base text-slate-900 dark:text-white"},"Change Password"),t("p",{class:"text-xs text-gray-600 dark:text-gray-400 mt-1"},"Update your password")],-1)),s(n,{name:"ChevronRight",size:"24",class:"text-gray-400"})])]),_:1})]),_:1})])]),t("div",null,[e[12]||(e[12]=t("div",{class:"flex items-center justify-between mb-6"},[t("h2",{class:"text-xl sm:text-2xl font-bold uppercase"},"Thai Pass Membership")],-1)),u(S)?(r(),i("div",nt,[(r(),i(b,null,f(1,a=>s(d,{key:a,ui:{body:"p-4 sm:p-6"}},{default:l(()=>[t("div",it,[s(m,{class:"h-4 w-3/4"}),s(m,{class:"h-3 w-1/2"})])]),_:1})),64))])):u(D).length?(r(),i("div",dt,[(r(!0),i(b,null,f(u(D),a=>(r(),v(d,{key:a.id,ui:{body:"p-0"},class:"overflow-hidden"},{default:l(()=>[t("div",ct,[e[8]||(e[8]=t("div",{class:"md:w-1/3 lg:w-1/4 p-4 bg-gradient-to-br from-teal-50 to-blue-50 dark:from-teal-900/20 dark:to-blue-900/20"},[t("img",{loading:"lazy",src:W,alt:"Thai Pass membership",class:"w-full rounded-xl"})],-1)),t("div",ut,[t("div",xt,[t("div",gt,[e[5]||(e[5]=t("div",{class:"flex-1"},[t("h3",{class:"text-lg font-bold text-slate-900 dark:text-white"},"Thai Pass Membership"),t("p",{class:"text-sm text-gray-600 dark:text-gray-400 mt-1"}," Unlock the best discounts for 30 days and elevate your travel experience with our exclusive tourist pass! ")],-1)),s(N,{to:`/account/membership-detail-${a.uuid}`,class:"text-sm py-2 px-3 self-start"},{default:l(()=>[s(n,{name:"Eye",size:"16",class:"mr-1"}),e[4]||(e[4]=p(" Details ",-1))]),_:1},8,["to"])]),t("div",pt,[a.status==="SUCCESS"&&a.expiry_date?(r(),i("span",mt,[e[6]||(e[6]=p(" Valid Until: ",-1)),t("span",yt,c(o.$dateTime(a.expiry_date)),1)])):O("",!0)]),t("div",bt,[e[7]||(e[7]=t("span",{class:"text-sm text-gray-600 dark:text-gray-400"},"Order Amount : ",-1)),t("span",ft,c(u(T)(a.amount,a.currency)),1)])])])])]),_:2},1024))),128))])):(r(),v(d,{key:2,ui:{body:"p-8 sm:p-12"}},{default:l(()=>[t("div",_t,[t("div",ht,[s(n,{name:"CardAccountDetails",size:"64",class:"text-gray-400"})]),t("div",null,[e[11]||(e[11]=t("h3",{class:"text-lg font-semibold text-gray-700 dark:text-gray-300 mb-2"},"No Membership Found",-1)),t("p",kt,[e[10]||(e[10]=p(" You can save up to 50% on activities by booking a ",-1)),s(h,{to:"/pro",class:"text-primary hover:underline inline-flex items-center gap-1"},{default:l(()=>[e[9]||(e[9]=p(" Thai Pass membership ",-1)),s(n,{name:"InformationSlabCircleOutline",size:"15"})]),_:1})])])])]),_:1}))]),t("div",null,[e[17]||(e[17]=t("div",{class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6"},[t("h2",{class:"text-xl sm:text-2xl font-bold uppercase"},"Bookings")],-1)),u(I)?(r(),i("div",vt,[(r(),i(b,null,f(3,a=>s(d,{key:a,ui:{body:"p-4 sm:p-6"}},{default:l(()=>[t("div",wt,[s(m,{class:"h-4 w-3/4"}),s(m,{class:"h-3 w-1/2"}),s(m,{class:"h-3 w-full"})])]),_:1})),64))])):u(E).length?(r(),i("div",Ct,[(r(!0),i(b,null,f(u(E),a=>(r(),v(d,{key:a.id,ui:{body:"p-0"},class:"overflow-hidden hover:shadow-md transition-shadow"},{default:l(()=>[t("div",Et,[t("div",Dt,[s(V,{placeholder:"",loading:"lazy",src:F(a),alt:z(a),class:"w-full h-full lg:aspect-auto aspect-16/10 object-cover rounded-2xl"},null,8,["src","alt"])]),t("div",It,[t("div",St,[t("div",Tt,[t("div",At,[t("div",zt,[t("span",Nt,[p(" ORDER ID : "+c(a.token)+" ",1),s(n,{name:"ContentCopy",size:"14",class:"text-gray-600 dark:text-gray-400 cursor-pointer hover:text-primary dark:hover:text-primary transition-colors",onClick:y=>R(a.token,"Order ID"),title:"Copy Order ID"},null,8,["onClick"])]),t("span",{class:K(["px-2 py-1 rounded-full text-xs font-medium",M(a.booking_status)])},c(a.booking_status),3)]),t("h3",Ot,c(z(a)),1)]),s(N,{to:`/account/booking-detail-${a.token}`,class:"text-sm py-2 px-3 self-start whitespace-nowrap"},{default:l(()=>[s(n,{name:"Eye",size:"16",class:"mr-1"}),e[13]||(e[13]=p(" Details ",-1))]),_:1},8,["to"])]),a.order_item?.length?(r(),i("div",Rt,[(r(!0),i(b,null,f(a.order_item,y=>(r(),i("div",{key:y.id,class:"text-xs sm:text-sm bg-gray-50 dark:bg-gray-800 px-3 py-2 rounded-lg"},[t("span",Mt,c(y.title)+" - "+c(y.name)+" Ã "+c(y.quantity),1)]))),128))])):O("",!0),t("div",Pt,[e[14]||(e[14]=t("span",{class:"text-sm text-gray-600 dark:text-gray-400"},"Order Amount : ",-1)),t("span",Bt,c(u(T)(a.amount,a.currency)),1)])])])])]),_:2},1024))),128))])):(r(),v(d,{key:2,ui:{body:"p-8 sm:p-12"}},{default:l(()=>[t("div",Ft,[t("div",Vt,[s(n,{name:"PackageVariantClosed",size:"64",class:"text-gray-400"})]),e[15]||(e[15]=t("h3",{class:"text-lg font-semibold text-gray-700 dark:text-gray-300"},"No Bookings Found",-1)),e[16]||(e[16]=t("p",{class:"text-sm text-gray-500 dark:text-gray-400"}," You don't have any bookings yet. ",-1))])]),_:1}))])])])}}};export{qt 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.