1import{j as e}from"./vendor-query-DoHIXVj8.js";import{r as c,f as Fe}from"./vendor-react-B1CyA2bu.js";import{s as f,B as U,u as Pe,h as qe,f as ue,n as Me,i as ze,C as Be,e as Oe}from"./index-Cn6nJhWG.js";import{A as $e,b as Ue}from"./avatar-ZZoOyxkM.js";import{B as S}from"./badge-BQ5YkzSG.js";import{D as Ye,f as He,a as Ge,b as We,c as Ke}from"./dialog-BAdzqCSX.js";import{L as k}from"./label-RPqHGtRV.js";import{S as pe}from"./slider-D_S7yPaC.js";import{C as oe}from"./checkbox-pN95hQnK.js";import{a as Ve}from"./index-Fsh_W-mS.js";import{N as Qe}from"./EmptyStates-CC9wceuD.js";import{P as Xe}from"./PullToRefresh-7Hh-M6BY.js";import{u as Je}from"./useSubscription-BnXf106d.js";import{u as Ze}from"./useFeatureAccess-BA-EGnXy.js";import{L as ye,i as es}from"./locationService-XkoNA8Dg.js";import{p as xe}from"./pushNotifications-CoHuiabq.js";import{T as ss,P as ts}from"./TierBadge-D9JxLzN_.js";import{I as as}from"./input-DAbNkcMA.js";import{P as is,a as rs,b as os}from"./popover-DNhg8yeP.js";import{G as ns}from"./globe-BRzwiYVp.js";import{M as ve}from"./map-pin-B1BtCxI6.js";import{R as je}from"./rotate-ccw-DbSTeCvc.js";import{S as ls}from"./search-Dds-mF4T.js";import{L as _e}from"./loader-circle-Lrf5ROOc.js";import{t as O}from"./nativeFeatures-BXXsNFxX.js";import{a as cs,b as V,c as ne,m as $}from"./vendor-motion-BtzdRAwI.js";import{F as ds}from"./filter-DLgdWbs9.js";import{C as ge}from"./calendar-DJPhrUD7.js";import{U as ms}from"./users-DG4jYnw5.js";import"./vendor-supabase-Bxjw3GPQ.js";import"./vendor-ui-Dv9JeOyV.js";import"./index-BuWUcE7h.js";import"./index-DHIvYiq8.js";import"./index-BBjTSBt-.js";import"./index-BhIhkUGe.js";import"./index-CQ5kx8W4.js";import"./index-DzzFT5Tm.js";import"./check-CEjPdstu.js";import"./skeleton-BlYdckzN.js";import"./compass-CcPLoFDB.js";import"./heart-CEw_tAcA.js";import"./sparkles-BK2JkoPv.js";import"./star-CnTIotYq.js";import"./index-BYGYe9DC.js";import"./index-DBsr-h9k.js";import"./chevron-right-DY3uqDpz.js";import"./circle-RuH2O2yw.js";import"./BlockUserDialog-CbOMMjqc.js";import"./textarea-BcrZnnCX.js";import"./select-DRYI-3RU.js";import"./alert-DkhFZhUN.js";import"./crown-BSApa5M1.js";typeof globalThis.require!="function"&&(globalThis.require=function(){return null},window.require=globalThis.require);const hs=({homeLocation:t,browseLocation:j,onBrowseLocationChange:E})=>{const[D,h]=c.useState(!1),[_,N]=c.useState(""),[C,g]=c.useState([]),[T,L]=c.useState(!1),[R,Q]=c.useState([]);c.useEffect(()=>{X()},[]),c.useEffect(()=>{const l=setTimeout(()=>{_.length>=3?A(_):g([])},400);return()=>clearTimeout(l)},[_]);const X=async()=>{try{const{data:l}=await f.from("service_cities").select("id, city, state, country, latitude, longitude").eq("is_active",!0).order("city");Q(l||[])}catch(l){console.error("Error loading service cities:",l)}},A=async l=>{L(!0);try{const P=await ye.searchLocations(l);g(P)}catch{g([])}finally{L(!1)}},Y=l=>{E(l),N(""),g([]),h(!1)},F=()=>{E(null),h(!1)},I=j!==null,o=I?j.city?`${j.city}${j.state?`, ${j.state}`:""}`:"Custom Location":"My Location";return e.jsxs(is,{open:D,onOpenChange:h,children:[e.jsx(rs,{asChild:!0,children:e.jsxs(U,{variant:"outline",size:"sm",className:`flex items-center gap-1.5 rounded-xl border-border/50 ${I?"bg-primary/10 border-primary/30 text-primary":"hover:bg-primary/5"}`,children:[I?e.jsx(ns,{className:"h-4 w-4"}):e.jsx(ve,{className:"h-4 w-4"}),e.jsx("span",{className:"max-w-[120px] truncate text-xs",children:o}),I&&e.jsx(S,{variant:"secondary",className:"ml-0.5 h-4 px-1 text-[10px]",children:"Abroad"})]})}),e.jsx(os,{className:"w-72 p-3",align:"end",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm font-medium",children:"Browse From"}),I&&e.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:F,children:[e.jsx(je,{className:"h-3 w-3 mr-1"}),"Reset"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ls,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"}
1),e.jsx(as,{placeholder:"Search any city...",value:_,onChange:l=>N(l.target.value),className:"pl-8 h-9 text-sm"}),T&&e.jsx(_e,{className:"absolute right-2.5 top-2.5 h-3.5 w-3.5 animate-spin text-muted-foreground"})]}),C.length>0&&e.jsx("div",{className:"border rounded-lg divide-y max-h-36 overflow-y-auto",children:C.map((l,P)=>e.jsxs("button",{onClick:()=>Y(l),className:"w-full p-2 text-left hover:bg-muted transition-colors text-sm",children:[e.jsxs("span",{className:"font-medium",children:[l.city,l.state?`, ${l.state}`:""]}),l.country&&e.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:l.country})]},P))}),C.length===0&&R.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Active Cities"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:R.map(l=>e.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs rounded-full",onClick:()=>Y({latitude:l.latitude,longitude:l.longitude,city:l.city,state:l.state,country:l.country}),children:l.city},l.id))})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Browse profiles as if you were in another city. Distances will be calculated from this location."})]})})]})},fe=t=>t<1?t.toFixed(2):t.toFixed(1),us=t=>t?t<=10?{label:"Nearby",emoji:"ð"}:t<=50?{label:"Close Enough",emoji:"ð§"}:{label:"Abroad",emoji:"âï¸"}:{label:"Unknown",emoji:"ð"},ps=(t,j)=>{if(!t||!j)return 0;let E=0;const D=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];for(const h of D){const _=t[h],N=j[h];if(_&&N)for(const C of _)N.includes(C)&&E++}return E},xs=["hatha","vinyasa","ashtanga","bikram","hot_yoga","yin","restorative","power","iyengar","kundalini","prenatal","aerial"],gs=["just_starting","curious","beginner","intermediate","advanced","instructor"],fs=["dating","friendship","yoga_partner","long_term","casual"],ft=()=>{var ce,de,me,he;const[t,j]=c.useState(null),[E,D]=c.useState(!0),[h,_]=c.useState([]),[N,C]=c.useState([]),[g,T]=c.useState(0),[L,R]=c.useState(!1),[Q,X]=c.useState(null),[A,Y]=c.useState(null),[F,I]=c.useState({}),[o,l]=c.useState({ageRange:[18,65],maxDistance:50,yogaExperience:[],yogaStyles:[],relationshipIntentions:[],practiceIntentions:[],teachingComfort:void 0}),[P,Ne]=c.useState(!1),v=cs(0),we=V(v,[-200,0,200],[-12,0,12]),be=V(v,[-200,-100,0,100,200],[.5,.85,1,.85,.5]),ke=V(v,[0,80,150],[0,.6,1]),Se=V(v,[-150,-80,0],[1,.6,0]),[ys,H]=c.useState(null),le=Fe(),{toast:w}=Pe(),{tier:Ee}=Je(t),Ce=Ze(t),Le=s=>{var d,x,m;const r=[s.display_name,s.age,s.bio,s.location,s.yoga_experience,((d=s.favorite_yoga_styles)==null?void 0:d.length)>0,((x=s.relationship_intentions)==null?void 0:x.length)>0,s.avatar_url||s.primary_photo,((m=s.practice_intentions)==null?void 0:m.length)>0,s.practice_frequency,s.preferred_class_size],i=r.filter(y=>y&&y!=="").length;return Math.round(i/r.length*100)};c.useEffect(()=>{const s=async()=>{const{data:{session:r}}=await f.auth.getSession();r!=null&&r.user&&(j(r.user),await Ie(r.user.id),await J()),D(!1)};es(),s()},[]);const Ie=async s=>{const r=s||(t==null?void 0:t.id);if(r)try{const{data:i}=await f.from("profiles").select("latitude, longitude, max_distance").eq("user_id",r).eq("is_dating_profile",!0).single();if(i!=null&&i.latitude&&(i!=null&&i.longitude))X({latitude:i.latitude,longitude:i.longitude});else{w({title:"Location Required",description:"Please set your location in your profile to discover other users nearby.",variant:"destructive"}),le("/profile");return}}catch(i){console.error("Error loading user location:",i),w({title:"Location Required",description:"Please complete your profile with location information to use discovery features.",variant:"destructive"}),le("/profile")}},J=async()=>{if(t!=null&&t.id)try{const{data:s}=await f.from("matches").select("user1_id, user2_id").or(`user1_id.eq.${t.id},user2_id.eq.${t.id}`),r=new Set([t.id,...(s||[]).flatMap(n=>[n.user1_id,n.user2_id])]),{data:i}=await f.from("profiles").select("latitude, longitude, weekly_availability, favorite_yoga_styles").eq("user_id",t.id).eq("is_dating_profile",!0).single(),{data:d,error:x}=await f.from("profiles").select("*, weekly_availability").eq("is_dating_profile",!0).eq("user_type","member").eq("is_active",!0).not("user_id","in",`(${Array.from(r).join(",")})`).limit(200);if(x){w({title:"Error loading profiles",description:x.message,variant:"destructive"});return}const m=await Promise.all((d||[]).map(async n=>{var K,ie;const{data:p}=await f.from("user_photos").select("photo_url, is_primary").eq("user_id",n.user_id
1).order("is_primary",{ascending:!1}).order("order_index",{ascending:!0});let q;const u=A||i;u!=null&&u.latitude&&(u!=null&&u.longitude)&&n.latitude&&n.longitude&&(q=ye.calculateDistance(u.latitude,u.longitude,n.latitude,n.longitude));const M=ps(i==null?void 0:i.weekly_availability,n.weekly_availability),z=(i==null?void 0:i.favorite_yoga_styles)||[],B=n.favorite_yoga_styles||[],W=z.filter(re=>B.includes(re)),ae=z.length>0&&B.length>0?W.length/Math.max(z.length,B.length):0;return{...n,photos:p||[],primary_photo:((K=p==null?void 0:p.find(re=>re.is_primary))==null?void 0:K.photo_url)||((ie=p==null?void 0:p[0])==null?void 0:ie.photo_url),distance:q,completion_percentage:Le(n),schedule_overlap:M,shared_styles:W,style_compatibility:ae}})),b=[...m.filter(n=>n.primary_photo||n.avatar_url)].sort((n,p)=>{const u=Math.max(0,1-(n.distance??100)/100),M=Math.max(0,1-(p.distance??100)/100),z=(n.schedule_overlap??0)/21,B=(p.schedule_overlap??0)/21,W=n.style_compatibility??0,ae=p.style_compatibility??0,K=u*.4+z*.3+W*.3;return M*.4+B*.3+ae*.3-K});C(b),G(b),await Re(m)}catch(s){console.error("Error fetching profiles:",s)}},Re=async s=>{const r={};for(const i of s)try{const{data:d}=await f.from("subscriptions").select("tier, status").eq("user_id",i.user_id).eq("status","active").single();d&&(r[i.user_id]=d)}catch{console.debug("No subscription info for user:",i.user_id)}I(r)},G=(s=N)=>{let r=s.filter(i=>{var x,m,y;const d=(x=F[i.user_id])==null?void 0:x.tier;return!(Ee!=="wanderlust"&&d==="wanderlust"||i.age&&(i.age<o.ageRange[0]||i.age>o.ageRange[1])||o.yogaExperience.length>0&&i.yoga_experience&&!o.yogaExperience.includes(i.yoga_experience)||o.yogaStyles.length>0&&!((m=i.favorite_yoga_styles)==null?void 0:m.some(n=>o.yogaStyles.includes(n)))||o.relationshipIntentions.length>0&&!((y=i.relationship_intentions)==null?void 0:y.some(n=>o.relationshipIntentions.includes(n))))});_(r),T(0)},De=()=>{l({ageRange:[18,65],maxDistance:50,yogaExperience:[],yogaStyles:[],relationshipIntentions:[],practiceIntentions:[],teachingComfort:void 0}),G(N)},Z=(s,r)=>{const i={...o,[s]:r};l(i),G()},ee=(s,r)=>{const i=o[s],d=i.includes(r)?i.filter(x=>x!==r):[...i,r];Z(s,d)};c.useEffect(()=>{N.length>0&&G()},[o]),c.useEffect(()=>{t!=null&&t.id&&h.length>0&&qe("discovery_viewed",{profiles_shown:Math.min(h.length,50)})},[t==null?void 0:t.id,h.length]),c.useEffect(()=>{t!=null&&t.id&&J()},[A]);const se=c.useCallback(async()=>{var r,i;if(!(t!=null&&t.id)||g>=h.length||L)return;R(!0);const s=h[g];try{console.log("=== STARTING LIKE PROCESS ==="),console.log("Current user ID:",t.id),console.log("Target profile:",s);const{data:d,error:x}=await f.from("profiles").select("is_dating_profile, user_type").eq("user_id",t.id).single();if(x)throw console.error("Error fetching current user profile:",x),x;if(console.log("Current user profile:",d),!(d!=null&&d.is_dating_profile)||(d==null?void 0:d.user_type)!=="member"){w({title:"Access Restricted",description:"Dating features are only available for member accounts with dating profiles.",variant:"destructive"}),R(!1);return}const m=h[g];console.log("Liking profile:",m),console.log("Checking for existing match where other user liked me first...");const{data:y,error:b}=await f.from("matches").select("*").eq("user1_id",m.user_id).eq("user2_id",t.id).maybeSingle();if(b)throw console.error("Error checking existing match:",b),b;if(console.log("Existing match result:",y),y){console.log("=== MUTUAL MATCH DETECTED! ==="),console.log("Updating existing match to mutual");const{error:n}=await f.from("matches").update({user2_liked:!0}).eq("id",y.id);if(n)throw console.error("Error updating match:",n),n;console.log("Match updated successfully - should be mutual now"),ue("like_sent",{mutual:!0}),O("success"),w({title:"ð It's a Match!",description:`You and ${m.display_name} liked each other!`});try{await xe.sendNotification(m.user_id,"ð New Match!",`You and ${((r=t==null?void 0:t.user_metadata)==null?void 0:r.display_name)||"someone"} liked each other!`,{type:"match",matchId:y.id})}catch(p){console.warn("Failed to send push notification:",p)}Me(m.user_id,y.id)}else{console.log("Checking if I already liked this person...");const{data:n,error:p}=await f.from("matches").select("*").eq("user1_id",t.id).eq("user2_id",m.user_id).maybeSingle();if(p)throw console.error("Error checking my existing like:",p),p;if(n)console.log("I already liked this person:",n),w({title:"Already Liked",description:`You've already liked ${m.display_name}. If they like you back, you'll get a match!`});else{console.log("=== CREATING NEW LIKE ==="),console.log("=== CALLING create_match_safe ==="),console.log("User object:",t),console.log("Liked profile object:",m),console.log("Parameters:",{p_user1_id:t.id,p_user2_id:m.user_id,p_user1_liked:!0,p_user2_liked:!1}
1);const{data:q,error:u}=await f.rpc("create_match_safe",{p_user1_id:t.id,p_user2_id:m.user_id,p_user1_liked:!0,p_user2_liked:!1});if(u)throw console.error("=== INSERT ERROR ==="),console.error("Error details:",u),console.error("Error code:",u.code),console.error("Error message:",u.message),console.error("Error hint:",u.hint),console.error("Error details object:",JSON.stringify(u,null,2)),u;console.log("New match created successfully:",q),ue("like_sent",{mutual:!1}),O("light"),w({title:"Like Sent! ð«",description:`You liked ${m.display_name}. If they like you back, you'll get a match!`});try{await xe.sendNotification(m.user_id,"ð Someone likes you!",`${((i=t==null?void 0:t.user_metadata)==null?void 0:i.display_name)||"Someone"} is interested in connecting with you!`,{type:"like",fromUserId:t.id})}catch(M){console.warn("Failed to send like notification:",M)}ze(m.user_id)}}T(n=>n+1),console.log("=== LIKE PROCESS COMPLETED ===")}catch(d){console.error("Error handling like:",d),w({title:"Error",description:`Failed to process like: ${d instanceof Error?d.message:"Unknown error"}`,variant:"destructive"})}finally{R(!1)}},[t,g,h,L,w]),te=c.useCallback(()=>{g>=h.length||(O("selection"),T(s=>s+1))},[g,h.length]),Te=c.useCallback((s,r)=>{const x=r.offset.x>100||r.velocity.x>500,m=r.offset.x<-100||r.velocity.x<-500;x?(H("right"),O("success"),ne(v,400,{type:"spring",duration:.4}).then(()=>{se(),v.set(0),H(null)})):m?(H("left"),O("light"),ne(v,-400,{type:"spring",duration:.4}).then(()=>{te(),v.set(0),H(null)})):ne(v,0,{type:"spring",stiffness:500,damping:30})},[se,te,v]);if(E)return e.jsxs("div",{className:"space-y-6 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("div",{className:"h-8 w-40 bg-muted animate-pulse rounded"}),e.jsx("div",{className:"h-10 w-24 bg-muted animate-pulse rounded-md"})]}),e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsx(Ve,{className:"aspect-[3/4]"})})}),e.jsxs("div",{className:"flex justify-center gap-4 mt-6",children:[e.jsx("div",{className:"w-16 h-16 bg-muted animate-pulse rounded-full"}),e.jsx("div",{className:"w-16 h-16 bg-muted animate-pulse rounded-full"})]})]});const a=h[g],Ae=async()=>{await J()};return e.jsx(Xe,{onRefresh:Ae,className:"min-h-full overflow-x-hidden",children:e.jsxs("div",{className:"space-y-4 px-3 sm:px-4 pb-[calc(1.5rem+env(safe-area-inset-bottom,0px))] overflow-x-hidden",children:[e.jsxs("div",{className:"space-y-3 mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h1",{className:"section-header leading-tight",children:"Discover Yogis"}),e.jsxs("div",{className:"shrink-0 text-xs sm:text-sm text-muted-foreground",children:[h.length-g," left"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[Ce.hasAccess("browse_location")&&e.jsx("div",{className:"min-w-0 max-w-full",children:e.jsx(hs,{homeLocation:Q,browseLocation:A,onBrowseLocationChange:s=>{Y(s)}})}),e.jsxs(Ye,{open:P,onOpenChange:Ne,children:[e.jsx(He,{asChild:!0,children:e.jsxs(U,{variant:"outline",size:"sm",className:"flex items-center gap-2 rounded-xl border-border/50 hover:bg-primary/5",children:[e.jsx(ds,{className:"h-4 w-4"}),"Filters",(o.yogaExperience.length>0||o.yogaStyles.length>0||o.relationshipIntentions.length>0||o.ageRange[0]>18||o.ageRange[1]<65||o.maxDistance<50)&&e.jsx(S,{variant:"secondary",className:"ml-1 h-5 w-5 p-0 text-xs",children:[...o.yogaExperience,...o.yogaStyles,...o.relationshipIntentions].length+(o.ageRange[0]>18||o.ageRange[1]<65?1:0)+(o.maxDistance<50?1:0)})]})}),e.jsxs(Ge,{className:"max-w-md max-h-[80vh] overflow-y-auto",children:[e.jsx(We,{children:e.jsxs(Ke,{className:"flex items-center justify-between",children:["Advanced Filters",e.jsxs(U,{variant:"ghost",size:"sm",onClick:De,children:[e.jsx(je,{className:"h-4 w-4 mr-1"}),"Reset"]})]})}),e.jsxs("div",{className:"space-y-6 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(k,{children:["Age Range: ",o.ageRange[0]," - ",o.ageRange[1]]}),e.jsx(pe,{value:o.ageRange,onValueChange:s=>Z("ageRange",s),min:18,max:65,step:1,className:"w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(k,{children:["Max Distance: ",o.maxDistance," miles"]}),e.jsx(pe,{value:[o.maxDistance],onValueChange:s=>Z("maxDistance",s[0]),min:5,max:100,step:5,className:"w-full"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(k,{children:"Yoga Experience"}),e.jsx("div",{className:"space-y-2",children:gs.map(s=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(oe,{id:s,checked:o.yogaExperience.includes(s),onCheckedChange:()=>ee("yogaExperience",s)}),e.jsx(k,{htmlFor:s,className:"capitalize cursor-pointer",children:s})]},s))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(k,{children:"Yoga Styles"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:xs.map(s=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(oe,{id:s,checked:o.yogaStyles.includes(s),onCheckedChange:()=>ee("yogaStyles",s)}),e.jsx(k,{htmlFor:s,className:"capitalize cursor-pointer text-sm",children:s.replace("_"," ")})]},s))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(k,{children:"Looking For"}),e.jsx("div",{className:"space-y-2",children:fs.map(s=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(oe,{id:s,checked:o.relationshipIntentions.includes(s),onCheckedChange:()=>ee("relationshipIntentions",s)}),e.jsx(k,{htmlFor:s,className:"capitalize cursor-pointer",children:s.replace("_"," ")})]},s))})]})]})]})]})]})]}),e.jsx("div",{className:"max-w-lg mx-auto",children:a?e.jsxs("div",{className:"space-y-6 relative overflow-x-hidden",children:[e.jsx("div",{className:"relative overflow-hidden",children:e.jsxs($.div,{drag:"x",dragConstraints:{left:0,right:0},dragElastic:.9,onDragEnd:Te,style:{x:v,rotate:we,opacity:be},className:"cursor-grab active:cursor-grabbing",whileTap:{scale:.98},children:[e.jsxs(Be,{className:"overflow-hidden card-dimensional shadow-elegant select-none will-change-transform",children:[e.jsxs("div",{className:"relative h-[36vh] min-h-[200px] max-h-[280px] sm:h-[44vh] sm:max-h-[360px] md:h-[55vh] md:max-h-[450px] bg-gradient-subtle",children:[a.primary_photo||a.avatar_url?e.jsx("img",{src:a.primary_photo||a.avatar_url,alt:a.display_name,className:"w-full h-full object-cover"}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx($e,{className:"h-24 w-24 sm:h-32 sm:w-32",children:e.jsx(Ue,{className:"text-3xl sm:text-4xl",children:(ce=a.display_name)==null?void 0:ce.charAt(0)})})}),a.completion_percentage&&a.completion_percentage<100&&e.jsxs("div",{className:"absolute top-3 left-3 sm:top-4 sm:left-4 bg-black/70 text-white px-3 py-1 rounded-full text-xs flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-300",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-primary transition-all duration-300",style:{width:`${a.completion_percentage}%`}})}),a.completion_percentage,"% complete"]}),a.photos&&a.photos.length>1&&e.jsxs("div",{className:"absolute top-3 right-3 sm:top-4 sm:right-4 bg-black/60 text-white px-2 py-1 rounded-full text-xs",children:["1/",a.photos.length]}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-3 sm:p-4 pt-12 sm:pt-16",children:e.jsxs("div",{className:"flex items-end justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-xl sm:text-2xl font-bold text-white truncate",children:a.display_name||"Anonymous Yogi"}),((de=F[a.user_id])==null?void 0:de.tier)&&e.jsx(ss,{tier:F[a.user_id].tier,size:"sm",showLabel:!1})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs sm:text-sm text-white/90",children:[a.age&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ge,{className:"h-3.5 w-3.5"}),a.age]}),a.location&&e.jsxs("span",{className:"flex items-center gap-1 truncate max-w-[120px] sm:max-w-[180px]",children:[e.jsx(ve,{className:"h-3.5 w-3.5 shrink-0"}),a.location]}),(()=>{const s=us(a.distance);return e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs",children:s.emoji}),s.label,a.distance!=null&&e.jsxs("span",{className:"text-white/60",children:["(",fe(a.distance)," mi)"]})]})})(),(a.schedule_overlap??0)>0&&e.jsxs("span",{className:"flex items-center gap-1 text-emerald-300",children:[e.jsx(ge,{className:"h-3.5 w-3.5"}),a.schedule_overlap,"/21 match"]})]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(ts,{targetUserId:a.user_id,targetUserName:a.display_name})})]})})]}
1),e.jsxs(Oe,{className:"p-4 sm:p-6 md:p-8 space-y-4 sm:space-y-5",children:[a.bio&&e.jsx("p",{className:"text-muted-foreground text-sm sm:text-base leading-relaxed",children:a.bio}),e.jsxs("div",{className:"flex items-center justify-center gap-8 py-3",children:[e.jsxs($.button,{onClick:te,whileHover:{scale:1.15},whileTap:{scale:.9},className:"relative h-16 w-16 rounded-full flex items-center justify-center bg-background border-2 border-muted-foreground/20 shadow-lg hover:shadow-xl transition-shadow",children:[e.jsx("span",{className:"text-2xl",role:"img","aria-label":"Pass",children:"ð"}),e.jsx("span",{className:"absolute -bottom-5 text-[10px] text-muted-foreground font-medium tracking-wide uppercase",children:"Pass"})]}),e.jsxs($.button,{onClick:se,disabled:L,whileHover:{scale:1.15},whileTap:{scale:.9},className:"relative h-20 w-20 rounded-full flex items-center justify-center bg-gradient-primary shadow-xl hover:shadow-2xl transition-shadow disabled:opacity-50",children:[L?e.jsx(_e,{className:"h-7 w-7 animate-spin text-primary-foreground"}):e.jsx("span",{className:"text-3xl",role:"img","aria-label":"Connect",children:"ð"}),e.jsx("span",{className:"absolute -bottom-5 text-[10px] text-primary font-medium tracking-wide uppercase",children:"Namaste"})]})]}),a.yoga_experience&&e.jsxs("div",{children:[e.jsxs("h4",{className:"font-semibold mb-2 sm:mb-3 flex items-center gap-2 text-base sm:text-lg",children:[e.jsx(ms,{className:"h-4 w-4 sm:h-5 sm:w-5"}),"Yoga Experience"]}),e.jsx(S,{variant:"secondary",className:"capitalize text-sm sm:text-base px-3 sm:px-4 py-1.5 sm:py-2",children:a.yoga_experience})]}),a.favorite_yoga_styles&&a.favorite_yoga_styles.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 sm:mb-3 text-base sm:text-lg",children:"Favorite Yoga Styles"}),e.jsx("div",{className:"flex flex-wrap gap-2 sm:gap-3",children:a.favorite_yoga_styles.map((s,r)=>e.jsx(S,{variant:"outline",className:"capitalize text-sm sm:text-base px-3 sm:px-4 py-1.5 sm:py-2",children:s},r))})]}),a.relationship_intentions&&a.relationship_intentions.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2 sm:mb-3 text-base sm:text-lg",children:"Looking For"}),e.jsx("div",{className:"flex flex-wrap gap-2 sm:gap-3",children:a.relationship_intentions.map((s,r)=>e.jsx(S,{variant:"secondary",className:"capitalize text-sm sm:text-base px-3 sm:px-4 py-1.5 sm:py-2",children:s.replace("_"," ")},r))})]}),((a.schedule_overlap??0)>0||a.distance||(((me=a.shared_styles)==null?void 0:me.length)??0)>0)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground bg-muted/40 rounded-xl px-3 py-2",children:[e.jsx("span",{className:"font-medium text-foreground/70",children:"Why this match:"}),a.distance!=null&&e.jsxs(S,{variant:"outline",className:"text-xs px-2 py-0.5",children:["ð ",fe(a.distance)," mi away"]}),(((he=a.shared_styles)==null?void 0:he.length)??0)>0&&e.jsxs(S,{variant:"outline",className:"text-xs px-2 py-0.5 border-primary/30 text-primary",children:["ð§ ",a.shared_styles.length," shared style",a.shared_styles.length>1?"s":""]}),(a.schedule_overlap??0)>0&&e.jsxs(S,{variant:"outline",className:"text-xs px-2 py-0.5",children:["ð ",a.schedule_overlap,"/21 schedule match"]})]})]})]}),e.jsx($.div,{className:"absolute inset-0 pointer-events-none z-10 flex items-center justify-center",style:{opacity:ke},children:e.jsx("div",{className:"bg-emerald-500/90 backdrop-blur-sm px-8 py-4 rounded-2xl text-2xl font-bold text-white shadow-lg rotate-12",children:"LIKE â¤ï¸"})}),e.jsx($.div,{className:"absolute inset-0 pointer-events-none z-10 flex items-center justify-center",style:{opacity:Se},children:e.jsx("div",{className:"bg-destructive/90 backdrop-blur-sm px-8 py-4 rounded-2xl text-2xl font-bold text-white shadow-lg -rotate-12",children:"PASS âï¸"})})]})}),e.jsx("div",{className:"text-center text-sm text-muted-foreground pt-4",children:e.jsx("p",{className:"flex items-center justify-center gap-2",children:"â Swipe left to pass ⢠Swipe right to like â"})})]}):e.jsx(Qe,{})})]})})};export{ft 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.