1import{r as N,j as e}from"./index-C86y2ZZw.js";import{J as fs,P as gs,Q as ys,u as $,U as js,z as v,V as A,W as ss,i as w,X as B,Y as M,n as G,B as z,Z as rs,S as ce,d as W,_ as I,G as me,$ as Ns,M as D,j as ye,a0 as as}from"./App-BsV2Qj_s.js";import{i as _s}from"./useMembershipCatalog-CdFep5ea.js";import{u as vs}from"./useLapsedMembership-BGWIJZz4.js";import{T as ws,a as Cs,b as je,c as Ne}from"./tabs-CCb_Hfd7.js";import{s as k}from"./client-DMrl-iUj.js";import{S as pe}from"./StoreLayout-CZyNOO8t.js";import{u as ks,C as _e}from"./CheckoutFlow-DzpA-Wav.js";import{u as Ss}from"./useAbonoEligibility-CQ5j8gqe.js";import{u as qs}from"./useAddonBenefitEligibility-6xDIetKf.js";import{r as As}from"./sectorLinks-Dw4i-xEO.js";import"./checkbox-DGvc0ATb.js";import"./CiDocumentFields-Dr-zLn1q.js";import"./zod-DFraYATz.js";import"./banknote-j7y0gmGQ.js";import"./PaymentMethodSelector-Cm_tlX0G.js";import"./alert-MODGBXRs.js";import"./useBackofficeInstallmentMethods-JKxozCW2.js";import"./backofficeMethodFamily-DLAcB4VI.js";import"./qr-code-CuDlW3Q3.js";import"./smartphone-DbBhYMr6.js";import"./PaymentWaitingOverlay-B2HRGqTr.js";import"./html2canvas.esm-CBrSDip1.js";import"./package-C0GiUUsi.js";import"./circle-x-CycC-034.js";import"./download-Bzf4CL-Y.js";import"./copy-DChoOhGz.js";import"./SeatsioChart-DuALRzkE.js";import"./index-BMXkkWuo.js";import"./useSeatsioRegion-Bf3Q6CAk.js";import"./user-check-Hqg2eLzG.js";import"./circle-check-big-CNw0Fhj2.js";import"./membershipColors-Nd-0iU3_.js";import"./overdueCheck-retMLXFc.js";const Ps=["sociedades","combos","abonos"];function pr(){var Me,Ie,Oe,Ye,Ue,Ge,We,De,Ee,Qe,He,Je,Xe,Ze,es;const[ee,Ls]=fs(),ts=(()=>{const s=ee.get("tab");if(s&&Ps.includes(s))return s;const r=window.location.pathname;return r.includes("/combos")?"combos":r.includes("/abonos")?"abonos":"sociedades"})(),ve=ks(),se=N.useCallback(s=>gs(s??{},ve),[ve]),[os,is]=N.useState(ts),R=N.useCallback(s=>{is(r=>{if(r===s)return r;const o=new URLSearchParams(window.location.search);return o.set("tab",s),window.history.replaceState(null,"",`${window.location.pathname}?${o.toString()}`),s})},[]),[xe,we]=N.useState(null);N.useState(null);const[re,J]=N.useState(null),[ae,Ce]=N.useState(null),[P,ue]=N.useState(null),[L,te]=N.useState(null),[S,he]=N.useState(null),[ke,oe]=N.useState(null),{activeProfileId:_,isLoading:Se}=ys(),{data:n,isLoading:qe}=$({queryKey:["store-seasons-info"],queryFn:async()=>{const{data:s}=await k.from("seasons").select("id, name, start_date, end_date").eq("is_current",!0).maybeSingle();let r=null,o=null;if(s){const{data:i}=await k.from("seasons").select("id, name, start_date, end_date").gt("start_date",s.end_date).order("start_date",{ascending:!0}).limit(2);r=(i==null?void 0:i[0])??null,o=(i==null?void 0:i[1])??null}return{current:s,next:r,following:o}}}),{data:ns}=$({queryKey:["store-anticipated-next",_,(Me=n==null?void 0:n.next)==null?void 0:Me.id],enabled:!!_&&!!((Ie=n==null?void 0:n.next)!=null&&Ie.id),queryFn:async()=>{const{data:s}=await k.from("memberships").select("id").eq("family_profile_id",_).eq("season_id",n.next.id).eq("is_deleted",!1).not("socio_subscription_type_id","is",null).in("status",["active","overdue","renewed","prospect","in_advance","holding","pending"]).limit(1);return((s==null?void 0:s.length)??0)>0}}),{data:c,isLoading:X}=$({queryKey:["store-active-socio",_,(Oe=n==null?void 0:n.current)==null?void 0:Oe.id],enabled:!!_&&!!((Ye=n==null?void 0:n.current)!=null&&Ye.id),queryFn:async()=>{const{data:s}=await k.from("memberships").select("id, socio_subscription_type_id, end_date, status, paid_amount, mt:subscription_types!memberships_socio_subscription_type_id_fkey(name, slug, border_color)").eq("family_profile_id",_).or(`season_id.eq.${n.current.id},season_id.is.null`).eq("is_deleted",!1).in("status",["active","overdue","renewed"]).gt("paid_amount",0).not("socio_subscription_type_id","is",null).order("end_date",{ascending:!1}).limit(1).maybeSingle();return s}}),{data:ie,isLoading:Ae}=vs(),Pe=N.useRef(!1);N.useEffect(()=>{if(Pe.current||X||Ae)return;
1const s=(c==null?void 0:c.socio_subscription_type_id)??(ie==null?void 0:ie.typeId)??null;s&&J(s),Pe.current=!0},[c,ie,X,Ae]),N.useEffect(()=>{de(!1)},[_]);const q=ns?(n==null?void 0:n.following)??null:(n==null?void 0:n.next)??null,F=((Ge=(Ue=q==null?void 0:q.name)==null?void 0:Ue.match(/\d{4}/))==null?void 0:Ge[0])??(q!=null&&q.start_date?new Date(q.start_date).getUTCFullYear().toString():null),C=!!c,{data:x,isLoading:ls}=$({queryKey:["store-current-socio-unpaid-installments",_,c==null?void 0:c.id],enabled:!!_&&!!(c!=null&&c.id),queryFn:async()=>{const s=new Date().toISOString().slice(0,10),{data:r,error:o}=await k.from("payment_schedule").select("id, amount, due_date, status, membership_id").eq("family_profile_id",_).eq("membership_id",c.id).in("status",["pending","processing","overdue"]);if(o)return{count:0,total:0,overdueCount:0,overdueTotal:0,nextDueDate:null};const i=r||[],d=i.reduce((m,t)=>m+Number(t.amount||0),0),u=i.filter(m=>m.due_date&&m.due_date<=s),a=u.reduce((m,t)=>m+Number(t.amount||0),0),l=i.map(m=>m.due_date).filter(Boolean).sort()[0]||null;return{count:i.length,total:d,overdueCount:u.length,overdueTotal:a,nextDueDate:l}}}),Le=((x==null?void 0:x.count)??0)>0,Te=((x==null?void 0:x.overdueCount)??0)>0,{data:Fe,isLoading:ds}=$({queryKey:["store-combo-completed",_,(We=n==null?void 0:n.current)==null?void 0:We.id,c==null?void 0:c.id],enabled:!!_&&!!((De=n==null?void 0:n.current)!=null&&De.id)&&!X,queryFn:async()=>{const{data:s}=await k.from("memberships").select("id").eq("family_profile_id",_).eq("season_id",n.current.id).eq("is_deleted",!1).in("status",["active","overdue"]).not("socio_subscription_type_id","is",null).not("combo_subscription_type_id","is",null).limit(1).maybeSingle();if(s)return!0;if(!(c!=null&&c.id))return!1;const{data:r}=await k.from("memberships").select("id, st:subscription_types!memberships_subscription_type_id_fkey(is_addon_benefit)").eq("parent_membership_id",c.id).eq("is_deleted",!1).neq("status","cancelled");return(r??[]).some(o=>{var i;return((i=o.st)==null?void 0:i.is_addon_benefit)!==!0})}}),E=js(),{data:p}=Ss(_),ne=new Map(((p==null?void 0:p.availableSubscriptions)??[]).map(s=>[s.id,s.memberPrice])),O=!!(p!=null&&p.eligible),cs=(p==null?void 0:p.parentMembershipId)??void 0;ee.get("socio_benefit");const{data:f}=qs(_),le=(f==null?void 0:f.abonoBenefits)??[],[ms,ps]=N.useState(!1),[$e,de]=N.useState(!1),Z=O&&!ms,ze=Se||!!_&&(qe||X||!!(c!=null&&c.id)&&ls),Ve=ze?{title:"Verificando cuotas de tu sociedad actual",reason:"Estamos validando que no existan cuotas pendientes antes de habilitar el pago de una nueva membresÃa de Socio."}:Le?{title:"Tienes cuotas pendientes de tu sociedad actual",reason:`Cuentas con ${x==null?void 0:x.count} cuota${((x==null?void 0:x.count)??0)>1?"s":""} pendiente${((x==null?void 0:x.count)??0)>1?"s":""} de tu membresÃa vigente por un total de Bs ${Number((x==null?void 0:x.total)||0).toFixed(2)}. Para adquirir una nueva membresÃa de Socio (Celeste, Dorado o Platino), o un Combo que incluya sociedad, primero debes completar los pagos de la gestión y sociedad actual.`,ctaLabel:"Ir a mis pagos",onCta:()=>E("/pagos/socios")}:null,xs=ze?{title:"Verificando tu sociedad actual",reason:"Estamos validando tu sociedad vigente antes de habilitar el pago del combo."}:C&&!Le?{title:"Los Combos no se venden de forma anticipada",reason:`Ya cuentas con una sociedad vigente para ${((Ee=n==null?void 0:n.current)==null?void 0:Ee.name)??"la temporada actual"}. Los Combos incluyen un Abono y los Abonos solo se pueden adquirir para la temporada vigente. Puedes comprar tu Sociedad anticipada para ${F??"la próxima temporada"} desde la pestaña âSociedadesâ, o adquirir un Abono a precio normal desde la pestaña âAbonosâ para la temporada actual.`,ctaLabel:"Ver abonos",onCta:()=>{ue(null),R("abonos")}}:Ve,be=s=>r=>s(r),{data:b,isLoading:us}=$({queryKey:["store-membership-types"],queryFn:async()=>{const{data:s,error:r}=await k.from("subscription_types").select("*").eq("is_active",!0).eq("product_type","sociedad").eq("is_addon_benefit",!1).or("legacy_status.is.null,legacy_status.neq.closed").order("sort_order");if(r)throw r;return(s??[]).map(o=>({...o,code:as(o.slug),price_annual:o.base_price,border_color:o.border_color??null,banner_url:o.banner_url,benefits:o.benef
1its??o.includes??[]}))}}),{data:V,isLoading:hs}=$({queryKey:["store-combos-full"],queryFn:async()=>{const[s,r]=await Promise.all([k.from("membership_combos").select("*, socio:subscription_types!membership_combos_socio_subscription_type_id_fkey(id, name, slug, base_price, border_color, banner_url, benefits, includes, has_physical_credential, physical_credential_cost, is_active, product_type, show_on_web, visibility_channels), abono:subscription_types!membership_combos_subscription_type_id_fkey(id, name, base_price, price_usd, currency, slug, includes, is_premium, has_physical_credential, physical_credential_cost, is_active, is_addon_benefit, product_type, show_on_web, visibility_channels)").eq("is_active",!0).eq("show_on_web",!0).order("sort_order"),k.from("v_store_combos").select("id, total_price, socio_price, abono_price")]);if(s.error)throw s.error;if(r.error)throw r.error;const o=new Map;for(const i of r.data||[])o.set(i.id,{total_price:Number(i.total_price??0),socio_price:Number(i.socio_price??0),abono_price:Number(i.abono_price??0)});return(s.data||[]).filter(i=>{const d=i.socio,u=i.abono;if(!d||!u||d.is_active===!1||u.is_active===!1||u.is_addon_benefit===!0||u.product_type&&u.product_type!=="abono"||d.product_type&&d.product_type!=="sociedad")return!1;const a=l=>{if(l.show_on_web===!1)return!1;const m=Array.isArray(l.visibility_channels)?l.visibility_channels:[];return m.length===0||m.includes("web")};return!(!a(d)||!a(u))}).map(i=>{var u,a;const d=o.get(i.id)??{total_price:0,socio_price:0,abono_price:0};return{...i,total_price:d.total_price,socio_price:d.socio_price,abono_price:d.abono_price,socio:{...i.socio,code:as((u=i.socio)==null?void 0:u.slug),price_annual:d.socio_price,border_color:((a=i.socio)==null?void 0:a.border_color)??null},subscription_types:i.abono}})}}),{data:fe,isLoading:bs}=$({queryKey:["store-subscription-types"],queryFn:async()=>{const{data:s,error:r}=await k.from("subscription_types").select("*").eq("is_active",!0).eq("product_type","abono").eq("is_addon_benefit",!1).eq("show_on_web",!0).or("legacy_status.is.null,legacy_status.neq.closed").order("sort_order");if(r)throw r;return(s??[]).map(o=>({...o,__standardAbono:_s(o.category)}))}}),{data:K}=$({queryKey:["store-sectors"],queryFn:async()=>{const{data:s,error:r}=await k.from("sectors").select("id, name, has_seats, seatsio_event_key, seatsio_season_key, seats_chart_key, venue, parent_sector_id").eq("is_active",!0).order("sort_order");if(r)throw r;return s}}),{data:Be}=$({queryKey:["seatsio-workspace-key"],queryFn:async()=>{const{data:s}=await k.from("app_settings").select("value").eq("key","seatsio_workspace_key").maybeSingle();return((s==null?void 0:s.value)||"").trim()}}),{data:Q}=$({queryKey:["store-sector-links"],queryFn:async()=>{const{data:s,error:r}=await k.from("subscription_type_sectors").select("subscription_type_id, sector_id");if(r)throw r;return s}}),Re=s=>{if(!s)return;const r=(K||[]).find(i=>i.id===s),o=(r==null?void 0:r.seatsio_season_key)||(r==null?void 0:r.seatsio_event_key);if(!(!r||!r.has_seats||!o))return Be||console.warn("[Seats.io] Sector numerado sin Workspace Key configurada. Configúrala en /admin/configuracion-hub?tab=seatsio"),{eventKey:o,workspaceKey:Be||"",chartKey:r.seats_chart_key||null,name:r.name||null}},Ke=s=>As(K,Q,s);N.useEffect(()=>{const s=ee.get("plan");if(s&&(b!=null&&b.length)&&!L){const r=b.find(o=>o.code===s);if(r){te(r),R("sociedades");const o=new URLSearchParams(window.location.search);o.delete("plan"),window.history.replaceState(null,"",`${window.location.pathname}${o.toString()?`?${o.toString()}`:""}`)}}},[b,ee,L,R]);const ge=us||hs||bs;if(L)return e.jsx(pe,{children:e.jsx(_e,{product:{id:L.id,name:L.name,description:L.description,accentColor:L.border_color,icon:"crown",price:Number(L.price_annual),hasPhysicalCredential:L.has_physical_credential??!1,physicalCredentialCost:L.physical_credential_cost||50,benefits:Array.isArray(L.benefits)?L.benefits:[],inAdvance:C,nextSeasonStartDate:C?(q==null?void 0:q.start_date)??void 0:void 0,nextSeasonName:C?(q==null?void 0:q.name)??void 0:void 0},productType:"membership",onBack:()=>te(null),returnPath:"/tienda?tab=sociedades",paymentBlock:Ve})});if(P){const s=P.socio,r=P.subscription_types;Number(P.abono_price??0);
1const o=Number(P.total_price??0),i=Ke(P.subscription_type_id),d=(K||[]).filter(a=>i.includes(a.id)),u=i.length>1?ke||i[0]||null:i[0]||null;return e.jsx(pe,{children:e.jsx(_e,{product:{id:P.id,name:P.name,description:P.description,accentColor:s==null?void 0:s.border_color,icon:"sparkles",price:o,membershipTypeId:P.socio_subscription_type_id,subscriptionTypeId:P.subscription_type_id,comboId:P.id,sectorId:u||void 0,sectorOptions:i.length>1?d.map(a=>({id:a.id,name:a.name})):void 0,numberedSector:Re(u||void 0),membershipName:s==null?void 0:s.name,subscriptionName:r==null?void 0:r.name,hasPhysicalCredential:(r==null?void 0:r.has_physical_credential)??(s==null?void 0:s.has_physical_credential)??!1,physicalCredentialCost:Number((r==null?void 0:r.physical_credential_cost)??(s==null?void 0:s.physical_credential_cost)??50),benefits:[...Array.isArray(s==null?void 0:s.benefits)?s.benefits:[],...Array.isArray(r==null?void 0:r.includes)?r.includes:[]],inAdvance:!1,nextSeasonStartDate:void 0,nextSeasonName:void 0},productType:"combo",onSectorChange:oe,onBack:()=>{ue(null),oe(null)},returnPath:"/tienda?tab=combos",paymentBlock:xs})})}if(S){const s=Ke(S.id),r=(K||[]).filter(u=>s.includes(u.id)),o=s.length>1?ke||s[0]||null:s[0]||null,i=ne.get(S.id),d=O&&i!=null;return e.jsx(pe,{children:e.jsx(_e,{product:{id:S.id,name:d?`${S.name} · Precio Socio`:S.name,description:S.description,accentColor:((Qe=c==null?void 0:c.mt)==null?void 0:Qe.border_color)||(p==null?void 0:p.borderColor)||(S.is_premium?"hsl(45 90% 55%)":null),icon:"ticket",price:d?i:se(S),hasPhysicalCredential:S.has_physical_credential,physicalCredentialCost:S.physical_credential_cost||50,sectorId:o||void 0,sectorOptions:s.length>1?r.map(u=>({id:u.id,name:u.name}
1)):void 0,numberedSector:Re(o||void 0),benefits:Array.isArray(S.includes)?S.includes:[],parentMembershipId:d?cs:void 0},productType:"subscription",onSectorChange:oe,onBack:()=>{he(null),oe(null)},returnPath:"/tienda?tab=abonos"})})}return e.jsxs(pe,{title:"TIENDA",children:[Te&&e.jsx(v,{className:"mb-6 rounded-2xl border-2 border-amber-500/50 bg-amber-500/5",children:e.jsxs(A,{className:"p-4 flex flex-col md:flex-row md:items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 bg-amber-500/15",children:e.jsx(ss,{className:"w-5 h-5 text-amber-600 dark:text-amber-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-display font-bold text-sm text-amber-700 dark:text-amber-400",children:"Cuotas en mora de tu sociedad actual"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Tienes ",x==null?void 0:x.overdueCount," cuota",((x==null?void 0:x.overdueCount)??0)>1?"s":""," vencida",((x==null?void 0:x.overdueCount)??0)>1?"s":""," de tu membresÃa vigente por un total de ",e.jsxs("strong",{translate:"no",children:["Bs ",Number((x==null?void 0:x.overdueTotal)||0).toFixed(2)]}),". Puedes explorar nuevas membresÃas, pero para adquirir una nueva sociedad (Celeste, Dorado o Platino) primero debes regularizar los pagos de la gestión actual. Los abonos siguen disponibles."]})]}),e.jsx(w,{size:"sm",variant:"outline",className:"shrink-0 border-amber-500/50",onClick:()=>E("/pagos/socios"),children:"Ir a pagos"})]})}),e.jsxs(ws,{value:os,onValueChange:s=>R(s),className:"space-y-8",children:[e.jsxs(Cs,{className:"grid w-full max-w-2xl mx-auto grid-cols-3 h-12 bg-card border border-border shadow-sm",children:[e.jsxs(je,{value:"sociedades",className:"gap-2 text-sm font-semibold data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",children:[e.jsx(B,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Sociedades"}),e.jsx("span",{className:"sm:hidden",children:"Socio"})]}),e.jsxs(je,{value:"combos",className:"gap-2 text-sm font-semibold data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",children:[e.jsx(M,{className:"w-4 h-4"}),"Combos"]}),e.jsxs(je,{value:"abonos",className:"gap-2 text-sm font-semibold data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",children:[e.jsx(G,{className:"w-4 h-4"}),"Abonos"]})]}),e.jsxs(Ne,{value:"sociedades",className:"space-y-6 animate-fade-in",children:[C&&c&&e.jsx(v,{className:"rounded-2xl border-2 overflow-hidden",style:{borderColor:((He=c.mt)==null?void 0:He.border_color)||"hsl(var(--primary))"},children:e.jsxs(A,{className:"p-5 flex flex-col md:flex-row md:items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shrink-0",style:{backgroundColor:`${((Je=c.mt)==null?void 0:Je.border_color)||"hsl(var(--primary))"}20`},children:e.jsx(B,{className:"w-6 h-6",style:{color:((Xe=c.mt)==null?void 0:Xe.border_color)||"hsl(var(--primary))"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(z,{variant:"outline",className:"text-[10px] font-semibold",children:"Tu sociedad actual"}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:(Ze=n==null?void 0:n.current)==null?void 0:Ze.name})]}),e.jsx("h3",{className:"font-display font-bold text-lg mt-1",children:(es=c.mt)==null?void 0:es.name}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Vigente hasta ",new Date(c.end_date).toLocaleDateString("es-BO",{day:"2-digit",month:"long",year:"numeric"}),".",F&&e.jsxs(e.Fragment,{children:[" Puedes adquirir tu sociedad ",e.jsxs("strong",{children:["anticipada para ",F]}),", que se activará al vencer la actual."]})]})]}),F&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-primary shrink-0",children:[e.jsx(rs,{className:"w-4 h-4"}),"Compra anticipada ",F]})]})}),e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold mb-2",children:"CategorÃas de Socio"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-md mx-auto",children:C&&F?`Adquiere tu sociedad anticipada para la temporada ${F}. Se activará automáticamente al vencer tu sociedad actual.`:"Conviértete en socio y accede a beneficios exclusivos durante toda la temporada."})]}),ge?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3 md:gap-5",children:[1,2,3,4].map(s=>e.jsx(ce,{className:"h-72 rounded-2xl"},s))}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"md:hidden space-y-6",children:[e.jsx("div",{className:"grid grid-cols-2 gap-2",children:b==null?void 0:b.map(s=>{const r=xe===s.id,o=s.border_color||void 0,i=s.code==="socio_platino",d=s.code==="socio_dorado";return e.jsxs("button",{onClick:()=>we(s.id),className:W("relative rounded-xl p-3 text-left transition-all border-2 flex flex-col gap-1",r?"shadow-lg ring-1 ring-primary/30":"opacity-70 hover:opacity-100"),style:{borderColor:r?o||"hsl(var(--primary))":"hsl(var(--border))",backgroundColor:r&&o?`${o}10`:void 0},children:[(i||d)&&e.jsx("span",{className:"absolute -top-2.5 right-2 text-[10px] font-bold px-2 py-0.5 rounded-full text-primary-foreground",style:{backgroundColor:o||"hsl(var(--primary))"},children:i?"Premium":"Popular"}),e.jsx("span",{className:"font-display font-bold text-sm",children:s.name}),e.jsx("span",{className:"text-[11px] text-muted-foreground line-clamp-1",children:s.description}),r&&e.jsx("div",{className:"absolute bottom-2 right-2",children:e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center",style:{backgroundColor:o||"hsl(var(--primary))"},children:e.jsx(I,{className:"w-3 h-3 text-primary-foreground"})})})]},s.id)})}),(()=>{const s=(b==null?void 0:b.find(i=>i.id===xe))||(b==null?void 0:b[0]);if(!s)return null;const r=Array.isArray(s.benefits)?s.benefits:[],o=s.border_color||void 0;return!xe&&(b!=null&&b.length)&&setTimeout(()=>we(b[0].id),0),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-baseline justify-between border-b border-border pb-3",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Precio anual"}),e.jsxs("span",{className:"text-xl font-black",style:{color:o||void 0},translate:"no",children:["Bs ",Number(s.price_annual)]})]}),r.length>0&&e.jsx("div",{className:"divide-y divide-border",children:r.map((i,d)=>e.jsxs("div",{className:"flex items-center justify-between py-2.5 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx(I,{className:"w-4 h-4 shrink-0 ml-2",style:{color:o||"hsl(var(--primary))"}})]},d))}),e.jsx(w,{className:"w-full h-12 font-bold rounded-xl text-base",style:{backgroundColor:o||void 0,color:o?"#fff":void 0},onClick:()=>be(te)(s),children:C&&F?`${s.name} · Anticipada ${F}`:`Comprar ${s.name}`}),e.jsxs(w,{className:"w-full h-10 font-medium rounded-xl text-sm",variant:"ghost",onClick:()=>{R("combos"),J(s.id)},children:["Ver Combos ",e.jsx(me,{className:"w-4 h-4 ml-1"})]})]})})()]}),e.jsx("div",{className:"hidden md:grid md:grid-cols-2 lg:grid-cols-4 gap-4",children:b==null?void 0:b.map(s=>{const r=Array.isArray(s.benefits)?s.benefits:[],o=s.code==="socio_platino",i=s.code==="socio_dorado",d=s.border_color||void 0,u=C&&(c==null?void 0:c.socio_subscription_type_id
1)===s.id;return e.jsxs(v,{className:"relative overflow-hidden rounded-2xl border-2 transition-all hover:shadow-xl hover:-translate-y-1 group bg-card",style:{borderColor:d||void 0},children:[s.banner_url?e.jsx("div",{className:"relative aspect-[16/10] overflow-hidden",style:{background:d?`${d}1a`:"hsl(var(--muted))"},children:e.jsx("img",{src:s.banner_url,alt:s.name,className:"w-full h-full object-contain group-hover:scale-105 transition-transform duration-500"})}):e.jsx("div",{className:"h-16 bg-gradient-to-br from-primary/20 to-primary/5"}),u?e.jsx("div",{className:"absolute top-3 right-3 z-10",children:e.jsxs(z,{className:"bg-emerald-600 text-white shadow-lg text-[10px]",children:[e.jsx(I,{className:"w-3 h-3 mr-1"})," Tu sociedad"]})}):o?e.jsx("div",{className:"absolute top-3 right-3 z-10",children:e.jsxs(z,{className:"bg-primary text-primary-foreground shadow-lg text-[10px]",children:[e.jsx(B,{className:"w-3 h-3 mr-1"})," Premium"]})}):i?e.jsx("div",{className:"absolute top-3 right-3 z-10",children:e.jsxs(z,{className:"bg-accent text-accent-foreground shadow-lg text-[10px]",children:[e.jsx(Ns,{className:"w-3 h-3 mr-1"})," Popular"]})}):null,e.jsxs(A,{className:"p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display text-lg font-bold",children:s.name}),s.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:s.description})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-2xl font-black",style:{color:d||void 0},translate:"no",children:["Bs ",Number(s.price_annual)]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"/ año"})]}),r.length>0&&e.jsxs("ul",{className:"space-y-1",children:[r.slice(0,4).map((a,l)=>e.jsxs("li",{className:"flex items-start gap-1.5 text-xs",children:[e.jsx(I,{className:"w-3.5 h-3.5 shrink-0 mt-0.5",style:{color:d||"hsl(var(--primary))"}}),e.jsx("span",{className:"text-muted-foreground",children:a})]},l)),r.length>4&&e.jsxs("li",{className:"text-[11px] text-muted-foreground pl-5",children:["+",r.length-4," más"]})]}),e.jsxs("div",{className:"space-y-1.5 pt-1",children:[e.jsx(w,{className:"w-full h-10 font-semibold rounded-xl text-sm",variant:o?"default":"outline",onClick:()=>be(te)(s),children:C&&F?e.jsxs(e.Fragment,{children:[e.jsx(rs,{className:"w-4 h-4 mr-1"})," Anticipada ",F]}):e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"w-4 h-4 mr-1"})," Comprar"]})}),e.jsxs(w,{className:"w-full h-8 font-medium rounded-xl text-xs",variant:"ghost",onClick:()=>{R("combos"),J(s.id)},children:["Ver Combos ",e.jsx(me,{className:"w-3 h-3 ml-1"})]})]})]})]},s.id)})})]})]}),e.jsxs(Ne,{value:"combos",className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"text-center mb-2",children:[e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold mb-2",children:"Combos Sociedad + Abono"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-lg mx-auto",children:"Combina tu membresÃa de socio con un abono de estadio a un precio especial."})]}),(()=>{var o,i,d,u;const s=Se||qe||X||ds,r=C&&$e&&(Fe||!O);if(s)return e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[1,2,3,4].map(a=>e.jsx(ce,{className:"h-56 rounded-2xl"},a))});if(C&&Fe&&!r)return e.jsx(v,{className:"max-w-2xl mx-auto rounded-2xl border-2 border-emerald-500/40 bg-emerald-500/5",children:e.jsxs(A,{className:"p-6 flex flex-col md:flex-row md:items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shrink-0 bg-emerald-500/15",children:e.jsx(I,{className:"w-6 h-6 text-emerald-600 dark:text-emerald-400"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[e.jsxs("h3",{className:"font-display font-bold text-base text-emerald-700 dark:text-emerald-400",children:["Ya completaste tu Combo para la ",((o=n==null?void 0:n.current)==null?void 0:o.name)??"temporada actual"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Ya completaste el beneficio de combo correspondiente al perfil seleccionado para la gestión vigente. Si deseas adquirir otro combo, deberás crear o seleccionar un perfil diferente."}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[e.jsx(w,{size:"sm",variant:"outline",onClick:()=>E("/cuenta?tab=family"),children:"Gestionar perfiles"}),e.jsxs(w,{size:"sm",variant:"ghost",onClick:()=>R("abonos"),children:["Ver abonos estándar ",e.jsx(me,{className:"w-3 h-3 ml-1"})]}),e.jsxs(w,{size:"sm",variant:"outline",className:"border-emerald-500/50 text-emerald-700 dark:text-emerald-400",onClick:()=>de(!0),children:[e.jsx(G,{className:"w-3 h-3 mr-1"})," Ver combos"]})]})]})]})});if(!r&&C&&Te)return e.jsx(v,{className:"max-w-2xl mx-auto rounded-2xl border-2 border-amber-500/50 bg-amber-500/5",children:e.jsxs(A,{className:"p-6 flex flex-col md:flex-row md:items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shrink-0 bg-amber-500/15",children:e.jsx(ss,{className:"w-6 h-6 text-amber-600 dar
1k:text-amber-400"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[e.jsx("h3",{className:"font-display font-bold text-base text-amber-700 dark:text-amber-400",children:"Regulariza tu sociedad para completar el combo"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tienes cuotas vencidas de tu sociedad actual. Para completar tu combo con el beneficio de abono debes regularizar primero los pagos pendientes."}),e.jsx(w,{size:"sm",variant:"outline",className:"border-amber-500/50",onClick:()=>E("/pagos/socios"),children:"Ir a pagos"})]})]})});if(!r&&C&&O&&(((i=p==null?void 0:p.availableSubscriptions)==null?void 0:i.length)??0)>0){const a=(p==null?void 0:p.borderColor)||"hsl(var(--primary))";return e.jsxs("div",{className:"space-y-5",children:[e.jsx(v,{className:"max-w-3xl mx-auto rounded-2xl border-2",style:{borderColor:a},children:e.jsxs(A,{className:"p-5 flex flex-col md:flex-row md:items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shrink-0",style:{backgroundColor:`${a}20`},children:e.jsx(M,{className:"w-6 h-6",style:{color:a}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(z,{variant:"outline",className:"text-[10px] font-semibold mb-1",children:"Completar Combo"}),e.jsx("h3",{className:"font-display font-bold text-base",children:"Suma tu abono al precio de socio"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Tu sociedad ",e.jsx("strong",{children:p==null?void 0:p.membershipTypeName})," está vigente. Elige el abono que prefieras y obtén automáticamente el ",e.jsx("strong",{children:"precio preferencial de socio"})," para completar tu combo de la temporada ",((d=n==null?void 0:n.current)==null?void 0:d.name)??"actual","."]})]})]})}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2 md:gap-4",children:p.availableSubscriptions.map(l=>{const m=(fe??[]).find(g=>g.id===l.id)??{id:l.id,name:l.name,slug:l.slug,base_price:l.basePrice,description:l.description,includes:[],is_premium:!1,has_physical_credential:!1,physical_credential_cost:0},t=(K||[]).filter(g=>(Q||[]).some(T=>T.subscription_type_id===l.id&&T.sector_id===g.id)).map(g=>g.name),h=Math.max(0,Number(l.basePrice)-Number(l.memberPrice));return e.jsxs(v,{onClick:()=>he(m),className:"relative overflow-hidden rounded-xl md:rounded-2xl border-2 transition-all hover:shadow-xl hover:-translate-y-1 cursor-pointer group bg-card flex flex-col",style:{borderColor:a},children:[e.jsx("div",{className:"h-1.5 w-full",style:{backgroundColor:a}}),e.jsx("div",{className:"absolute top-2 right-2 z-10",children:e.jsxs(z,{className:"text-[9px] md:text-[10px] gap-1 px-1.5 py-0",style:{backgroundColor:a,color:"#fff"},children:[e.jsx(M,{className:"w-3 h-3"}),e.jsx("span",{className:"hidden md:inline",children:"Precio"})," Socio"]})}),e.jsxs(A,{className:"p-3 md:p-4 flex flex-col flex-1 gap-2 md:gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-sm md:text-base leading-tight pr-14 md:pr-20 break-words",children:l.name}),l.description&&e.jsx("p",{className:"text-[11px] md:text-xs text-muted-foreground mt-1 line-clamp-2 hidden md:block",children:l.description})]}),e.jsxs("div",{className:"hidden md:flex flex-wrap gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-secondary/80 rounded-md px-2 py-0.5",children:[e.jsx(B,{className:"w-3 h-3",style:{color:a}}),p==null?void 0:p.membershipTypeName]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-secondary/80 rounded-md px-2 py-0.5",children:[e.jsx(G,{className:"w-3 h-3 text-primary"}),l.name]}),t.length>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-secondary/80 rounded-md px-2 py-0.5",children:[e.jsx(D,{className:"w-3 h-3 text-primary"}),t.join(", ")]})]}),t.length>0&&e.jsxs("div",{className:"md:hidden flex items-center gap-1 text-[10px] text-muted-foreground line-clamp-1",children:[e.jsx(D,{className:"w-3 h-3 shrink-0",style:{color:a}}),e.jsx("span",{className:"truncate",children:t.join(", ")})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-end justify-between pt-2 border-t border-border gap-1",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-1 md:gap-1.5 flex-wrap",children:[h>0&&e.jsxs("span",{className:"text-[10px] md:text-[11px] text-muted-foreground line-through",translate:"no",children:["Bs ",l.basePrice]}),e.jsxs("span",{className:"text-lg md:text-xl font-black leading-none",style:{color:a},translate:"no",children:["Bs ",l.memberPrice]})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:h>0?`Ahorras Bs ${h.toFixed(2)}`:"/ temporada"})]}),e.jsxs("div",{className:"flex items-center gap-0.5 text-[11px] md:text-xs font-semibold text-primary group-hover:gap-2 transition-all shrink-0",children:[e.jsx("span",{className:"hidden md:inline",children:"Completar"}),e.jsx(ye,{className:"w-4 h-4"})]})]})]})]},l.id)})})]})}return!r&&!$e&&C&&!O?e.jsx(v,{className:"max-w-2xl mx-auto rounded-2xl border-2 border-primary/40 bg-primary/5",children:e.jsxs(A,{className:"p-6 flex flex-col md:flex-row md:items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shrink-0 bg-primary/15",children:e.jsx(M,{className:"w-6 h-6 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[e.jsx("h3",{className:"font-display font-bold text-base text-primary",children:"No encontramos combos disponibles"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Por el momento no hay combos disponibles para mostrar. Vuelve a intentarlo más adelante o revisa las demás opciones de la tienda."}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[e.jsx(w,{size:"sm",variant:"outline",onClick:()=>E("/cuenta?tab=family"),children:"Gestionar perfiles"}),e.jsxs(w,{size:"sm",variant:"ghost",onClick:()=>de(!0),children:[e.jsx(G,{className:"w-3 h-3 mr-1"})," Ver combos"]})]})]})]})}):e.jsxs(e.Fragment,{children:[r&&e.jsx(v,{className:"max-w-2xl mx-auto rounded-2xl border-2 border-emerald-500/40 bg-emerald-500/5",children:e.jsxs(A,{className:"p-6 flex flex-col md:flex-row md:items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shrink-0 bg-emerald-500/15",children:e.jsx(I,{className:"w-6 h-6 text-emerald-600 dark:text-emerald-400"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[e.jsxs("h3",{className:"font-display font-bold text-base text-emerald-700 dark:text-emerald-400",children:["Ya completaste tu Combo para la ",((u=n==null?void 0:n.current)==null?void 0:u.name)??"temporada actual"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Ya completaste el beneficio de combo correspondiente al perfil seleccionado para la gestión vigente. A continuación puedes ver los combos disponibles, pero no podrás adquirirlos con este perfil."}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[e.jsx(w,{size:"sm",variant:"outline",onClick:()=>E("/cuenta?tab=family"),children:"Gestionar perfiles"}),e.jsxs(w,{size:"sm",variant:"ghost",onClick:()=>R("abonos"),children:["Ver abonos estándar ",e.jsx(me,{className:"w-3 h-3 ml-1"})]}),e.jsx(w,{size:"sm",variant:"outline",className:"border-emerald-500/50 text-emerald-700 dark:text-emerald-400",onClick:()=>de(!1),children:"Ocultar combos"})]})]})]})}),V&&V.length>0&&e.jsxs("div",{className:"space-y-3 bg-card/60 border border-border rounded-xl p-4 max-w-3xl mx-auto w-full",children:[b&&b.length>1&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider text-center",children:"Sociedad"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 justify-center",children:[e.jsx("button",{onClick:()=>J(null),className:W("px-3 py-1.5 rounded-lg text-xs font-medium border transition-all",re?"bg-card text-muted-foreground border-border hover:border-primary/40":"bg-primary text-primary-foreground border-primary shadow-sm"),children:"Todas"}),b.map(a=>{const l=(V==null?void 0:V.filter(h=>h.socio_subscription_type_id===a.id).length)||0;if(l===0)return null;const m=re===a.id,t=a.border_color||void 0;return e.jsxs("button",{onClick:()=>J(m?null:a.id),className:W("px-3 py-1.5 rounded-lg text-xs font-medium border-2 transition-all inline-flex items-center gap-1.5",m?"shadow-sm text-foreground":"bg-card text-muted-foreground hover:text-foreground"),style:{borderColor:m?t||"hsl(var(--border))":t?`${t}50`:"hsl(var(--border))",backgroundColor:m&&t?`${t}20`:void 0},children:[t&&e.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:t}}),a.name,e.jsxs("span",{className:"opacity-60",children:["(",l,")"]})]},a.id)})]})]}),(()=>{const a=new Set((V||[]).map(t=>
1t.subscription_type_id).filter(Boolean)),l=new Set((Q||[]).filter(t=>a.has(t.subscription_type_id)).map(t=>t.sector_id)),m=(K||[]).filter(t=>(t.venue==="principal"||!t.venue)&&l.has(t.id));return m.length>1&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider text-center",children:"Sector"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 justify-center",children:[e.jsx("button",{onClick:()=>Ce(null),className:W("px-3 py-1.5 rounded-lg text-xs font-medium border transition-all",ae?"bg-card text-muted-foreground border-border hover:border-primary/40":"bg-primary text-primary-foreground border-primary shadow-sm"),children:"Todos"}),m.map(t=>{const h=ae===t.id;return e.jsxs("button",{onClick:()=>Ce(h?null:t.id),className:W("px-3 py-1.5 rounded-lg text-xs font-medium border transition-all inline-flex items-center gap-1.5",h?"bg-primary text-primary-foreground border-primary shadow-sm":"bg-card text-muted-foreground border-border hover:border-primary/40"),children:[e.jsx(D,{className:"w-3 h-3"}),t.name]},t.id)})]})]})})()]}),e.jsx("div",{className:"space-y-3 mt-4",children:ge?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[1,2,3,4].map(a=>e.jsx(ce,{className:"h-56 rounded-2xl"},a))}):!V||V.length===0?e.jsxs(v,{className:"p-12 text-center rounded-2xl border-dashed",children:[e.jsx(M,{className:"w-10 h-10 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:"No hay combos disponibles por el momento."})]}):(()=>{const a=V.filter(t=>{const h=t.socio,g=t.subscription_types;return!(!h||!g||re&&t.socio_subscription_type_id!==re||ae&&!(Q||[]).filter(j=>
1j.subscription_type_id===t.subscription_type_id).map(j=>j.sector_id).includes(ae))}),l=(t="")=>{const h=t.toLowerCase();return h.includes("platino")?0:h.includes("dorado")?1:h.includes("celeste")?2:h.includes("hincha")?3:99},m=(t="")=>{const h=t.toLowerCase();return h.includes("curva")?0:h.includes("general")?1:h.includes("preferencia")?2:h.includes("butaca")?3:99};return a.sort((t,h)=>{var T,j,Y,H;const g=l((T=t.socio)==null?void 0:T.name)-l((j=h.socio)==null?void 0:j.name);return g!==0?g:m((Y=t.subscription_types)==null?void 0:Y.name)-m((H=h.subscription_types)==null?void 0:H.name)}),a.length===0?e.jsx(v,{className:"p-8 text-center rounded-xl",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"No hay combos que coincidan con los filtros seleccionados."})}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2 md:gap-4",children:a.map(t=>{const h=t.socio,g=t.subscription_types;if(!h||!g)return null;Number(t.abono_price??0);const T=Number(t.total_price??0),j=h.border_color||void 0,Y=g.is_premium,H=(Q||[]).filter(U=>
1U.subscription_type_id===t.subscription_type_id).map(U=>U.sector_id),y=(K||[]).filter(U=>H.includes(U.id)).map(U=>U.name);return e.jsxs(v,{onClick:r?void 0:()=>be(ue)(t),className:W("relative overflow-hidden rounded-xl md:rounded-2xl border-2 transition-all bg-card flex flex-col",r?"opacity-80 cursor-not-allowed":"hover:shadow-xl hover:-translate-y-1 cursor-pointer group"),style:{borderColor:j||"hsl(var(--border))"},children:[e.jsx("div",{className:"h-1.5 w-full",style:{backgroundColor:j||"hsl(var(--primary))"}}),r&&e.jsx("div",{className:"absolute top-2 left-2 z-10",children:e.jsxs(z,{variant:"secondary",className:"text-[9px] md:text-[10px] gap-1 px-1.5 py-0",children:[e.jsx(I,{className:"w-3 h-3"})," Adquirido"]})}),Y&&e.jsx("div",{className:"absolute top-2 right-2 z-10",children:e.jsxs(z,{className:"bg-primary text-primary-foreground text-[9px] md:text-[10px] gap-1 px-1.5 py-0",children:[e.jsx(B,{className:"w-3 h-3"}),"Premium"]})}),e.jsxs(A,{className:"p-3 md:p-4 flex flex-col flex-1 gap-2 md:gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-sm md:text-base leading-tight pr-10 md:pr-16 break-words",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2 hidden md:block",children:t.description})]}),e.jsxs("div",{className:"hidden md:flex flex-wrap gap-1.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-secondary/80 rounded-md px-2 py-0.5",children:[e.jsx(B,{className:"w-3 h-3",style:{color:j}}),h.name]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-secondary/80 rounded-md px-2 py-0.5",children:[e.jsx(G,{className:"w-3 h-3 text-primary"}),g.name]}),y.length>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-secondary/80 rounded-md px-2 py-0.5",children:[e.jsx(D,{className:"w-3 h-3 text-primary"}),y.join(", ")]})]}),e.jsxs("div",{className:"md:hidden flex flex-col gap-1 text-[10px] text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 line-clamp-1",children:[e.jsx(B,{className:"w-3 h-3 shrink-0",style:{color:j}}),e.jsx("span",{className:"truncate",children:h.name})]}),y.length>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 line-clamp-1",children:[e.jsx(D,{className:"w-3 h-3 shrink-0 text-primary"}),e.jsx("span",{className:"truncate",children:y.join(", ")})]})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-end justify-between pt-2 border-t border-border gap-1",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-lg md:text-xl font-black leading-none",style:{color:j},translate:"no",children:["Bs ",T]}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:"/ temporada"})]}),e.jsxs("div",{className:W("flex items-center gap-0.5 text-[11px] md:text-xs font-semibold shrink-0",r?"text-muted-foreground":"text-primary group-hover:gap-2 transition-all"),children:[e.jsx("span",{className:"hidden md:inline",children:r?"Ya adquirido":"Elegir"}),r?e.jsx(I,{className:"w-4 h-4"}):e.jsx(ye,{className:"w-4 h-4"})]})]})]})]},t.id)})})})()})]})})()]}),e.jsxs(Ne,{value:"abonos",className:"space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold mb-2",children:"Abonos de Estadio"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-md mx-auto",children:"Elige el plan de abono que mejor se adapte a ti."})]}),O&&e.jsx(v,{className:"rounded-2xl border-2 border-primary/40 bg-primary/5",children:e.jsxs(A,{className:"p-4 flex flex-col md:flex-row md:items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 bg-primary/15",children:e.jsx(M,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-display font-bold text-sm text-primary",children:"Precio de Socio disponible"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Tu sociedad ",e.jsx("strong",{children:p==null?void 0:p.membershipTypeName})," se encuentra vigente y al dÃa.",Z?" Te mostramos solo los abonos disponibles para tu membresÃa. El precio preferencial se aplicará automáticamente.":" Puedes adquirir un abono con beneficio de socio. El precio preferencial se aplicará automáticamente."]})]}),e.jsx(w,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>ps(s=>!s),children:Z?"Ver todos los abonos":"Ver solo los de mi membresÃa"})]})}),le.length>0&&e.jsx(v,{className:"rounded-2xl border-2",style:{borderColor:(f==null?void 0:f.borderColor)||"hsl(var(--primary))"},children:e.jsxs(A,{className:"p-4 flex flex-col md:flex-row md:items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{backgroundColor:`${(f==null?void 0:f.borderColor)||"hsl(var(--primary))"}20`},children:e.jsx(M,{className:"w-5 h-5",style:{color:(f==null?void 0:f.borderColor)||void 0}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-display font-bold text-sm",style:{color:(f==null?void 0:f.borderColor)||void 0},children:"Beneficio adicional disponible"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Como ",e.jsx("strong",{children:f==null?void 0:f.socioName})," ya tomaste tu Socio + Abono a precio de socio, por lo que puedes adquirir estos abonos adicionales exclusivos."]})]})]})}),(()=>{const s={principal:"Hernando Siles",tembladerani:"Tembladerani"},r=(p==null?void 0:p.borderColor)||"hsl(var(--primary))",o=Z,i=new Set(le.map(a=>a.id));let d=Z?(fe??[]).filter(a=>ne.has(a.id)):(fe??[]).filter(a=>a.__standardAbono);const u=(a="")=>{const l=a.toLowerCase();return l.includes("curva")?0:l.includes("general")?1:l.includes("preferencia")?2:l.includes("butaca")?3:99};if(d=[...d].sort((a,l)=>u(a.name)-u(l.name)),le.length>0){const a=new Set(d.map(m=>m.id));d=[...[...le].filter(m=>!a.has(m.id)).sort((m,t)=>u(m.name)-u(t.name)),...d]}return ge?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3 md:gap-5",children:[1,2,3,4].map(a=>e.jsx(ce,{className:"h-56 rounded-2xl"},a))}):!d||d.length===0?e.jsxs(v,{className:"p-12 text-center rounded-2xl border-dashed",children:[e.jsx(G,{className:"w-10 h-10 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-muted-foreground",children:Z?"No hay abonos disponibles para tu membresÃa por el momento.":"No hay abonos disponibles por el momento."})]}):e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2 md:gap-4",children:d.map(a=>{const l=(Q||[]).filter(y=>y.subscription_type_id===a.id).map(y=>y.sector_id),m=(K||[]).filter(y=>l.includes(y.id)),t=m.map(y=>y.name),h=Array.from(new Set(m.map(y=>y.venue||"principal"))),g=O&&ne.has(a.id),T=i.has(a.id)&&(f!=null&&f.borderColor)?f.borderColor:o&&g?r:null,j=T||"hsl(var(--primary))",Y=g?ne.get(a.id):se(a),H=g&&Number(se(a))!==Number(Y);return e.jsxs(v,{onClick:()=>he(a),className:"relative overflow-hidden rounded-xl md:rounded-2xl border-2 transition-all bg-card flex flex-col hover:shadow-xl hover:-translate-y-1 cursor-pointer group",style:{borderColor:j},children:[e.jsx("div",{className:"h-1.5 w-full",style:{backgroundColor:j}}),g&&e.jsx("div",{className:"absolute top-2 right-2 z-10",children:e.jsxs(z,{className:"text-[9px] md:text-[10px] gap-1 px-1.5 py-0",style:T?{backgroundColor:T,color:"#fff"}:void 0,children:[e.jsx(M,{className:"w-3 h-3"}),e.jsx("span",{className:"hidden md:inline",children:"Precio"})," Socio"]})}),!g&&a.is_premium&&e.jsx("div",{className:"absolute top-2 right-2 z-10",children:e.jsxs(z,{className:"bg-primary text-primary-foreground text-[9px] md:text-[10px] gap-1 px-1.5 py-0",children:[e.jsx(B,{className:"w-3 h-3"}),"Premium"]})}),e.jsxs(A,{className:"p-3 md:p-4 flex flex-col flex-1 gap-2 md:gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-sm md:text-base leading-tight pr-14 md:pr-20 break-words",children:a.name}),a.description&&e.jsx("p",{className:"text-[11px] md:text-xs text-muted-foreground mt-1 line-clamp-2 hidden md:block",children:a.description})]}),e.jsxs("div",{className:"hidden md:flex flex-wrap gap-1.5",children:[h.map(y=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-secondary/80 rounded-md px-2 py-0.5",children:[e.jsx(G,{className:"w-3 h-3 text-primary"}),s[y]||y]},y)),t.length>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-secondary/80 rounded-md px-2 py-0.5",children:[e.jsx(D,{className:"w-3 h-3 text-primary"}
1),t.join(", ")]})]}),t.length>0&&e.jsxs("div",{className:"md:hidden flex items-center gap-1 text-[10px] text-muted-foreground line-clamp-1",children:[e.jsx(D,{className:"w-3 h-3 shrink-0",style:{color:j}}),e.jsx("span",{className:"truncate",children:t.join(", ")})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-end justify-between pt-2 border-t border-border gap-1",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-1 md:gap-1.5 flex-wrap",children:[H&&e.jsxs("span",{className:"text-[10px] md:text-[11px] text-muted-foreground line-through",translate:"no",children:["Bs ",se(a)]}),e.jsxs("span",{className:"text-lg md:text-xl font-black leading-none",style:{color:j},translate:"no",children:["Bs ",Y]})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:"/ temporada"})]}),e.jsxs("div",{className:"flex items-center gap-0.5 text-[11px] md:text-xs font-semibold text-primary group-hover:gap-2 transition-all shrink-0",children:[e.jsx("span",{className:"hidden md:inline",children:"Comprar"}),e.jsx(ye,{className:"w-4 h-4"})]})]})]})]},a.id)})})})()]})]})]})}export{pr 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.