PageSourceSearch

https://rubpage.com/assets/MembershipPage-O6RePEBW.js

js rubpage.com collected 2026-09-25 06:31:32 UTC 9,364 bytes, 6 lines download raw bytes

1import{j as e}from"./vendor-query-nkyHp8gL.js";import{r as h,L as p}from"./vendor-react-BNT0nzvx.js";import{D as k}from"./DashboardLayout-BQArLa03.js";import{a as P,b as C,M as u}from"./use-membership-YLjjDefL.js";import{u as A}from"./use-wallet-CBCFWIrN.js";import{W as D,h as M,i as E,X as B,B as f,n as g,r as $}from"./index-BG1hbjB_.js";import{B as b}from"./badge-Cu86KUYW.js";import{c as L}from"./use-role-guard-DUkhNAMS.js";import{A as _,a as F,b as S,c as R,d as I,e as O,f as T,g as V}from"./alert-dialog-B5uVNgde.js";import{C as W}from"./crown-CsNa2Jyx.js";import{C as z}from"./circle-check-big-gRsZtbUu.js";import{C as j}from"./check-YdSavKRT.js";import{L as U}from"./lock-D3JPNhoF.js";import{N as G}from"./newspaper-CxHmHB1y.js";import{E as Y}from"./eye-CbHUV7pU.js";import"./input-otp-BmijqesX.js";import"./shield-check-BjMYzFta.js";import"./shield-D2cqmhBs.js";import"./chevron-right-Bjkf53ML.js";import"./mail-check-D7o3uZkb.js";import"./users-qXgsJLD-.js";import"./target-DCR3Hpgj.js";import"./list-CCtzf_Gh.js";import"./flag-BAn4BLiN.js";import"./vendor-ui-DPPUfW-O.js";import"./vendor-charts-B_MCcq71.js";import"./vendor-supabase-BRDBMtg7.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const q=D("BadgePercent",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 15h.01",key:"lqbp3k"}]]),H=[{icon:U,title:"Unlock Private Photos",desc:"View all locked gallery images that free users can't see"},{icon:$,title:"Write & Read Reviews",desc:"Rate providers and read what other members think before booking"},{icon:G,title:"Exclusive Provider Feed",desc:"Get real-time updates, photos & announcements directly from providers"},{icon:Y,title:"Early Access to New Listings",desc:"See newly activated listings before they appear for everyone else"}],X=[{feature:"Browse listings & contact info",free:!0,member:!0},{feature:"View public photos",free:!0,member:!0},{feature:"Unlock private / premium photos",free:!1,member:!0},{feature:"Write reviews & star ratings",free:!1,member:!0},{feature:"Read all member reviews",free:!1,member:!0},{feature:"Access exclusive provider feed",free:!1,member:!0},{feature:"Early access to new listings",free:!1,member:!0}],Z=()=>{M();const{data:r,isLoading:J}=P(),{data:l}=A(),i=C(),{toast:c}=E(),[N,d]=h.useState(null),[t,o]=h.useState(null),v=async()=>{if(t){d(t),o(null);try{await i.mutateAsync(t),c({title:"Membership activated!",description:"Enjoy your premium benefits."})}catch(s){c({title:"Purchase failed",description:s.message,variant:"destructive"})}finally{d(null)}}},a=t?u.find(s=>
6s.key===t):null,m=r?r.plan==="lifetime"?1/0:Math.max(0,Math.ceil((new Date(r.expires_at).getTime()-Date.now())/864e5)):0;return e.jsx(k,{children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-2xl bg-primary/10 mb-4",children:e.jsx(W,{className:"w-7 h-7 text-primary"})}),e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:"Get More From Every Visit"}),e.jsx("p",{className:"text-muted-foreground max-w-lg mx-auto",children:"Unlock private photos, write reviews, access the exclusive feed, and see new listings first — all with a single one-time payment."})]}),r&&e.jsxs("div",{className:"mb-8 p-5 rounded-xl bg-primary/5 border border-primary/20",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(z,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Your Membership is Active"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Plan"}),e.jsx("p",{className:"font-medium text-foreground capitalize",children:r.plan})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Expires"}),e.jsx("p",{className:"font-medium text-foreground",children:r.plan==="lifetime"?"Never":new Date(r.expires_at).toLocaleDateString()})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-muted-foreground",children:"Days Remaining"}),e.jsx("p",{className:"font-medium text-foreground",children:m===1/0?"∞":m})]})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-10",children:H.map(s=>e.jsxs("div",{className:"flex items-start gap-4 p-5 rounded-xl border border-border bg-card hover:border-primary/30 transition-colors",children:[e.jsx("div",{className:"shrink-0 w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:e.jsx(s.icon,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground text-sm",children:s.title}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s.desc})]})]},s.title))}),e.jsxs("div",{className:"mb-10 rounded-xl border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"grid grid-cols-[1fr_80px_80px] sm:grid-cols-[1fr_100px_100px] text-xs font-semibold text-muted-foreground border-b border-border",children:[e.jsx("div",{className:"p-3 sm:p-4",children:"Feature"}),e.jsx("div",{className:"p-3 sm:p-4 text-center",children:"Free"}),e.jsx("div",{className:"p-3 sm:p-4 text-center text-primary",children:"Member"})]}),X.map((s,n)=>e.jsxs("div",{className:`grid grid-cols-[1fr_80px_80px] sm:grid-cols-[1fr_100px_100px] text-sm ${n%2===0?"bg-secondary/20":""}`,children:[e.jsx("div",{className:"p-3 sm:p-4 text-foreground",children:s.feature}),e.jsx("div",{className:"p-3 sm:p-4 flex justify-center",children:s.free?e.jsx(j,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(B,{className:"w-4 h-4 text-muted-foreground/40"})}),e.jsx("div",{className:"p-3 sm:p-4 flex justify-center",children:e.jsx(j,{className:"w-4 h-4 text-primary"})})]},s.feature))]}),e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"text-xl font-bold text-foreground",children:"Choose Your Plan"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"One-time payment · N
6o subscriptions · No auto-renewals"})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-4 mb-2",children:u.map(s=>{const n=N===s.key,y=Number(l?.balance??0)>=s.price,w=s.key==="lifetime",x=s.key==="annual";return e.jsxs("div",{className:`relative p-5 rounded-xl border bg-card transition-all hover:shadow-md ${w?"border-primary ring-1 ring-primary/20":x?"border-primary/50":"border-border"}`,children:[s.discount>0&&e.jsxs(b,{className:"absolute -top-2.5 right-3 bg-primary text-primary-foreground text-[10px]",children:[e.jsx(q,{className:"w-3 h-3 mr-0.5"}),s.discount,"% off"]}),x&&e.jsx(b,{className:"absolute -top-2.5 left-3 bg-accent text-accent-foreground text-[10px]",children:"Best Value"}),e.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:s.label}),e.jsxs("p",{className:"text-3xl font-bold text-foreground mb-0.5",children:["$",s.price]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:s.months===0?"One-time · Forever":`${s.months} month${s.months>1?"s":""} · ${s.perMonth}/mo`}),y?e.jsx(f,{size:"sm",className:"w-full",disabled:n||i.isPending,onClick:()=>o(s.key),children:n?e.jsx(g,{className:"w-4 h-4 animate-spin"}):r?"Extend":"Get Access"}):e.jsx(f,{size:"sm",className:"w-full",variant:"outline",asChild:!0,children:e.jsx(p,{to:"/dashboard/wallet",children:"Top Up Wallet"})})]},s.key)})}),e.jsxs("p",{className:"text-xs text-muted-foreground text-center mt-4 mb-2",children:["Balance: ",e.jsxs("span",{className:"font-medium",children:["$",Number(l?.balance??0).toFixed(2)]})," ·"," ",e.jsx(p,{to:"/dashboard/wallet",className:"underline hover:text-foreground",children:"Top up wallet"})]}),e.jsx(_,{open:!!t,onOpenChange:s=>!s&&o(null),children:e.jsxs(F,{children:[e.jsxs(S,{children:[e.jsxs(R,{children:["Confirm ",r?"Extension":"Purchase"]}),e.jsx(I,{asChild:!0,children:e.jsxs("div",{children:[e.jsxs("p",{className:"mb-3",children:[r?"Extend":"Activate"," the ",e.jsx("strong",{children:a?.label})," plan?"]}),e.jsxs("div",{className:"flex items-center justify-between text-sm p-2 rounded bg-secondary/30",children:[e.jsx("span",{children:"Cost"}),e.jsxs("span",{className:"font-semibold",children:["$",a?.price]})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm p-2",children:[e.jsx("span",{children:"Duration"}),e.jsx("span",{className:"font-semibold",children:(a?.months??0)===0?"Forever":`${a?.months} month${(a?.months??0)>1?"s":""}`})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm p-2 rounded bg-secondary/30",children:[e.jsx("span",{children:"Your balance"}),e.jsxs("span",{className:"font-semibold",children:["$",Number(l?.balance??0).toFixed(2)]})]})]})})]}),e.jsxs(O,{children:[e.jsx(T,{children:"Cancel"}),e.jsxs(V,{onClick:v,disabled:i.isPending,children:[i.isPending?e.jsx(g,{className:"w-4 h-4 animate-spin mr-2"}):null,"Confirm — $",a?.price]})]})]})})]})})},Ce=L(Z);export{Ce 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.